xunge/DecIR huggingface dataset:
int string_match(const char *s1, const char *s2) {
  for (; *s2; ++s2)
    if (*s1++ != *s2)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<string_match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <string_match+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1146 <string_match+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1163 <string_match+0x63>
jmp    114b <string_match+0x4b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <string_match+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_match>:
mov    (%rsi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1122 <string_match+0x22>
xor    %edx,%edx
nopl   (%rax)
cmp    %cl,(%rdi,%rdx,1)
jne    1123 <string_match+0x23>
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <string_match+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_match(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %6
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i32 [ 1, %2 ], [ 1, %11 ], [ 0, %5 ]
ret i32 %17
}
void TIM0_OC2_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM0_OC2_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_make_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("make", " #comment"),
                            "comment", "#comment");
}


x86 assembly (clang, -O0):
<test_make_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec7(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_make_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecc(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"make\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_make_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"make\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_make_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xe8() {
  Assert_real((iscntrl(232) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              1165, ("iscntrl should be 0 for 0xe8"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xe8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe8,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x48d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xe8>:
push   %rax
mov    $0xe8,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x48d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xe8\00"
define void @t_iscntrl_0xe8() {
%1 = call i64 @iscntrl(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xe8\00"
define void @t_iscntrl_0xe8() {
%1 = tail call i64 @iscntrl(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void menu_show() {
  system("cls");
  printf("LoL Chat - Set your status: ** RUN AS ADMINISTRATOR **\n1 - "
         "Online\n2 - Offline\n\n8 - Install\n9 - Uninstall\n0 - Exit\n\n>");
}


x86 assembly (clang, -O0):
<menu_show>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu_show>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
lea    0xed0(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [117 x i8] c"LoL Chat - Set your status: ** RUN AS ADMINISTRATOR **\0A1 - Online\0A2 - Offline\0A\0A8 - Install\0A9 - Uninstall\0A0 - Exit\0A\0A>\00"
define void @menu_show() {
%1 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [117 x i8] c"LoL Chat - Set your status: ** RUN AS ADMINISTRATOR **\0A1 - Online\0A2 - Offline\0A\0A8 - Install\0A9 - Uninstall\0A0 - Exit\0A\0A>\00"
define void @menu_show() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
scalar_t__ pow(int, int);
int radix_digit(int num, int pos) {
  if (pos < 1)
    die("Requested a digit on an invalid position");
  num %= (int)pow(10, pos);
  num /= (int)pow(10, pos - 1);
  return num;
}


x86 assembly (clang, -O0):
<radix_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1144 <radix_digit+0x24>
lea    0xec1(%rip),%rdi
call   1030 <die@plt>
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_digit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %esi,%esi
jg     1137 <radix_digit+0x17>
lea    0xece(%rip),%rdi
call   1030 <die@plt>
mov    $0xa,%edi
mov    %ebx,%esi
call   1040 <pow@plt>
mov    %rax,%rcx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %edx,%ebp
add    $0xffffffff,%ebx
mov    $0xa,%edi
mov    %ebx,%esi
call   1040 <pow@plt>
mov    %rax,%rcx
mov    %ebp,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Requested a digit on an invalid position\00"
define i32 @radix_digit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @die(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %4
%11 = call i64 @pow(i32 10, i32 %10)
%12 = trunc i64 %11 to i32
%13 = load i32, i32* %3
%14 = srem i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = call i64 @pow(i32 10, i32 %16)
%18 = trunc i64 %17 to i32
%19 = load i32, i32* %3
%20 = sdiv i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [41 x i8] c"Requested a digit on an invalid position\00"
define i32 @radix_digit(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @die(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = tail call i64 @pow(i32 10, i32 %1)
%8 = trunc i64 %7 to i32
%9 = srem i32 %0, %8
%10 = add nsw i32 %1, -1
%11 = tail call i64 @pow(i32 10, i32 %10)
%12 = trunc i64 %11 to i32
%13 = sdiv i32 %9, %12
ret i32 %13
}
int update_loglevel_setting(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @update_loglevel_setting() {
ret i32 0
}

LLVM IR (-O2):
define i32 @update_loglevel_setting() {
ret i32 0
}
void sdb_init_mimer(void) { ; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void unlock_wrapper(pthread_mutex_t *lk) {
  int rc = pthread_mutex_unlock(lk);
  assert(rc == 0);
}


x86 assembly (clang, -O0):
<unlock_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_wrapper>:
push   %rax
call   1040 <pthread_mutex_unlock@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @unlock_wrapper(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
define void @unlock_wrapper(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int sub(int a, int b) {
  printf("calculator_basic::sub() called!\n");
  int diff = a;
  int i;
  for (i = 0; i < b; ++i) {
    --diff;
  }
  return diff;
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115a <sub+0x4a>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <sub+0x27>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
test   %ebx,%ebx
cmovns %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"calculator_basic::sub() called!\0A\00"
define i32 @sub(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
store i32 %8, i32* %5
store i32 0, i32* %6
br label %9
9: ; preds = %16, %2
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32, i32* %5
%15 = add nsw i32 %14, -1
store i32 %15, i32* %5
br label %16
16: ; preds = %13
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %9
19: ; preds = %9
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@str = [32 x i8] c"calculator_basic::sub() called!\00"
define i32 @sub(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %1, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = sub i32 %0, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ssoma(char *, char *, char *);
int /*<<< orphan*/ zeroleft(char *);
void p2s(char *num, int n) {
  int i;
  for (i = 0; i < n; i++) {
    ssoma(num, num, num);
    zeroleft(num);
  }
  return;
}


x86 assembly (clang, -O0):
<p2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116a <p2s+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1040 <ssoma@plt>
mov    -0x8(%rbp),%rdi
call   1030 <zeroleft@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <p2s+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p2s>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    114b <p2s+0x2b>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %r14,%rsi
mov    %r14,%rdx
call   1040 <ssoma@plt>
mov    %r14,%rdi
call   1030 <zeroleft@plt>
add    $0xffffffff,%ebx
jne    1130 <p2s+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @p2s(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = call i32 @ssoma(i8* %11, i8* %12, i8* %13)
%15 = load i8*, i8** %3
%16 = call i32 @zeroleft(i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @p2s(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = tail call i32 @ssoma(i8* %0, i8* %0, i8* %0)
%7 = tail call i32 @zeroleft(i8* %0)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ GL_LINE;
int /*<<< orphan*/ teapot(int, int /*<<< orphan*/, int /*<<< orphan*/);
void glutWireTeapot(GLdouble size) { teapot(10, size, GL_LINE); }


x86 assembly (clang, -O0):
<glutWireTeapot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%edi
call   1030 <teapot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glutWireTeapot>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%edi
jmp    1030 <teapot@plt>

LLVM IR (-O0):
@GL_LINE = global i32 0
define void @glutWireTeapot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @GL_LINE
%5 = call i32 @teapot(i32 10, i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@GL_LINE = global i32 0
define void @glutWireTeapot(i32 %0) {
%2 = load i32, i32* @GL_LINE
%3 = tail call i32 @teapot(i32 10, i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_gtab();
int /*<<< orphan*/ gen_mtab();
int /*<<< orphan*/ gen_poly();
int /*<<< orphan*/ generate_gf();
void init_rs(void) {
  generate_gf();
  gen_poly();
  gen_gtab();
  gen_mtab();
}


x86 assembly (clang, -O0):
<init_rs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <generate_gf@plt>
mov    $0x0,%al
call   1040 <gen_poly@plt>
mov    $0x0,%al
call   1030 <gen_gtab@plt>
mov    $0x0,%al
call   1050 <gen_mtab@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_rs>:
push   %rax
xor    %eax,%eax
call   1060 <generate_gf@plt>
xor    %eax,%eax
call   1040 <gen_poly@plt>
xor    %eax,%eax
call   1030 <gen_gtab@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <gen_mtab@plt>

LLVM IR (-O0):
define void @init_rs() {
%1 = call i32 (...) @generate_gf()
%2 = call i32 (...) @gen_poly()
%3 = call i32 (...) @gen_gtab()
%4 = call i32 (...) @gen_mtab()
ret void
}

LLVM IR (-O2):
define void @init_rs() {
%1 = tail call i32 (...) @generate_gf()
%2 = tail call i32 (...) @gen_poly()
%3 = tail call i32 (...) @gen_gtab()
%4 = tail call i32 (...) @gen_mtab()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int fread(void *, int, int, int /*<<< orphan*/ *);
int asf_fileio_read_cb(FILE *stream, void *buffer, int size) {
  int ret;
  ret = fread(buffer, 1, size, stream);
  if (!ret && !feof(stream))
    ret = -1;
  return ret;
}


x86 assembly (clang, -O0):
<asf_fileio_read_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    116e <asf_fileio_read_cb+0x4e>
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%eax
jne    116e <asf_fileio_read_cb+0x4e>
movl   $0xffffffff,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asf_fileio_read_cb>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x1,%esi
mov    %rbx,%rcx
call   1030 <fread@plt>
test   %eax,%eax
je     113a <asf_fileio_read_cb+0x1a>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <feof@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @asf_fileio_read_cb(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32*, i32** %4
%11 = call i32 @fread(i8* %8, i32 1, i32 %9, i32* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %3
%15 = load i32*, i32** %4
%16 = call i32 @feof(i32* %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %14
store i32 -1, i32* %7
br label %19
19: ; preds = %18, %14, %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @asf_fileio_read_cb(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @fread(i8* %1, i32 1, i32 %2, i32* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @feof(i32* %0)
%8 = icmp eq i32 %7, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ %4, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
void putc(int c) { (*(volatile unsigned int *)0xff002000) = c; }


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xff002000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
mov    $0xff002000,%eax
mov    %edi,(%rax)
ret

LLVM IR (-O0):
define void @putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 4278198272 to i32*)
ret void
}

LLVM IR (-O2):
define void @putc(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 4278198272 to i32*)
ret void
}
struct msm_otg_transceiver *msm_otg_get_transceiver(void) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.msm_otg_transceiver = type opaque
define %struct.msm_otg_transceiver* @msm_otg_get_transceiver() {
ret %struct.msm_otg_transceiver* null
}

LLVM IR (-O2):
%struct.msm_otg_transceiver = type opaque
define noalias %struct.msm_otg_transceiver* @msm_otg_get_transceiver() {
ret %struct.msm_otg_transceiver* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 10;
  int height;
  printf("I am %d years old.\n");
  printf("I am %d inches tall.\n", height);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int Bar();
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ malloc(int);
void *realloc(int /*<<< orphan*/, int);
void Foo(int arg1, int arg2) {
  int foo = (arg1 + Bar() + arg2);
  void *ptr = realloc(malloc(1024), 2048);
  free(ptr);
}


x86 assembly (clang, -O0):
<Foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <Bar@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    $0x800,%esi
call   1060 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Foo>:
push   %rax
xor    %eax,%eax
call   1040 <Bar@plt>
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    $0x800,%esi
call   1060 <realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @Foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i32 (...) @Bar()
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
store i32 %11, i32* %5
%12 = call i32 @malloc(i32 1024)
%13 = call i8* @realloc(i32 %12, i32 2048)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
define void @Foo(i32 %0, i32 %1) {
%3 = tail call i32 (...) @Bar()
%4 = tail call i32 @malloc(i32 1024)
%5 = tail call i8* @realloc(i32 %4, i32 2048)
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Type definitions */
struct xylo {
  int dummy;
};
struct gl_test {
  int dummy;
};
struct gl_api {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_xylo(struct xylo *);
struct xylo *make_xylo(struct gl_api *);
int creation_(struct gl_api *api, struct gl_test *test) {
  struct xylo *xylo = make_xylo(api);
  if (!xylo) {
    return -1;
  }
  free_xylo(xylo);
  (void)test;
  return 0;
}


x86 assembly (clang, -O0):
<creation_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <make_xylo@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <creation_+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <creation_+0x44>
mov    -0x20(%rbp),%rdi
call   1030 <free_xylo@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creation_>:
push   %rax
call   1040 <make_xylo@plt>
test   %rax,%rax
je     1137 <creation_+0x17>
mov    %rax,%rdi
call   1030 <free_xylo@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.gl_api = type { i32 }
%struct.gl_test = type { i32 }
%struct.xylo = type { i32 }
define i32 @creation_(%struct.gl_api* %0, %struct.gl_test* %1) {
%3 = alloca i32
%4 = alloca %struct.gl_api*
%5 = alloca %struct.gl_test*
%6 = alloca %struct.xylo*
store %struct.gl_api* %0, %struct.gl_api** %4
store %struct.gl_test* %1, %struct.gl_test** %5
%7 = load %struct.gl_api*, %struct.gl_api** %4
%8 = call %struct.xylo* @make_xylo(%struct.gl_api* %7)
store %struct.xylo* %8, %struct.xylo** %6
%9 = load %struct.xylo*, %struct.xylo** %6
%10 = icmp ne %struct.xylo* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = load %struct.xylo*, %struct.xylo** %6
%14 = call i32 @free_xylo(%struct.xylo* %13)
%15 = load %struct.gl_test*, %struct.gl_test** %5
store i32 0, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.gl_api = type { i32 }
%struct.gl_test = type { i32 }
%struct.xylo = type { i32 }
define i32 @creation_(%struct.gl_api* %0, %struct.gl_test* nocapture readnone %1) {
%3 = tail call %struct.xylo* @make_xylo(%struct.gl_api* %0)
%4 = icmp eq %struct.xylo* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free_xylo(%struct.xylo* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
unsigned gameboy3x_generic_input_fmts(void) { return (1 << 0) | (1 << 1); }


x86 assembly (clang, -O0):
<gameboy3x_generic_input_fmts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gameboy3x_generic_input_fmts>:
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @gameboy3x_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @gameboy3x_generic_input_fmts() {
ret i32 3
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int current_time(void) {
  struct timeval tv;
  struct timezone tz;
  (void)gettimeofday(&tv, &tz);
  return (int)tv.tv_sec;
}


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

x86 assembly (clang, -O2):
<current_time>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <gettimeofday@plt>
mov    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
%struct.timezone = type { i32 }
define i32 @current_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
%struct.timezone = type { i32 }
define i32 @current_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void print(int k, int j) { printf("%d %d\n", k, j); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define void @print(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 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define void @print(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct gl_geometries {
  int dummy;
};
struct gl_cache {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gl_geometries_term(struct gl_cache *,
                                      struct gl_geometries *);
void unload_geometry(void const *key, size_t len, void *data, void *link) {
  struct gl_geometries *geos = data;
  struct gl_cache *cache = link;
  (void)key;
  (void)len;
  gl_geometries_term(cache, geos);
}


x86 assembly (clang, -O0):
<unload_geometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <gl_geometries_term@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unload_geometry>:
mov    %rcx,%rdi
mov    %rdx,%rsi
jmp    1030 <gl_geometries_term@plt>

LLVM IR (-O0):
%struct.gl_geometries = type { i32 }
%struct.gl_cache = type { i32 }
define void @unload_geometry(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.gl_geometries*
%10 = alloca %struct.gl_cache*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%11 = load i8*, i8** %7
%12 = bitcast i8* %11 to %struct.gl_geometries*
store %struct.gl_geometries* %12, %struct.gl_geometries** %9
%13 = load i8*, i8** %8
%14 = bitcast i8* %13 to %struct.gl_cache*
store %struct.gl_cache* %14, %struct.gl_cache** %10
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = load %struct.gl_cache*, %struct.gl_cache** %10
%18 = load %struct.gl_geometries*, %struct.gl_geometries** %9
%19 = call i32 @gl_geometries_term(%struct.gl_cache* %17, %struct.gl_geometries* %18)
ret void
}

LLVM IR (-O2):
%struct.gl_geometries = type { i32 }
%struct.gl_cache = type { i32 }
define void @unload_geometry(i8* nocapture readnone %0, i64 %1, i8* %2, i8* %3) {
%5 = bitcast i8* %2 to %struct.gl_geometries*
%6 = bitcast i8* %3 to %struct.gl_cache*
%7 = tail call i32 @gl_geometries_term(%struct.gl_cache* %6, %struct.gl_geometries* %5)
ret void
}
/* Variables and functions */
int close(int);
int closedev(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<closedev>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @closedev(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void shutdownExit(void) {}


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

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

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

LLVM IR (-O2):
define void @shutdownExit() {
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int nums[], int begin, int end) {
  if (begin < end) {
    int p = partition(nums, begin, end);
    quick_sort(nums, begin, p);
    quick_sort(nums, p + 1, end);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1171 <quick_sort+0x51>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1165 <quick_sort+0x45>
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <quick_sort@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r14d,%ebp
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
br label %23
23: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
tail call void @quick_sort(i32* %0, i32 %6, i32 %7)
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %8, %2
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}
char getch() {
  char c;
  asm volatile("int $0x30" : "=a"(c) : "a"(2));
  return c;
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
int    $0x30
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
mov    $0x2,%eax
int    $0x30
ret

LLVM IR (-O0):
define signext i8 @getch() {
%1 = alloca i8
%2 = call i8 asm sideeffect "int $$0x30", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 2)
store i8 %2, i8* %1
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @getch() {
%1 = tail call i8 asm sideeffect "int $$0x30", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 2)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ lpsc_control(unsigned int, int, int);
void clk_enable(unsigned int mod) { lpsc_control(mod, 0x3, -1); }


x86 assembly (clang, -O0):
<clk_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
mov    $0xffffffff,%edx
call   1030 <lpsc_control@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_enable>:
mov    $0x3,%esi
mov    $0xffffffff,%edx
jmp    1030 <lpsc_control@plt>

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

LLVM IR (-O2):
define void @clk_enable(i32 %0) {
%2 = tail call i32 @lpsc_control(i32 %0, i32 3, i32 -1)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int empty(struct node *head) { return head == NULL; }


x86 assembly (clang, -O0):
<empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @empty(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = icmp eq %struct.node* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @empty(%struct.node* readnone %0) {
%2 = icmp eq %struct.node* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SCSI_Out_Ctl_SaveConfig();
void SCSI_Out_Ctl_Sleep(void) { SCSI_Out_Ctl_SaveConfig(); }


x86 assembly (clang, -O0):
<SCSI_Out_Ctl_Sleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SCSI_Out_Ctl_SaveConfig@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SCSI_Out_Ctl_Sleep() {
%1 = call i32 (...) @SCSI_Out_Ctl_SaveConfig()
ret void
}

LLVM IR (-O2):
define void @SCSI_Out_Ctl_Sleep() {
%1 = tail call i32 (...) @SCSI_Out_Ctl_SaveConfig()
ret void
}
/* Variables and functions */
bool valid(char c) {
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') ||
         (c >= 'A' && c <= 'Z');
}


x86 assembly (clang, -O0):
<valid>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <valid+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <valid+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <valid+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <valid+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <valid+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x1a,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @valid(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 90
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @valid(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
unsigned long long __udivmoddi4(unsigned long long, unsigned long long,
                                unsigned long long *);
unsigned long long __udivdi3(unsigned long long n, unsigned long long d) {
  return __udivmoddi4(n, d, (unsigned long long *)0);
}


x86 assembly (clang, -O0):
<__udivdi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <__udivmoddi4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__udivdi3>:
xor    %edx,%edx
jmp    1030 <__udivmoddi4@plt>

LLVM IR (-O0):
define i64 @__udivdi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @__udivmoddi4(i64 %5, i64 %6, i64* null)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__udivdi3(i64 %0, i64 %1) {
%3 = tail call i64 @__udivmoddi4(i64 %0, i64 %1, i64* null)
ret i64 %3
}
/* Variables and functions */
double doubles_extreme(double *, int, int);
double doubles_min(double *doubles, int size) {
  return (doubles_extreme(doubles, size, 1));
}


x86 assembly (clang, -O0):
<doubles_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <doubles_extreme@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_min>:
mov    $0x1,%edx
jmp    1030 <doubles_extreme@plt>

LLVM IR (-O0):
define double @doubles_min(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call double @doubles_extreme(double* %5, i32 %6, i32 1)
ret double %7
}

LLVM IR (-O2):
define double @doubles_min(double* %0, i32 %1) {
%3 = tail call double @doubles_extreme(double* %0, i32 %1, i32 1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *msg) {
  fprintf(stderr, msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ iopl(int /*<<< orphan*/);
void cleanup(void) { iopl(0); }


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

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

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

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 @iopl(i32 0)
ret void
}
void rop3_254_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk1 = *D | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_254_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_254_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_254_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}