xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x08() {
  Assert_real((isalpha(8) == 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_isalpha.c",
              45, ("isalpha should be 0 for 0x08"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x08>:
push   %rax
mov    $0x8,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x08\00"
define void @t_isalpha_0x08() {
%1 = call i64 @isalpha(i32 8)
%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 45, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x08\00"
define void @t_isalpha_0x08() {
%1 = tail call i64 @isalpha(i32 8)
%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 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 0x1b:
    exit(0);
    break;
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <keyboard+0x2b>
jmp    1134 <keyboard+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     1117 <keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TAB_Fct(char);
void IF_TABMax(void) { TAB_Fct('M'); }


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

x86 assembly (clang, -O2):
<IF_TABMax>:
mov    $0x4d,%edi
jmp    1030 <TAB_Fct@plt>

LLVM IR (-O0):
define void @IF_TABMax() {
%1 = call i32 @TAB_Fct(i8 signext 77)
ret void
}

LLVM IR (-O2):
define void @IF_TABMax() {
%1 = tail call i32 @TAB_Fct(i8 signext 77)
ret void
}
int EpsAtomicIntCompareAndExchange(volatile int *atomic, int oldVal,
                                   int newVal) {
  int result;
  __asm__ __volatile__("lock; cmpxchgl %2, %1"
                       : "=a"(result), "=m"(*atomic)
                       : "r"(newVal), "m"(*atomic), "0"(oldVal));
  return result == oldVal;
}


x86 assembly (clang, -O0):
<EpsAtomicIntCompareAndExchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
lock cmpxchg %edx,(%rcx)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EpsAtomicIntCompareAndExchange>:
mov    %esi,%eax
lock cmpxchg %edx,(%rdi)
xor    %ecx,%ecx
cmp    %esi,%eax
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @EpsAtomicIntCompareAndExchange(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** %4
%9 = load i32, i32* %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = call i32 asm sideeffect "lock; cmpxchgl $2, $1", "={ax},=*m,r,*m,0,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %8, i32 %9, i32* elementtype(i32) %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @EpsAtomicIntCompareAndExchange(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 asm sideeffect "lock; cmpxchgl $2, $1", "={ax},=*m,r,*m,0,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %2, i32* elementtype(i32) %0, i32 %1)
%5 = icmp eq i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
int return1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @return1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @return1() {
ret i32 1
}
void removegap(char *text) {}


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

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

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

LLVM IR (-O2):
define void @removegap(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  int h = 8;
  char s = h + '0';
  printf("after: %c\n", s);
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"after: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 8, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 48
%5 = trunc i32 %4 to i8
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"after: %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext 56)
ret i32 0
}
void CreateConsole() {}


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

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

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

LLVM IR (-O2):
define void @CreateConsole() {
ret void
}
int do_528() { return 528; }


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

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

LLVM IR (-O0):
define i32 @do_528() {
ret i32 528
}

LLVM IR (-O2):
define i32 @do_528() {
ret i32 528
}
void __exit() { void freeheap_exit(); }


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

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

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

LLVM IR (-O2):
define void @__exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ open_or_create(char *);
int /*<<< orphan*/ read_file(char *);
int main() {
  open_or_create("test.txt");
  read_file("test.txt");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <open_or_create@plt>
mov    %rbx,%rdi
call   1040 <read_file@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @open_or_create(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @read_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
define i32 @main() {
%1 = tail call i32 @open_or_create(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @read_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int main(void) {
  char c = '0';
  int i = 42;
  i = -89;
  i = +42;
  c++;
  c--;
  ++c;
  --c;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x30,-0x5(%rbp)
movl   $0x2a,-0xc(%rbp)
movl   $0xffffffa7,-0xc(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
add    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
add    $0xff,%al
mov    %al,-0x5(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i8 48, i8* %2
store i32 42, i32* %3
store i32 -89, i32* %3
store i32 42, i32* %3
%4 = load i8, i8* %2
%5 = add i8 %4, 1
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = add i8 %6, -1
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = add i8 %8, 1
store i8 %9, i8* %2
%10 = load i8, i8* %2
%11 = add i8 %10, -1
store i8 %11, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ commSendResponseMsg(void *, char *);
void ftpSYST(void *ep_server, void *comm_obj, char *args) {
  commSendResponseMsg(comm_obj, "215 UNIX Type: L8");
}


x86 assembly (clang, -O0):
<ftpSYST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <commSendResponseMsg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftpSYST>:
mov    %rsi,%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <commSendResponseMsg@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"215 UNIX Type: L8\00"
define void @ftpSYST(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i32 @commSendResponseMsg(i8* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"215 UNIX Type: L8\00"
define void @ftpSYST(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @commSendResponseMsg(i8* %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i(int);
int /*<<< orphan*/ printf(char *, int);
void h(int x) {
  printf("h(%d)\n", x);
  if (x > 0)
    i(x - 1);
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    114f <h+0x2f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
test   %ebx,%ebx
jle    1140 <h+0x20>
add    $0xffffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <i@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"h(%d)\0A\00"
define void @h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @i(i32 %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"h(%d)\0A\00"
define void @h(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @i(i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
int user_is_chrooted(const char *homedir) {
  char *tmp;
  tmp = strchr(homedir, '.');
  if (tmp != NULL) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<user_is_chrooted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <user_is_chrooted+0x35>
movl   $0x1,-0x4(%rbp)
jmp    114c <user_is_chrooted+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_is_chrooted>:
push   %rax
mov    $0x2e,%esi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @user_is_chrooted(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @user_is_chrooted(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
int wait(int ticks) {
  asm volatile("movl %0, %%ebx" ::"m"(ticks) : "%ebx");
  return syscall(1);
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <syscall@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    0xc(%rsp),%ebx
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, ...)*)(i32 1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, ...)*)(i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ szStr;

/* Variables and functions */
int /*<<< orphan*/ get_executable_path(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  char szStr[4096];
  get_executable_path(szStr, sizeof(szStr));
  printf("%s\n", szStr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1010(%rbp),%rdi
mov    $0x1000,%esi
call   1040 <get_executable_path@plt>
lea    -0x1010(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1000,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1040 <get_executable_path@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1000,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = call i32 @get_executable_path(i8* %4, i32 4096)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int rnd(range)
int range;
{ return abs((rand() >> 5) + (rand() >> 5)) % range; }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
sar    $0x5,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x8(%rbp),%edi
sar    $0x5,%eax
add    %eax,%edi
call   1030 <abs@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
sar    $0x5,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sar    $0x5,%eax
add    %ebp,%eax
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = ashr i32 %3, 5
%5 = call i32 (...) @rand()
%6 = ashr i32 %5, 5
%7 = add nsw i32 %4, %6
%8 = call i32 @abs(i32 %7)
%9 = load i32, i32* %2
%10 = srem i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = ashr i32 %2, 5
%4 = tail call i32 (...) @rand()
%5 = ashr i32 %4, 5
%6 = add nsw i32 %5, %3
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
%8 = srem i32 %7, %0
ret i32 %8
}
/* Type definitions */
struct MD5_CTX {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct MD5_CTX *);
void MD5_Free(struct MD5_CTX **ctx) {
  if (!ctx || !*ctx) {
    return;
  }
  free(*ctx);
  *ctx = NULL;
}


x86 assembly (clang, -O0):
<MD5_Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <MD5_Free+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <MD5_Free+0x2a>
jmp    1151 <MD5_Free+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MD5_Free>:
push   %rbx
test   %rdi,%rdi
je     112d <MD5_Free+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <MD5_Free+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.MD5_CTX = type { i32 }
define void @MD5_Free(%struct.MD5_CTX** %0) {
%2 = icmp eq %struct.MD5_CTX** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load %struct.MD5_CTX*, %struct.MD5_CTX** %0
%5 = icmp eq %struct.MD5_CTX* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(%struct.MD5_CTX* %4)
store %struct.MD5_CTX* null, %struct.MD5_CTX** %0
br label %8
8: ; preds = %1, %3, %6
ret void
}
int ChCode(const char *s) {
  if (*s == '^' && *(s + 1) != '^')
    return ((int)((*(s + 1)) & 0x1F));
  else
    return ((int)(*s));
}


x86 assembly (clang, -O0):
<ChCode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5e,%eax
jne    113c <ChCode+0x3c>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x5e,%eax
je     113c <ChCode+0x3c>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0x1f,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <ChCode+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChCode>:
movsbl (%rdi),%eax
cmp    $0x5e,%eax
jne    1116 <ChCode+0x16>
movzbl 0x1(%rdi),%ecx
cmp    $0x5e,%ecx
je     1116 <ChCode+0x16>
and    $0x1f,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ChCode(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 94
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 94
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = and i8 %6, 31
%10 = zext i8 %9 to i32
br label %13
11: ; preds = %4, %1
%12 = sext i8 %2 to i32
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}
AR0A1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[10000000]) <= (*((short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl 0x1312d00(%rax),%eax
mov    $0xa98ac7,%ecx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <AR0A1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <AR0A1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0A1>:
movzwl 0x1312d00(%r8),%ecx
01
xor    %eax,%eax
cmp    0xa98ac7,%cx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @AR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = load i16, i16* inttoptr (i64 11111111 to i16*)
%10 = icmp sle i16 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
unsigned long int ulmin(unsigned long int x, unsigned long int y) {
  if (x > y) {
    return y;
  }
  return x;
}


x86 assembly (clang, -O0):
<ulmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1127 <ulmin+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ulmin+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulmin>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmova  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @ulmin(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
void NCONF_new(void) {}


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

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

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

LLVM IR (-O2):
define void @NCONF_new() {
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_project(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_project() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_project() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
int test_00(const char *x, const char *y) { return __builtin_strcmp(x, y); }


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

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

LLVM IR (-O0):
define i32 @test_00(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_00(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PUT32(int, int);
void led_on(void) { PUT32(0x2020001C, 1 << 16); }


x86 assembly (clang, -O0):
<led_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2020001c,%edi
mov    $0x10000,%esi
call   1030 <PUT32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_on>:
mov    $0x2020001c,%edi
mov    $0x10000,%esi
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @led_on() {
%1 = call i32 @PUT32(i32 538968092, i32 65536)
ret void
}

LLVM IR (-O2):
define void @led_on() {
%1 = tail call i32 @PUT32(i32 538968092, i32 65536)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned long long int double_to_bits(double d) {
  union {
    unsigned long long int i;
    double d;
  } u;
  assert(8 == sizeof(unsigned long long int));
  assert(8 == sizeof(double));
  assert(8 == sizeof(u));
  u.d = d;
  return u.i;
}


x86 assembly (clang, -O0):
<double_to_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_bits>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
movq   (%rsp),%xmm0
movq   %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define i64 @double_to_bits(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = call i32 @assert(i32 1)
%5 = call i32 @assert(i32 1)
%6 = call i32 @assert(i32 1)
%7 = load double, double* %2
%8 = bitcast %union.anon* %3 to double*
store double %7, double* %8
%9 = bitcast %union.anon* %3 to i64*
%10 = load i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @double_to_bits(double %0) {
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = bitcast double %0 to i64
ret i64 %5
}
void RTTcpSgWriteL(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpSgWriteL() {
ret void
}
int drv_LW_ABP_contrast(int contrast) { return contrast; }


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

x86 assembly (clang, -O2):
<drv_LW_ABP_contrast>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @drv_LW_ABP_contrast(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("This is a \"bin\" target.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"This is a \22bin\22 target.\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"This is a \22bin\22 target.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int get_number_cpus_online(void) { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<get_number_cpus_online>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number_cpus_online>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_number_cpus_online() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_number_cpus_online() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
void genc_ngl_d() {}


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

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

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

LLVM IR (-O2):
define void @genc_ngl_d() {
ret void
}
double multiply(double A, double B) { return A * B; }


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @multiply(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Type definitions */
struct iphdr {
  int ihl;
};

/* Variables and functions */
int ipv4_hdrlen(struct iphdr *ip4) { return ip4->ihl * 4; }


x86 assembly (clang, -O0):
<ipv4_hdrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_hdrlen>:
mov    (%rdi),%eax
shl    $0x2,%eax
ret

LLVM IR (-O0):
%struct.iphdr = type { i32 }
define i32 @ipv4_hdrlen(%struct.iphdr* %0) {
%2 = alloca %struct.iphdr*
store %struct.iphdr* %0, %struct.iphdr** %2
%3 = load %struct.iphdr*, %struct.iphdr** %2
%4 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
%struct.iphdr = type { i32 }
define i32 @ipv4_hdrlen(%struct.iphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = shl nsw i32 %3, 2
ret i32 %4
}
void e86_set_mem_uint16(void *mem, unsigned long addr, unsigned short val) {}


x86 assembly (clang, -O0):
<e86_set_mem_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @e86_set_mem_uint16(i8* %0, i64 %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i16
store i8* %0, i8** %4
store i64 %1, i64* %5
store i16 %2, i16* %6
ret void
}

LLVM IR (-O2):
define void @e86_set_mem_uint16(i8* nocapture %0, i64 %1, i16 zeroext %2) {
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  time_t end = time(NULL) + 240;
  printf("Process with PID %d\n", getpid());
  for (;;) {
    if (time(NULL) >= end) {
      break;
    }
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
add    $0xf0,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
cmp    -0x10(%rbp),%rax
jl     118f <main+0x4f>
jmp    1194 <main+0x54>
jmp    1177 <main+0x37>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,%rbx
add    $0xf0,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1050 <time@plt>
cmp    %rbx,%rax
jl     1170 <main+0x30>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Process with PID %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @time(i32* null)
%4 = add nsw i64 %3, 240
store i64 %4, i64* %2
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %12, %0
%8 = call i64 @time(i32* null)
%9 = load i64, i64* %2
%10 = icmp sge i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %13
12: ; preds = %7
br label %7
13: ; preds = %11
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"Process with PID %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = add nsw i64 %1, 240
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %5, %0
%6 = tail call i64 @time(i32* null)
%7 = icmp slt i64 %6, %2
br i1 %7, label %5, label %8
8: ; preds = %5
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}
void _set_enba(unsigned char *u) { u[3] |= (1 << 3); }


x86 assembly (clang, -O0):
<_set_enba>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%ecx
or     $0x8,%ecx
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_enba>:
orb    $0x8,0x3(%rdi)
ret

LLVM IR (-O0):
define void @_set_enba(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 8
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
ret void
}

LLVM IR (-O2):
define void @_set_enba(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = or i8 %3, 8
store i8 %4, i8* %2
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc == 1)
    exit(EXIT_SUCCESS);
  return EXIT_FAILURE;
}


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)
cmpl   $0x1,-0x8(%rbp)
jne    113e <main+0x2e>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     1121 <main+0x11>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = 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* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
ret i32 %12
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %2
%8 = load i32, i32* @EXIT_FAILURE
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int x = 3;
  assert(x == 3);
  printf("so far so good\n");
  assert(x == 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"so far so good\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 4
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"so far so good\00"
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
struct tl880_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tl880_write_regbits(struct tl880_dev *, int, int, int,
                                       int /*<<< orphan*/);
void tl880_disable_bvdo(struct tl880_dev *tl880dev) {
  tl880_write_regbits(tl880dev, 0x10000, 1, 1, 0);
}


x86 assembly (clang, -O0):
<tl880_disable_bvdo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x10000,%esi
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    %ecx,%edx
call   1030 <tl880_write_regbits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl880_disable_bvdo>:
mov    $0x10000,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
jmp    1030 <tl880_write_regbits@plt>

LLVM IR (-O0):
%struct.tl880_dev = type { i32 }
define void @tl880_disable_bvdo(%struct.tl880_dev* %0) {
%2 = alloca %struct.tl880_dev*
store %struct.tl880_dev* %0, %struct.tl880_dev** %2
%3 = load %struct.tl880_dev*, %struct.tl880_dev** %2
%4 = call i32 @tl880_write_regbits(%struct.tl880_dev* %3, i32 65536, i32 1, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.tl880_dev = type { i32 }
define void @tl880_disable_bvdo(%struct.tl880_dev* %0) {
%2 = tail call i32 @tl880_write_regbits(%struct.tl880_dev* %0, i32 65536, i32 1, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int /*<<< orphan*/, char *);
int /*<<< orphan*/ toLowerCase(char *);
void testConvertToLowerCase(void) {
  test(toLowerCase("ABC"), "abc");
  test(toLowerCase("#A1"), "#a1");
}


x86 assembly (clang, -O0):
<testConvertToLowerCase>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <toLowerCase@plt>
mov    %eax,%edi
lea    0xecb(%rip),%rsi
call   1040 <test@plt>
lea    0xec3(%rip),%rdi
call   1030 <toLowerCase@plt>
mov    %eax,%edi
lea    0xeb9(%rip),%rsi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testConvertToLowerCase>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <toLowerCase@plt>
lea    0xed0(%rip),%rsi
mov    %eax,%edi
call   1040 <test@plt>
lea    0xec6(%rip),%rdi
call   1030 <toLowerCase@plt>
lea    0xebe(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <test@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ABC\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [4 x i8] c"#A1\00"
@.str.3 = [4 x i8] c"#a1\00"
define void @testConvertToLowerCase() {
%1 = call i32 @toLowerCase(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @toLowerCase(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @test(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ABC\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [4 x i8] c"#A1\00"
@.str.3 = [4 x i8] c"#a1\00"
define void @testConvertToLowerCase() {
%1 = tail call i32 @toLowerCase(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @toLowerCase(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @test(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int generated_by_testExe1();
int generated_by_testExe3();
int testLib2();
int testLib3();
int testLib4();
int main() {
  return (testLib2() + generated_by_testExe1() + testLib3() + testLib4() +
          generated_by_testExe3());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <testLib2@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1070 <generated_by_testExe1@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <testLib3@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <testLib4@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <generated_by_testExe3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <testLib2@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <generated_by_testExe1@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <testLib3@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1050 <testLib4@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1040 <generated_by_testExe3@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testLib2()
%3 = call i32 (...) @generated_by_testExe1()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @testLib3()
%6 = add nsw i32 %4, %5
%7 = call i32 (...) @testLib4()
%8 = add nsw i32 %6, %7
%9 = call i32 (...) @generated_by_testExe3()
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testLib2()
%2 = tail call i32 (...) @generated_by_testExe1()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @testLib3()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @testLib4()
%7 = add nsw i32 %5, %6
%8 = tail call i32 (...) @generated_by_testExe3()
%9 = add nsw i32 %7, %8
ret i32 %9
}