xunge/DecIR huggingface dataset:
int isLeapYear(int year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
je     1153 <isLeapYear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <isLeapYear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     1121 <isLeapYear+0x21>
xor    %eax,%eax
test   $0x3,%dil
je     1127 <isLeapYear+0x27>
ret
mov    $0x1,%eax
ret
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setae  %al
ret

LLVM IR (-O0):
define i32 @isLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 400
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 100
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 100
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int map_entries;
};
typedef TYPE_1__ Visual;

/* Variables and functions */
void set_Visual_map_entries(void *_p, int _v) {
  ((Visual *)_p)->map_entries = (int)_v;
}


x86 assembly (clang, -O0):
<set_Visual_map_entries>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_Visual_map_entries>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_Visual_map_entries(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_Visual_map_entries(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *);
scalar_t__ file_exists(char *);
int /*<<< orphan*/ unlink(char *);
void delete_file(char *filename) {
  unlink(filename);
  if (file_exists(filename)) {
    fatal_error("The delete_file() function does not work");
  }
}


x86 assembly (clang, -O0):
<delete_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x8(%rbp),%rdi
call   1040 <file_exists@plt>
cmp    $0x0,%rax
je     1164 <delete_file+0x34>
lea    0xea1(%rip),%rdi
call   1050 <fatal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_file>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
mov    %rbx,%rdi
call   1040 <file_exists@plt>
test   %rax,%rax
je     1153 <delete_file+0x23>
lea    0xeb3(%rip),%rdi
pop    %rbx
jmp    1050 <fatal_error@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"The delete_file() function does not work\00"
define void @delete_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @unlink(i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @file_exists(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"The delete_file() function does not work\00"
define void @delete_file(i8* %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = tail call i64 @file_exists(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @fatal_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main(int);
void start() { main(16); }


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1030 <main@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
mov    $0x10,%edi
jmp    1030 <main@plt>

LLVM IR (-O0):
define void @start() {
%1 = call i32 @main(i32 16)
ret void
}

LLVM IR (-O2):
define void @start() {
%1 = tail call i32 @main(i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World!\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t indent_length(const char *line) {
  size_t len = 0;
  assert(line != NULL);
  while (*line == ' ' || *line == '\t') {
    line++;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<indent_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     115b <indent_length+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116b <indent_length+0x5b>
jmp    1188 <indent_length+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1136 <indent_length+0x26>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent_length>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %eax,%eax
jmp    1134 <indent_length+0x24>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rbx,%rax,1),%ecx
cmp    $0x20,%cl
je     1130 <indent_length+0x20>
cmp    $0x9,%cl
je     1130 <indent_length+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define i64 @indent_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
br label %8
8: ; preds = %20, %1
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ true, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
%23 = load i64, i64* %3
%24 = add i64 %23, 1
store i64 %24, i64* %3
br label %8
25: ; preds = %18
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @indent_length(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
br label %5
5: ; preds = %9, %1
%6 = phi i8* [ %0, %1 ], [ %10, %9 ]
%7 = phi i64 [ 0, %1 ], [ %11, %9 ]
%8 = load i8, i8* %6
switch i8 %8, label %12 [
i8 32, label %9
i8 9, label %9
]
9: ; preds = %5, %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add i64 %7, 1
br label %5
12: ; preds = %5
ret i64 %7
}
unsigned int queue_wrap(unsigned int i) { return i & (256 - 1); }


x86 assembly (clang, -O0):
<queue_wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_wrap>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @queue_wrap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}

LLVM IR (-O2):
define i32 @queue_wrap(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EM_reset(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ yyparse();
void parse(char *fn) {
  EM_reset(fn);
  if (yyparse() == 0)
    fprintf(stdout, "Parsing successful!\n");
  else
    fprintf(stderr, "Parsing failed\n");
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <EM_reset@plt>
mov    $0x0,%al
call   1040 <yyparse@plt>
cmp    $0x0,%rax
jne    1170 <parse+0x40>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1185 <parse+0x55>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %rax
call   1030 <EM_reset@plt>
xor    %eax,%eax
call   1040 <yyparse@plt>
test   %rax,%rax
lea    0xeb9(%rip),%rax
lea    0xec7(%rip),%rsi
cmove  %rax,%rsi
mov    0x2e87(%rip),%rax
cmove  0x2e77(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [21 x i8] c"Parsing successful!\0A\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"Parsing failed\0A\00"
define void @parse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @EM_reset(i8* %3)
%5 = call i64 (...) @yyparse()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stdout
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %13
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [21 x i8] c"Parsing successful!\0A\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"Parsing failed\0A\00"
define void @parse(i8* %0) {
%2 = tail call i32 @EM_reset(i8* %0)
%3 = tail call i64 (...) @yyparse()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
%6 = load i32, i32* @stdout
%7 = load i32, i32* @stderr
%8 = select i1 %4, i32 %6, i32 %7
%9 = tail call i32 @fprintf(i32 %8, i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/ *, char, char);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
WINDOW *create_newwin(int height, int width, int starty, int startx) {
  WINDOW *local_win;
  local_win = newwin(height, width, starty, startx);
  box(local_win, '|', '-');
  wrefresh(local_win);
  return local_win;
}


x86 assembly (clang, -O0):
<create_newwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <newwin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x7c,%esi
mov    $0x2d,%edx
call   1050 <box@plt>
mov    -0x18(%rbp),%rdi
call   1030 <wrefresh@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_newwin>:
push   %rbx
call   1040 <newwin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x7c,%esi
mov    $0x2d,%edx
call   1050 <box@plt>
mov    %rbx,%rdi
call   1030 <wrefresh@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @create_newwin(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32* @newwin(i32 %10, i32 %11, i32 %12, i32 %13)
store i32* %14, i32** %9
%15 = load i32*, i32** %9
%16 = call i32 @box(i32* %15, i8 signext 124, i8 signext 45)
%17 = load i32*, i32** %9
%18 = call i32 @wrefresh(i32* %17)
%19 = load i32*, i32** %9
ret i32* %19
}

LLVM IR (-O2):
define i32* @create_newwin(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @newwin(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @box(i32* %5, i8 signext 124, i8 signext 45)
%7 = tail call i32 @wrefresh(i32* %5)
ret i32* %5
}
void acoustic_enforce_free_surf_cuda_(long *Mesh_pointer) {}


x86 assembly (clang, -O0):
<acoustic_enforce_free_surf_cuda_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<acoustic_enforce_free_surf_cuda_>:
ret

LLVM IR (-O0):
define void @acoustic_enforce_free_surf_cuda_(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
ret void
}

LLVM IR (-O2):
define void @acoustic_enforce_free_surf_cuda_(i64* nocapture %0) {
ret void
}
/* Variables and functions */
char *get_socket_path();
int /*<<< orphan*/ unlink(char const *);
void unlink_envoy_socket(void) {
  const char *socket = get_socket_path();
  if (socket[0] != '@')
    unlink(socket);
}


x86 assembly (clang, -O0):
<unlink_envoy_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_socket_path@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
je     114c <unlink_envoy_socket+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_envoy_socket>:
push   %rax
xor    %eax,%eax
call   1040 <get_socket_path@plt>
cmpb   $0x40,(%rax)
jne    112f <unlink_envoy_socket+0xf>
pop    %rax
ret
mov    %rax,%rdi
pop    %rax
jmp    1030 <unlink@plt>

LLVM IR (-O0):
define void @unlink_envoy_socket() {
%1 = alloca i8*
%2 = call i8* (...) @get_socket_path()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 64
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i8*, i8** %1
%10 = call i32 @unlink(i8* %9)
br label %11
11: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
define void @unlink_envoy_socket() {
%1 = tail call i8* (...) @get_socket_path()
%2 = load i8, i8* %1
%3 = icmp eq i8 %2, 64
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @unlink(i8* %1)
br label %6
6: ; preds = %4, %0
ret void
}
void add_timer(struct dummy_timer_list *dummy) { return; }


x86 assembly (clang, -O0):
<add_timer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_timer>:
ret

LLVM IR (-O0):
%struct.dummy_timer_list = type opaque
define void @add_timer(%struct.dummy_timer_list* %0) {
%2 = alloca %struct.dummy_timer_list*
store %struct.dummy_timer_list* %0, %struct.dummy_timer_list** %2
ret void
}

LLVM IR (-O2):
%struct.dummy_timer_list = type opaque
define void @add_timer(%struct.dummy_timer_list* nocapture %0) {
ret void
}
void XBitmapBitOrder() {}


x86 assembly (clang, -O0):
<XBitmapBitOrder>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XBitmapBitOrder>:
ret

LLVM IR (-O0):
define void @XBitmapBitOrder() {
ret void
}

LLVM IR (-O2):
define void @XBitmapBitOrder() {
ret void
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct stack *);
void deleteStack(struct stack *stack) { free(stack); }


x86 assembly (clang, -O0):
<deleteStack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteStack>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
define void @deleteStack(%struct.stack* %0) {
%2 = alloca %struct.stack*
store %struct.stack* %0, %struct.stack** %2
%3 = load %struct.stack*, %struct.stack** %2
%4 = call i32 @free(%struct.stack* %3)
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @deleteStack(%struct.stack* nocapture %0) {
%2 = tail call i32 @free(%struct.stack* %0)
ret void
}
/* Variables and functions */
float cubic_in(float, float, float);
float cubic_f_in(float step, float max_steps, float max_val) {
  return cubic_in(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<cubic_f_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <cubic_in@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_f_in>:
jmp    1030 <cubic_in@plt>

LLVM IR (-O0):
define float @cubic_f_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @cubic_in(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @cubic_f_in(float %0, float %1, float %2) {
%4 = tail call float @cubic_in(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ process_can(int /*<<< orphan*/);
void CAN1_TX_IRQHandler() { process_can(0); }


x86 assembly (clang, -O0):
<CAN1_TX_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <process_can@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CAN1_TX_IRQHandler>:
xor    %edi,%edi
jmp    1030 <process_can@plt>

LLVM IR (-O0):
define void @CAN1_TX_IRQHandler() {
%1 = call i32 @process_can(i32 0)
ret void
}

LLVM IR (-O2):
define void @CAN1_TX_IRQHandler() {
%1 = tail call i32 @process_can(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *bn_parsenum(char *numstr) {
  char *number;
  number = (char *)malloc(10 * sizeof(char));
  number[0] = '\0';
  return number;
}


x86 assembly (clang, -O0):
<bn_parsenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_parsenum>:
push   %rax
mov    $0xa,%edi
call   1030 <malloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @bn_parsenum(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 0, i8* %7
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @bn_parsenum(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8 0, i8* %3
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
char *strrchr(char *, char);
void append_ext_UNSAFE(char *outbuf, const char *ext) {
  char *p = strrchr(outbuf, '.');
  if (!p)
    strcat(outbuf, ext);
  else
    strcpy(p, ext);
}


x86 assembly (clang, -O0):
<append_ext_UNSAFE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <append_ext_UNSAFE+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
jmp    117c <append_ext_UNSAFE+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_ext_UNSAFE>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     115b <append_ext_UNSAFE+0x2b>
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strcat@plt>

LLVM IR (-O0):
define void @append_ext_UNSAFE(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strrchr(i8* %6, i8 signext 46)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @strcat(i8* %11, i8* %12)
br label %18
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = call i32 @strcpy(i8* %15, i8* %16)
br label %18
18: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
define void @append_ext_UNSAFE(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @strcat(i8* %0, i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @strcpy(i8* %3, i8* %1)
br label %9
9: ; preds = %7, %5
ret void
}
int do_state_74(char c, int *state, char *word, int *length) {
  if (c == '*') {
    *state = 75;
  } else if (c == '\n') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_state_74>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
jne    1132 <do_state_74+0x32>
mov    -0x10(%rbp),%rax
movl   $0x4b,(%rax)
jmp    1150 <do_state_74+0x50>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    114b <do_state_74+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1157 <do_state_74+0x57>
jmp    1150 <do_state_74+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_state_74>:
cmp    $0xa,%dil
je     1115 <do_state_74+0x15>
cmp    $0x2a,%dil
jne    1112 <do_state_74+0x12>
movl   $0x4b,(%rsi)
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @do_state_74(i8 signext %0, i32* %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32*
store i8 %0, i8* %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
%10 = load i8, i8* %6
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 42
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32*, i32** %7
store i32 75, i32* %14
br label %21
15: ; preds = %4
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %5
br label %22
20: ; preds = %15
br label %21
21: ; preds = %20, %13
store i32 0, i32* %5
br label %22
22: ; preds = %21, %19
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @do_state_74(i8 signext %0, i32* nocapture writeonly %1, i8* nocapture readnone %2, i32* nocapture readnone %3) {
switch i8 %0, label %6 [
i8 42, label %5
i8 10, label %7
]
5: ; preds = %4
store i32 75, i32* %1
br label %6
6: ; preds = %4, %5
br label %7
7: ; preds = %4, %6
%8 = phi i32 [ 0, %6 ], [ 1, %4 ]
ret i32 %8
}
char *getName(address)
long address;
{
  extern char link[];
  sprintf(link, "\n<A NAME=\"%ld\"></A>\n", address);
  return link;
}


x86 assembly (clang, -O0):
<getName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    0x2ec1(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
mov    0x2eac(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getName>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ecd(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@link = external global [0 x i8]
@.str = [21 x i8] c"\0A<A NAME=\22%ld\22></A>\0A\00"
define i8* @getName(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([0 x i8], [0 x i8]* @link, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i8* getelementptr inbounds ([0 x i8], [0 x i8]* @link, i64 0, i64 0)
}

LLVM IR (-O2):
@link = external global [0 x i8]
@.str = [21 x i8] c"\0A<A NAME=\22%ld\22></A>\0A\00"
define i8* @getName(i64 %0) {
%2 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([0 x i8], [0 x i8]* @link, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* getelementptr inbounds ([0 x i8], [0 x i8]* @link, i64 0, i64 0)
}
char *procprt_TRUN_e(struct tstat *curstat, int avgval, int nsecs) {
  return "   0";
}


x86 assembly (clang, -O0):
<procprt_TRUN_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_TRUN_e>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [5 x i8] c" 0\00"
define i8* @procprt_TRUN_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [5 x i8] c" 0\00"
define i8* @procprt_TRUN_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ tan(double);
float tanf(float _X) { return ((float)tan((double)_X)); }


x86 assembly (clang, -O0):
<tanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <tan@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <tan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @tan(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @tanf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @tan(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
int OS_loadSound(char *desc) { return 0; }


x86 assembly (clang, -O0):
<OS_loadSound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_loadSound>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @OS_loadSound(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @OS_loadSound(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
char *oauth_sign_plaintext(const char *k) { return (strdup(k)); }


x86 assembly (clang, -O0):
<oauth_sign_plaintext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oauth_sign_plaintext>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @oauth_sign_plaintext(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strdup(i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @oauth_sign_plaintext(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, ...);
int main() {
  long a[10];
  long *b;
  printf("%d %d %d\n", sizeof(a), sizeof(*a), sizeof(a[0]));
  printf("%d %d\n", sizeof(b), sizeof(*b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xee1(%rip),%rdi
mov    $0x50,%esi
mov    $0x8,%edx
mov    $0x8,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x8,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%ecx
mov    $0x50,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x8,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i64]
%2 = alloca i64*
%3 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 80, i32 8, i64 8)
%4 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 80, i32 8, i64 8)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 8)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef unsigned short uint16_t;

/* Variables and functions */
void ADI16BitsClear(uint32_t ui32Base, uint32_t ui32Reg, uint16_t ui16Val) {
  uint32_t ui32RegOffset;
  ;
  ;
  ui32RegOffset = 0x00000020;
  (*((volatile unsigned short *)(ui32Base + ui32RegOffset +
                                 (ui32Reg & 0xFE)))) = ui16Val;
}


x86 assembly (clang, -O0):
<ADI16BitsClear>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movl   $0x20,-0x10(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    -0x8(%rbp),%edx
and    $0xfe,%edx
add    %edx,%eax
cltq
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADI16BitsClear>:
movslq %edi,%rax
and    $0xfe,%esi
mov    %dx,0x20(%rax,%rsi,1)
ret

LLVM IR (-O0):
define void @ADI16BitsClear(i32 %0, i32 %1, i16 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i16 %2, i16* %6
store i32 32, i32* %7
%8 = load i16, i16* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %7
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = and i32 %12, 254
%14 = add nsw i32 %11, %13
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i16*
store volatile i16 %8, i16* %16
ret void
}

LLVM IR (-O2):
define void @ADI16BitsClear(i32 %0, i32 %1, i16 zeroext %2) {
%4 = add nsw i32 %0, 32
%5 = and i32 %1, 254
%6 = add nsw i32 %4, %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i16*
store volatile i16 %2, i16* %8
ret void
}
/* Variables and functions */
int code_table_3_1(unsigned char **);
int flag_table_3_9(unsigned char **sec) {
  unsigned char *gds;
  gds = sec[3];
  switch (code_table_3_1(sec)) {
  case 100:
    return gds[32];
  }
  return -1;
}


x86 assembly (clang, -O0):
<flag_table_3_9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <code_table_3_1@plt>
sub    $0x64,%eax
jne    114f <flag_table_3_9+0x3f>
jmp    113f <flag_table_3_9+0x2f>
mov    -0x18(%rbp),%rax
movzbl 0x20(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <flag_table_3_9+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_table_3_9>:
push   %rbx
mov    0x18(%rdi),%rbx
call   1030 <code_table_3_1@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x64,%ecx
jne    112a <flag_table_3_9+0x1a>
movzbl 0x20(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @flag_table_3_9(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = getelementptr inbounds i8*, i8** %5, i64 3
%7 = load i8*, i8** %6
store i8* %7, i8** %4
%8 = load i8**, i8*** %3
%9 = call i32 @code_table_3_1(i8** %8)
switch i32 %9, label %15 [
i32 100, label %10
]
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 32
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
store i32 %14, i32* %2
br label %16
15: ; preds = %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @flag_table_3_9(i8** %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 3
%3 = load i8*, i8** %2
%4 = tail call i32 @code_table_3_1(i8** %0)
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %3, i64 32
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
void foo71() {}


x86 assembly (clang, -O0):
<foo71>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo71>:
ret

LLVM IR (-O0):
define void @foo71() {
ret void
}

LLVM IR (-O2):
define void @foo71() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ yyparse();
int /*<<< orphan*/ yyset_in(int /*<<< orphan*/ *);
int main(void) {
  FILE *f = fopen("comand.mac", "rb");
  yyset_in(f);
  yyparse();
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <yyset_in@plt>
mov    $0x0,%al
call   1030 <yyparse@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <yyset_in@plt>
xor    %eax,%eax
call   1030 <yyparse@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"comand.mac\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @yyset_in(i32* %4)
%6 = call i32 (...) @yyparse()
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"comand.mac\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @yyset_in(i32* %1)
%3 = tail call i32 (...) @yyparse()
%4 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void clearerr(FILE *stream) {
  FILE tmp;
  tmp = *stream;
}


x86 assembly (clang, -O0):
<clearerr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearerr>:
ret

LLVM IR (-O0):
define void @clearerr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @clearerr(i32* nocapture %0) {
ret void
}
int main(argc, argv)
int argc;
char **argv;
{ exit(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Usage: input_id [options] <device path>\n"
         "  --debug         debug to stderr\n"
         "  --help          print this help text\n\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [115 x i8] c"Usage: input_id [options] <device path>\0A --debug debug to stderr\0A --help print this help text\0A\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [114 x i8] c"Usage: input_id [options] <device path>\0A --debug debug to stderr\0A --help print this help text\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void addMov(uint16_t *dst, uint16_t *src) {
  while (*src) {
    (*dst)++;
    (*src)--;
  }
}


x86 assembly (clang, -O0):
<addMov>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113b <addMov+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
jmp    110c <addMov+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addMov>:
cmpq   $0x0,(%rsi)
je     111a <addMov+0x1a>
cs nopw 0x0(%rax,%rax,1)
addq   $0x1,(%rdi)
addq   $0xffffffffffffffff,(%rsi)
jne    1110 <addMov+0x10>
ret

LLVM IR (-O0):
define void @addMov(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
br label %5
5: ; preds = %9, %2
%6 = load i64*, i64** %4
%7 = load i64, i64* %6
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i64*, i64** %3
%11 = load i64, i64* %10
%12 = add nsw i64 %11, 1
store i64 %12, i64* %10
%13 = load i64*, i64** %4
%14 = load i64, i64* %13
%15 = add nsw i64 %14, -1
store i64 %15, i64* %13
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @addMov(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = load i64, i64* %0
%7 = add nsw i64 %6, 1
store i64 %7, i64* %0
%8 = load i64, i64* %1
%9 = add nsw i64 %8, -1
store i64 %9, i64* %1
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x = -1, y = 3;
  assert(x < y);
  assert(x <= y);
  assert(-1 < 3);
  assert(-1 <= 3);
  unsigned w = 0xFFFFFFFF, z = 3;
  assert(w > z);
  assert(w >= z);
  assert(0xFFFFFFFFU > 3);
  assert(0xFFFFFFFFU >= 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
movl   $0xffffffff,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
store i32 3, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp sle i32 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @assert(i32 1)
%17 = call i32 @assert(i32 1)
store i32 -1, i32* %4
store i32 3, i32* %5
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp ugt i32 %18, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = icmp uge i32 %23, %24
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = call i32 @assert(i32 1)
%29 = call i32 @assert(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
%7 = tail call i32 @assert(i32 1)
%8 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void report_usage(void) {
  puts("Usage: revinfo [OPTS]... FILES...\n"
       "Options are:\n"
       "  -n        - enable new major/minor version\n"
       "  -p        - disable patch level increase\n"
       "  -C        - put updated database files in CVS/SVN\n"
       "  -S        - SVN mode\n"
       "  -x        - do not commit revision database to version control\n"
       "  -r FILE   - specify revision database (default - revdb)\n"
       "  -d FILE   - specify version database (default - verdb)\n"
       "  -v FILE   - specify version file (default - VERSION)\n"
       "  -V STRING - specify version in string\n"
       "  -b FILE   - specify build number file (default - .build)\n"
       "  -o FILE   - specify output file (default - version.c)\n");
  exit(0);
}


x86 assembly (clang, -O0):
<report_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<report_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [601 x i8] c"Usage: revinfo [OPTS]... FILES...\0AOptions are:\0A -n - enable new major/minor version\0A -p - disable patch level increase\0A -C - put updated database files in CVS/SVN\0A -S - SVN mode\0A -x - do not commit revision database to version control\0A -r FILE - specify revision database (default - revdb)\0A -d FILE - specify version database (default - verdb)\0A -v FILE - specify version file (default - VERSION)\0A -V STRING - specify version in string\0A -b FILE - specify build number file (default - .build)\0A -o FILE - specify output file (default - version.c)\0A\00"
define void @report_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([601 x i8], [601 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [601 x i8] c"Usage: revinfo [OPTS]... FILES...\0AOptions are:\0A -n - enable new major/minor version\0A -p - disable patch level increase\0A -C - put updated database files in CVS/SVN\0A -S - SVN mode\0A -x - do not commit revision database to version control\0A -r FILE - specify revision database (default - revdb)\0A -d FILE - specify version database (default - verdb)\0A -v FILE - specify version file (default - VERSION)\0A -V STRING - specify version in string\0A -b FILE - specify build number file (default - .build)\0A -o FILE - specify output file (default - version.c)\0A\00"
define void @report_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([601 x i8], [601 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ExitFunction();
void SignalFunction(int unused) {
  unused = unused;
  ExitFunction();
}


x86 assembly (clang, -O0):
<SignalFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ExitFunction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignalFunction>:
xor    %eax,%eax
jmp    1030 <ExitFunction@plt>

LLVM IR (-O0):
define void @SignalFunction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %2
%4 = call i32 (...) @ExitFunction()
ret void
}

LLVM IR (-O2):
define void @SignalFunction(i32 %0) {
%2 = tail call i32 (...) @ExitFunction()
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d", EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotr(uint32_t val, int bits) {
  return (val >> bits) | (val << (32 - bits));
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotr(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}