xunge/DecIR huggingface dataset:
int mu_getcoreshardc(int i, int n, int c) {
  int each = c / n;
  int extras = (i < (c % n)) ? 1 : 0;
  return each + extras;
}


x86 assembly (clang, -O0):
<mu_getcoreshardc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
mov    -0x18(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_getcoreshardc>:
mov    %edx,%eax
cltd
idiv   %esi
xor    %ecx,%ecx
cmp    %edi,%edx
setg   %cl
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mu_getcoreshardc(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = sdiv i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = srem i32 %13, %14
%16 = icmp slt i32 %12, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
store i32 %18, i32* %8
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @mu_getcoreshardc(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %2, %1
%5 = srem i32 %2, %1
%6 = icmp sgt i32 %5, %0
%7 = zext i1 %6 to i32
%8 = add nsw i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int pid;
  pid = fork();
  if (pid != 0) {
    printf("Hello from pid %d, I am the parent.\n", pid);
  } else {
    printf("Hello from pid %d, I am the child.\n", pid);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1157 <main+0x37>
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <main+0x46>
mov    -0x8(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     1137 <main+0x17>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
jmp    1140 <main+0x20>
lea    0xee7(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Hello from pid %d, I am the parent.\0A\00"
@.str.1 = [36 x i8] c"Hello from pid %d, I am the child.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fork()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Hello from pid %d, I am the parent.\0A\00"
@.str.1 = [36 x i8] c"Hello from pid %d, I am the child.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %7
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %7
7: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
scalar_t__ syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int clone() { return (int)syscall(120, 0x100 | 0x200 | 0x400, 0, 0); }


x86 assembly (clang, -O0):
<clone>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%edi
mov    $0x700,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clone>:
mov    $0x78,%edi
mov    $0x700,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @clone() {
%1 = call i64 @syscall(i32 120, i32 1792, i32 0, i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @clone() {
%1 = tail call i64 @syscall(i32 120, i32 1792, i32 0, i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int japi_radiobutton(int, char *);
int j_radiobutton(int arg0, char *arg1) {
  return (japi_radiobutton(arg0, arg1));
}


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

x86 assembly (clang, -O2):
<j_radiobutton>:
jmp    1030 <japi_radiobutton@plt>

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

LLVM IR (-O2):
define i32 @j_radiobutton(i32 %0, i8* %1) {
%3 = tail call i32 @japi_radiobutton(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int close(int);
int simple_socket_close(int socket) { return close(socket); }


x86 assembly (clang, -O0):
<simple_socket_close>:
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):
<simple_socket_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @simple_socket_close(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 @simple_socket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int random_number(int, int);
char random_character() {
  char c;
  int i;
  i = random_number(97, 123);
  c = (char)i;
  return c;
}


x86 assembly (clang, -O0):
<random_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x61,%edi
mov    $0x7b,%esi
call   1030 <random_number@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_character>:
push   %rax
mov    $0x61,%edi
mov    $0x7b,%esi
call   1030 <random_number@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @random_character() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 @random_number(i32 97, i32 123)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
%6 = load i8, i8* %1
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @random_character() {
%1 = tail call i32 @random_number(i32 97, i32 123)
%2 = trunc i32 %1 to i8
ret i8 %2
}
void FreeSequenceMemory(seq) unsigned char *seq;
{ free(seq); }


x86 assembly (clang, -O0):
<FreeSequenceMemory>:
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):
<FreeSequenceMemory>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FreeSequenceMemory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @FreeSequenceMemory(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
int sys$close(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(1), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$close>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x1,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$close>:
mov    $0x1,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$close"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 1, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$close"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 1, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
void *realloc(void *ptr, size_t size) {
  (void)size;
  return ptr;
}


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

x86 assembly (clang, -O2):
<realloc>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @realloc(i8* readnone returned %0, i64 %1) {
ret i8* %0
}
void rop3_20_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_20_1_0>:
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
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%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
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%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    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_20_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
not    %cl
and    %dl,%cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_20_1_0(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 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %4
store i8 %43, i8* %44
ret void
}

LLVM IR (-O2):
define void @rop3_20_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %5, -1
%7 = and i8 %6, %2
%8 = and i8 %4, %1
%9 = or i8 %7, %8
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x41() {
  Assert_real((isprint(65)),
              "/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_isprint.c",
              330, ("isprint should be 1 for A"));
}


x86 assembly (clang, -O0):
<t_isprint_0x41>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x14a,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x41>:
push   %rax
mov    $0x41,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x14a,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for A\00"
define void @t_isprint_0x41() {
%1 = call i32 @isprint(i32 65)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 330, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for A\00"
define void @t_isprint_0x41() {
%1 = tail call i32 @isprint(i32 65)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 330, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int find_index(const char a[], const int size, const char value) {
  int i = 0;
  for (i = 0; i < size; i++)
    if (a[i] == value)
      return i;
  return (-1);
}


x86 assembly (clang, -O0):
<find_index>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1160 <find_index+0x60>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <find_index+0x4d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <find_index+0x67>
jmp    1152 <find_index+0x52>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111e <find_index+0x1e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_index>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <find_index+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dl,(%rdi,%rcx,1)
je     111f <find_index+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <find_index+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find_index(i8* nocapture %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf(
      "Usage: set_checksum <kernel_image_name> <ro_checksum> <rw_checksum>\n");
}


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

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

LLVM IR (-O0):
@.str = [69 x i8] c"Usage: set_checksum <kernel_image_name> <ro_checksum> <rw_checksum>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [68 x i8] c"Usage: set_checksum <kernel_image_name> <ro_checksum> <rw_checksum>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ __io_putchar(int /*<<< orphan*/);
signed int puts(const char *pStr) {
  while (__io_putchar(*pStr++)) {
  }
  return (0);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <__io_putchar@plt>
cmp    $0x0,%rax
je     1142 <puts+0x32>
jmp    111c <puts+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
add    $0x1,%rbx
call   1030 <__io_putchar@plt>
test   %rax,%rax
jne    1120 <puts+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = tail call i64 @__io_putchar(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 0
}
int roi_set_stream(char *buff, int id) {
  buff[0] = (148);
  buff[1] = 1;
  buff[2] = id;
  return 3;
}


x86 assembly (clang, -O0):
<roi_set_stream>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x94,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x1,0x1(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_set_stream>:
movw   $0x194,(%rdi)
mov    %sil,0x2(%rdi)
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @roi_set_stream(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 -108, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 1, i8* %8
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 2
store i8 %10, i8* %12
ret i32 3
}

LLVM IR (-O2):
define i32 @roi_set_stream(i8* nocapture writeonly %0, i32 %1) {
store i8 -108, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 1, i8* %3
%4 = trunc i32 %1 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %4, i8* %5
ret i32 3
}
const char *proginfo_version(void) {
  const char *s = "1.2.6";
  return s;
}


x86 assembly (clang, -O0):
<proginfo_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.2.6\00"
define i8* @proginfo_version() {
%1 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.6\00"
define i8* @proginfo_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
char *rindex(int /*<<< orphan*/, char);
scalar_t__ strcmp(char *, char *);
int fileselect(const struct dirent *entry) {
  char *ptr = rindex(entry->d_name, '.');
  if ((ptr != NULL) && ((strcmp(ptr, ".c") == 0)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fileselect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x2e,%esi
call   1040 <rindex@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1171 <fileselect+0x51>
mov    -0x18(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1171 <fileselect+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1178 <fileselect+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileselect>:
push   %rax
mov    (%rdi),%edi
mov    $0x2e,%esi
call   1040 <rindex@plt>
test   %rax,%rax
je     1146 <fileselect+0x26>
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     114a <fileselect+0x2a>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [3 x i8] c".c\00"
define i32 @fileselect(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
%4 = alloca i8*
store %struct.dirent* %0, %struct.dirent** %3
%5 = load %struct.dirent*, %struct.dirent** %3
%6 = getelementptr inbounds %struct.dirent, %struct.dirent* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i8* @rindex(i32 %7, i8 signext 46)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %2
br label %17
16: ; preds = %11, %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [3 x i8] c".c\00"
define i32 @fileselect(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i8* @rindex(i32 %3, i8 signext 46)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6, %1
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %11
}
int bi_getn(as, ai) const char *as;
int *ai;
{
  int rv = getn(as, ai);
  if (!rv)
    bi_errorf("%s: bad number", as);
  return rv;
}


x86 assembly (clang, -O0):
<bi_getn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <getn@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115e <bi_getn+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <bi_errorf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bi_getn>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getn@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1144 <bi_getn+0x24>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <bi_errorf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s: bad number\00"
define i32 @bi_getn(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = load i32*, i32** %4
%8 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @getn to i32 (i8*, i32*, ...)*)(i8* %6, i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @bi_errorf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s: bad number\00"
define i32 @bi_getn(i8* %0, i32* %1) {
%3 = tail call i32 (i8*, i32*, ...) bitcast (i32 (...)* @getn to i32 (i8*, i32*, ...)*)(i8* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @bi_errorf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int rbt_memtype_check_insert(struct memtype *new, unsigned long *new_type) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.memtype = type opaque
define i32 @rbt_memtype_check_insert(%struct.memtype* %0, i64* %1) {
%3 = alloca %struct.memtype*
%4 = alloca i64*
store %struct.memtype* %0, %struct.memtype** %3
store i64* %1, i64** %4
ret i32 0
}

LLVM IR (-O2):
%struct.memtype = type opaque
define i32 @rbt_memtype_check_insert(%struct.memtype* nocapture readnone %0, i64* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int ftruncate(int, long);
__attribute__((weak)) int __real_ftruncate(int fildes, long length) {
  return ftruncate(fildes, length);
}


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

x86 assembly (clang, -O2):
<__real_ftruncate>:
jmp    1030 <ftruncate@plt>

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

LLVM IR (-O2):
define weak i32 @__real_ftruncate(i32 %0, i64 %1) {
%3 = tail call i32 @ftruncate(i32 %0, i64 %1)
ret i32 %3
}
char *postinc(char *base) {
  base++;
  return base;
}


x86 assembly (clang, -O0):
<postinc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<postinc>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @postinc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i32 1
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @postinc(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
int AAS_IndexFromModel(char *modelname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @AAS_IndexFromModel(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  fputs("I'm stdout\nYeah, stdout.\n", stdout);
  fputs("I'm stderr\nYeah, strerr.\n", stderr);
  sleep(3);
  return 32;
}


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)
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    $0x20,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"I'm stdout\0AYeah, stdout.\0A\00"
@stdout = global i32 0
@.str.1 = [26 x i8] c"I'm stderr\0AYeah, strerr.\0A\00"
@stderr = global i32 0
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
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @sleep(i32 3)
ret i32 32
}

LLVM IR (-O2):
@.str = [26 x i8] c"I'm stdout\0AYeah, stdout.\0A\00"
@stdout = global i32 0
@.str.1 = [26 x i8] c"I'm stderr\0AYeah, strerr.\0A\00"
@stderr = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @sleep(i32 3)
ret i32 32
}
/* Variables and functions */
int /*<<< orphan*/ test_ampl_comment_entities();
int /*<<< orphan*/ test_ampl_comments();
void all_ampl_tests() {
  test_ampl_comments();
  test_ampl_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_ampl_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_ampl_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_ampl_comment_entities@plt>

LLVM IR (-O0):
define void @all_ampl_tests() {
%1 = call i32 (...) @test_ampl_comments()
%2 = call i32 (...) @test_ampl_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_ampl_tests() {
%1 = tail call i32 (...) @test_ampl_comments()
%2 = tail call i32 (...) @test_ampl_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void getenv() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @getenv() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
int strcmpm(char *s1, char *s2) {
  for (; *s1 == *s2; s1++, s2++)
    if (*s1 == '\0')
      return 0;
  return *s1 - *s2;
}


x86 assembly (clang, -O0):
<strcmpm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <strcmpm+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmpm+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <strcmpm+0x73>
jmp    1143 <strcmpm+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmpm+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmpm>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmpm+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmpm+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmpm+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strcmpm(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** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %34
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %29, %32
store i32 %33, i32* %3
br label %34
34: ; preds = %26, %19
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @strcmpm(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ MinHeapify(scalar_t__ *, scalar_t__, int /*<<< orphan*/);
void MinInsert(uint32_t *array, uint32_t heapSize, uint32_t elem) {
  if (elem > array[0]) {
    array[0] = elem;
    MinHeapify(array, heapSize, 0);
  }
}


x86 assembly (clang, -O0):
<MinInsert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%rax
jle    114f <MinInsert+0x3f>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <MinHeapify@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MinInsert>:
cmp    %rdx,(%rdi)
jge    111f <MinInsert+0xf>
mov    %rdx,(%rdi)
xor    %edx,%edx
jmp    1030 <MinHeapify@plt>
ret

LLVM IR (-O0):
define void @MinInsert(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = icmp sgt i64 %7, %10
br i1 %11, label %12, label %19
12: ; preds = %3
%13 = load i64, i64* %6
%14 = load i64*, i64** %4
%15 = getelementptr inbounds i64, i64* %14, i64 0
store i64 %13, i64* %15
%16 = load i64*, i64** %4
%17 = load i64, i64* %5
%18 = call i32 @MinHeapify(i64* %16, i64 %17, i32 0)
br label %19
19: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @MinInsert(i64* %0, i64 %1, i64 %2) {
%4 = load i64, i64* %0
%5 = icmp slt i64 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
store i64 %2, i64* %0
%7 = tail call i32 @MinHeapify(i64* %0, i64 %1, i32 0)
br label %8
8: ; preds = %6, %3
ret void
}
char *hash_plugin_summary(void) { return ("null \t\tNULL plugin"); }


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"null \09\09NULL plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"null \09\09NULL plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
void EVMPortMIIModeSelect(void) {
  (*((volatile unsigned int *)((0x44E10000) + (0x650)))) = 0x00;
}


x86 assembly (clang, -O0):
<EVMPortMIIModeSelect>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e10650,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVMPortMIIModeSelect>:
movl   $0x0,0x44e10650
ret

LLVM IR (-O0):
define void @EVMPortMIIModeSelect() {
store volatile i32 0, i32* inttoptr (i64 1155597904 to i32*)
ret void
}

LLVM IR (-O2):
define void @EVMPortMIIModeSelect() {
store volatile i32 0, i32* inttoptr (i64 1155597904 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_equal_int(int, int, char *, char *);
int pl_endswith(char *, char *);
void test_endswith_empty_string() {
  char the_string[] = "";
  int ret_val = pl_endswith(the_string, "asd");
  assert_equal_int(-1, ret_val, "test_endswith_empty_string",
                   "Error code not returned.");
}


x86 assembly (clang, -O0):
<test_endswith_empty_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
lea    -0x1(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <pl_endswith@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xffffffff,%edi
lea    0xe9a(%rip),%rdx
lea    0xeae(%rip),%rcx
call   1050 <assert_equal_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_endswith_empty_string>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0xed3(%rip),%rsi
lea    0x7(%rsp),%rdi
call   1030 <pl_endswith@plt>
lea    0xec6(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0xffffffff,%edi
mov    %eax,%esi
call   1040 <assert_equal_int@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"asd\00"
@.str.1 = [27 x i8] c"test_endswith_empty_string\00"
@.str.2 = [25 x i8] c"Error code not returned.\00"
define void @test_endswith_empty_string() {
%1 = alloca [1 x i8]
%2 = alloca i32
%3 = bitcast [1 x i8]* %1 to i8*
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%5 = call i32 @pl_endswith(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @assert_equal_int(i32 -1, i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"asd\00"
@.str.1 = [27 x i8] c"test_endswith_empty_string\00"
@.str.2 = [25 x i8] c"Error code not returned.\00"
define void @test_endswith_empty_string() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 @pl_endswith(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @assert_equal_int(i32 -1, i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ipv4_cidr2mask_host(uint8_t cidr) { return 0xFFFFFFFF << (32 - cidr); }


x86 assembly (clang, -O0):
<ipv4_cidr2mask_host>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x20,%ecx
sub    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_cidr2mask_host>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ipv4_cidr2mask_host(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 32, %3
%5 = shl i32 -1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @ipv4_cidr2mask_host(i32 %0) {
%2 = sub nsw i32 32, %0
%3 = shl nsw i32 -1, %2
ret i32 %3
}
/* Variables and functions */
int _func_xpath_funcs(char *, void *, int, char *);
int _func_xpath_position(char *chunk, void *data) {
  return _func_xpath_funcs(chunk, data, 3, "position()");
}


x86 assembly (clang, -O0):
<_func_xpath_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
lea    0xecc(%rip),%rcx
call   1030 <_func_xpath_funcs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_func_xpath_position>:
lea    0xee9(%rip),%rcx
mov    $0x3,%edx
jmp    1030 <_func_xpath_funcs@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"position()\00"
define i32 @_func_xpath_position(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @_func_xpath_funcs(i8* %5, i8* %6, i32 3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"position()\00"
define i32 @_func_xpath_position(i8* %0, i8* %1) {
%3 = tail call i32 @_func_xpath_funcs(i8* %0, i8* %1, i32 3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
double calcTimeJulianCent(const double jd) {
  return (jd - 2451545.0) / 36525.0;
}


x86 assembly (clang, -O0):
<calcTimeJulianCent>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcTimeJulianCent>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calcTimeJulianCent(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 0x4142B42C80000000
%5 = fdiv double %4, 3.652500e+04
ret double %5
}

LLVM IR (-O2):
define double @calcTimeJulianCent(double %0) {
%2 = fadd double %0, 0xC142B42C80000000
%3 = fdiv double %2, 3.652500e+04
ret double %3
}
int PaUtil_CountCurrentlyAllocatedBlocks(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PaUtil_CountCurrentlyAllocatedBlocks() {
ret i32 0
}
float __subsf3(float a __attribute__((unused)),
               float b __attribute__((unused))) {
  return 0.0;
}


x86 assembly (clang, -O0):
<__subsf3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__subsf3>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @__subsf3(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @__subsf3(float %0, float %1) {
ret float 0.000000e+00
}
/* Variables and functions */
int max3(int, int, int);
int get_nbuf(int nm, int nv, int nt, int ne) {
  return max3(3 * nm * nv, 4 * nm * nt, 2 * nm * ne);
}


x86 assembly (clang, -O0):
<get_nbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
imul   $0x3,-0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
shl    $0x2,%esi
imul   -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
imul   -0x10(%rbp),%edx
call   1030 <max3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nbuf>:
imul   %edi,%esi
lea    (%rsi,%rsi,2),%eax
imul   %edi,%edx
lea    0x0(,%rdx,4),%esi
imul   %edi,%ecx
lea    (%rcx,%rcx,1),%edx
mov    %eax,%edi
jmp    1030 <max3@plt>

LLVM IR (-O0):
define i32 @get_nbuf(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = mul nsw i32 3, %9
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %5
%14 = mul nsw i32 4, %13
%15 = load i32, i32* %7
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %5
%18 = mul nsw i32 2, %17
%19 = load i32, i32* %8
%20 = mul nsw i32 %18, %19
%21 = call i32 @max3(i32 %12, i32 %16, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_nbuf(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %0, 3
%6 = mul nsw i32 %5, %1
%7 = shl nsw i32 %0, 2
%8 = mul nsw i32 %7, %2
%9 = shl nsw i32 %0, 1
%10 = mul nsw i32 %9, %3
%11 = tail call i32 @max3(i32 %6, i32 %8, i32 %10)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void memcpy12() {
  char a[4] = {0};
  memcpy(0, a, 0);
}


x86 assembly (clang, -O0):
<memcpy12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
xor    %edx,%edx
mov    %edx,%edi
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy12>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @memcpy12() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @memcpy(i32 0, i8* %3, i32 0)
ret void
}

LLVM IR (-O2):
define void @memcpy12() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @memcpy(i32 0, i8* %2, i32 0)
ret void
}