xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
FILE *openFile(char *fileName, char *type) {
  FILE *file = fopen(fileName, type);
  if (file == NULL) {
    printf("ERROR: Unable to open file (%s) for read\n", fileName);
    perror("Error");
    exit(-1);
  }
  return file;
}


x86 assembly (clang, -O0):
<openFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1192 <openFile+0x52>
mov    -0x8(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFile>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1150 <openFile+0x10>
pop    %rbx
ret
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"ERROR: Unable to open file (%s) for read\0A\00"
@.str.1 = [6 x i8] c"Error\00"
define i32* @openFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@.str = [42 x i8] c"ERROR: Unable to open file (%s) for read\0A\00"
@.str.1 = [6 x i8] c"Error\00"
define noalias i32* @openFile(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port23__default__fired();
void HplMsp430InterruptP__Port23__fired(void) {
  HplMsp430InterruptP__Port23__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430InterruptP__Port23__fired() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port23__default__fired()
ret void
}
/* Variables and functions */
bool isInteger(int pos, char chr) {
  if (chr >= '0' && chr <= '9')
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<isInteger>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <isInteger+0x33>
movsbl -0x9(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <isInteger+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <isInteger+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInteger>:
add    $0xd0,%sil
xor    %eax,%eax
cmp    $0xa,%sil
setb   %al
ret

LLVM IR (-O0):
define i32 @isInteger(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 57
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %3
br label %15
14: ; preds = %9, %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @isInteger(i32 %0, i8 signext %1) {
%3 = add i8 %1, -48
%4 = icmp ult i8 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerCapComP__4__Capture__clearOverflow();
void GpioCaptureC__0__Msp430Capture__clearOverflow(void) {
  Msp430TimerCapComP__4__Capture__clearOverflow();
}


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

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

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

LLVM IR (-O2):
define void @GpioCaptureC__0__Msp430Capture__clearOverflow() {
%1 = tail call i32 (...) @Msp430TimerCapComP__4__Capture__clearOverflow()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *termFn(void *arg) { abort(); }


x86 assembly (clang, -O0):
<termFn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<termFn>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @termFn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define noalias i8* @termFn(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *strstr(char const *, char const *);
__attribute__((regparm(0))) char *(_win_strstr)(const char *s1,
                                                const char *s2) {
  return strstr(s1, s2);
}


x86 assembly (clang, -O0):
<_win_strstr>:
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 <strstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @_win_strstr(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printid(int);
int q(int, int);
void main() {
  int ans;
  ans = q(3, 4);
  printid(ans);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <q@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <q@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <printid@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @q(i32 3, i32 4)
%2 = tail call i32 @printid(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_exit1(void) { printf("call my_exit1\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"call my_exit1\0A\00"
define void @my_exit1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"call my_exit1\00"
define void @my_exit1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_report(char *, int, int);
int /*<<< orphan*/ erl_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ erl_mk_empty_list();
int /*<<< orphan*/ send_term(int /*<<< orphan*/);
void t_erl_mk_empty_list(void) {
  erl_init(NULL, 0);
  send_term(erl_mk_empty_list());
  do_report("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/"
            "erl_interface/test/erl_eterm_SUITE_data/eterm_test.c",
            469, 1);
}


x86 assembly (clang, -O0):
<t_erl_mk_empty_list>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
mov    $0x0,%al
call   1050 <erl_mk_empty_list@plt>
mov    %eax,%edi
call   1040 <send_term@plt>
lea    0xe9c(%rip),%rdi
mov    $0x1d5,%esi
mov    $0x1,%edx
call   1030 <do_report@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_erl_mk_empty_list>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
xor    %eax,%eax
call   1050 <erl_mk_empty_list@plt>
mov    %eax,%edi
call   1040 <send_term@plt>
lea    0xea1(%rip),%rdi
mov    $0x1d5,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <do_report@plt>

LLVM IR (-O0):
@.str = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_empty_list() {
%1 = call i32 @erl_init(i32* null, i32 0)
%2 = call i32 (...) @erl_mk_empty_list()
%3 = call i32 @send_term(i32 %2)
%4 = call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str, i64 0, i64 0), i32 469, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_empty_list() {
%1 = tail call i32 @erl_init(i32* null, i32 0)
%2 = tail call i32 (...) @erl_mk_empty_list()
%3 = tail call i32 @send_term(i32 %2)
%4 = tail call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str, i64 0, i64 0), i32 469, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int uxmi_system(char *xcmd) {
  int rc = 0;
  char scmd[255];
  sprintf(scmd, "%s 2>/dev/null 1>/dev/null", xcmd);
  return (rc);
}


x86 assembly (clang, -O0):
<uxmi_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec8(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uxmi_system>:
sub    $0x108,%rsp
mov    %rdi,%rdx
lea    0xedf(%rip),%rsi
mov    %rsp,%rdi
call   1030 <sprintf@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%s 2>/dev/null 1>/dev/null\00"
define i32 @uxmi_system(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [255 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s 2>/dev/null 1>/dev/null\00"
define i32 @uxmi_system(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ br();
int /*<<< orphan*/ ic();
int /*<<< orphan*/ printf(char *);
int main(void) {
  br();
  printf(", ");
  ic();
  ic();
  br();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <br@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <ic@plt>
mov    $0x0,%al
call   1040 <ic@plt>
mov    $0x0,%al
call   1050 <br@plt>
lea    0xe95(%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   1060 <br@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <ic@plt>
xor    %eax,%eax
call   1050 <ic@plt>
xor    %eax,%eax
call   1060 <br@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c", \00"
define i32 @main() {
%1 = tail call i32 (...) @br()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @ic()
%4 = tail call i32 (...) @ic()
%5 = tail call i32 (...) @br()
%6 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int ioCanDeletePathOfSize(char *, int);
int secCanDeletePathOfSize(char *dirName, int dirNameSize) {
  return ioCanDeletePathOfSize(dirName, dirNameSize);
}


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

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

LLVM IR (-O0):
define i32 @secCanDeletePathOfSize(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 = load i32, i32* %4
%7 = call i32 @ioCanDeletePathOfSize(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @secCanDeletePathOfSize(i8* %0, i32 %1) {
%3 = tail call i32 @ioCanDeletePathOfSize(i8* %0, i32 %1)
ret i32 %3
}
void GPIO_LedInit(void) {
  (*(volatile unsigned *)(0x7F008820)) = 0x11111;
  (*(volatile unsigned *)(0x7F008828)) = 0x00;
  (*(volatile unsigned *)(0x7F008824)) = 0x1F;
}


x86 assembly (clang, -O0):
<GPIO_LedInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008820,%eax
movl   $0x11111,(%rax)
mov    $0x7f008828,%eax
movl   $0x0,(%rax)
mov    $0x7f008824,%eax
movl   $0x1f,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_LedInit>:
movl   $0x11111,0x7f008820
movl   $0x0,0x7f008828
movl   $0x1f,0x7f008824
ret

LLVM IR (-O0):
define void @GPIO_LedInit() {
store volatile i32 69905, i32* inttoptr (i64 2130741280 to i32*)
store volatile i32 0, i32* inttoptr (i64 2130741288 to i32*)
store volatile i32 31, i32* inttoptr (i64 2130741284 to i32*)
ret void
}

LLVM IR (-O2):
define void @GPIO_LedInit() {
store volatile i32 69905, i32* inttoptr (i64 2130741280 to i32*)
store volatile i32 0, i32* inttoptr (i64 2130741288 to i32*)
store volatile i32 31, i32* inttoptr (i64 2130741284 to i32*)
ret void
}
/* Variables and functions */
scalar_t__ log10(float);
float log10f(float x) { return (float)log10(x); }


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

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

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

LLVM IR (-O2):
define float @log10f(float %0) {
%2 = tail call i64 @log10(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t parse_addr(uint64_t rawaddr, int is_4dw) {
  return is_4dw ? (rawaddr >> 32) | (rawaddr << 32) : rawaddr;
}


x86 assembly (clang, -O0):
<parse_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1134 <parse_addr+0x34>
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <parse_addr+0x3a>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @parse_addr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = ashr i32 %8, 32
%10 = load i32, i32* %3
%11 = shl i32 %10, 32
%12 = or i32 %9, %11
br label %15
13: ; preds = %2
%14 = load i32, i32* %3
br label %15
15: ; preds = %13, %7
%16 = phi i32 [ %12, %7 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @parse_addr(i32 returned %0, i32 %1) {
ret i32 %0
}
void copia(void) {
  int i;
  extern char linea[], linea_max[];
  char *alinea, *alinea_max;
  i = 0;
  alinea = linea;
  alinea_max = linea_max;
  while (*(linea + i) != '\0') {
    *(linea_max + i) = *(linea + i);
    i++;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2ec4(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1163 <copia+0x63>
movslq -0x4(%rbp),%rcx
mov    0x2eac(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2e86(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1121 <copia+0x21>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%cl
test   %cl,%cl
je     1130 <copia+0x30>
xor    %edx,%edx
mov    0x2ec2(%rip),%rsi
cs nopw 0x0(%rax,%rax,1)
mov    %cl,(%rsi,%rdx,1)
movzbl 0x1(%rax,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <copia+0x20>
ret

LLVM IR (-O0):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), i8** %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i32, i32* %1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), i64 %13
%15 = load i8, i8* %14
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), i64 %17
store i8 %15, i8* %18
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %7, %3 ], [ 0, %0 ]
%5 = phi i8 [ %9, %3 ], [ %1, %0 ]
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %4
store i8 %5, i8* %6
%7 = add nuw nsw i64 %4, 1
%8 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %0
ret void
}
char *dispose() { return "ok"; }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
define i8* @dispose() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
define i8* @dispose() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int r = 0;
  printf("Hello world!\n");
  return r;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned long long foo(unsigned long long i) { return i << 3; }


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

x86 assembly (clang, -O2):
<foo>:
lea    0x0(,%rdi,8),%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 3
ret i64 %4
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = shl i64 %0, 3
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, char const *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void log_chroot(const char *newroot) {
  report(LOG_ERR, "Unable to chroot to %s: %s", newroot, strerror(errno));
}


x86 assembly (clang, -O0):
<log_chroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0xea2(%rip),%rsi
call   1030 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_chroot>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [27 x i8] c"Unable to chroot to %s: %s\00"
@errno = global i32 0
define void @log_chroot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_ERR
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i32 @strerror(i32 %5)
%7 = call i32 @report(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [27 x i8] c"Unable to chroot to %s: %s\00"
@errno = global i32 0
define void @log_chroot(i8* %0) {
%2 = load i32, i32* @LOG_ERR
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @report(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
ret void
}
void displayUpdate(int displayUpdate, char *trackname) {
  switch (displayUpdate) {
  case 1:
    break;
  case 2:
    break;
  case 3:
    break;
  case 4:
    break;
  case 5:
    break;
  case 6:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<displayUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     1152 <displayUpdate+0x52>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1157 <displayUpdate+0x57>
jmp    1157 <displayUpdate+0x57>
jmp    1157 <displayUpdate+0x57>
jmp    1157 <displayUpdate+0x57>
jmp    1157 <displayUpdate+0x57>
jmp    1157 <displayUpdate+0x57>
jmp    1157 <displayUpdate+0x57>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @displayUpdate(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
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
]
6: ; preds = %2
br label %13
7: ; preds = %2
br label %13
8: ; preds = %2
br label %13
9: ; preds = %2
br label %13
10: ; preds = %2
br label %13
11: ; preds = %2
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
ret void
}

LLVM IR (-O2):
define void @displayUpdate(i32 %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ GLuint;
typedef double GLdouble;

/* Variables and functions */
scalar_t__ UINT_MAX;
int /*<<< orphan*/ assert(int);
void shoveUint(GLdouble value, int index, void *data) {
  assert(0.0 <= value && value <= (GLdouble)UINT_MAX);
  ((GLuint *)data)[index] = (GLuint)value;
}


x86 assembly (clang, -O0):
<shoveUint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     1156 <shoveUint+0x46>
movsd  -0x8(%rbp),%xmm1
mov    0x2ea1(%rip),%rax
cvtsi2sdq (%rax),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cvttsd2si -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shoveUint>:
push   %rbp
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
mov    0x2ebe(%rip),%rcx
xorps  %xmm1,%xmm1
cvtsi2sdq (%rcx),%xmm1
ucomisd %xmm0,%xmm1
mov    %rsi,%rbx
mov    %edi,%ebp
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
cvttsd2si (%rsp),%rax
movslq %ebp,%rcx
mov    %rax,(%rbx,%rcx,8)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@UINT_MAX = global i64 0
define void @shoveUint(double %0, i32 %1, i8* %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i8*
store double %0, double* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load double, double* %4
%8 = fcmp ole double 0.000000e+00, %7
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load double, double* %4
%11 = load i64, i64* @UINT_MAX
%12 = sitofp i64 %11 to double
%13 = fcmp ole double %10, %12
br label %14
14: ; preds = %9, %3
%15 = phi i1 [ false, %3 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load double, double* %4
%19 = fptosi double %18 to i64
%20 = load i8*, i8** %6
%21 = bitcast i8* %20 to i64*
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i64, i64* %21, i64 %23
store i64 %19, i64* %24
ret void
}

LLVM IR (-O2):
@UINT_MAX = global i64 0
define void @shoveUint(double %0, i32 %1, i8* nocapture writeonly %2) {
%4 = fcmp oge double %0, 0.000000e+00
%5 = load i64, i64* @UINT_MAX
%6 = sitofp i64 %5 to double
%7 = fcmp oge double %6, %0
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = fptosi double %0 to i64
%12 = bitcast i8* %2 to i64*
%13 = sext i32 %1 to i64
%14 = getelementptr inbounds i64, i64* %12, i64 %13
store i64 %11, i64* %14
ret void
}
double Sleef_nextafter(double x, double y) { return __builtin_nextafter(x, y); }


x86 assembly (clang, -O0):
<Sleef_nextafter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <nextafter@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @Sleef_nextafter(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 = call double @nextafter(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @Sleef_nextafter(double %0, double %1) {
%3 = tail call double @nextafter(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
float div(float x, float y) {
  if (y != 0)
    return x / y;
  else {
    printf("error\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    113e <div+0x2e>
jp     113e <div+0x2e>
jmp    1152 <div+0x42>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1166 <div+0x56>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jne    111a <div+0xa>
jnp    111f <div+0xf>
divss  %xmm1,%xmm0
ret
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"error\0A\00"
define float @div(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp une float %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fdiv float %9, %10
store float %11, float* %3
br label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store float 0.000000e+00, float* %3
br label %14
14: ; preds = %12, %8
%15 = load float, float* %3
ret float %15
}

LLVM IR (-O2):
@str = [6 x i8] c"error\00"
define float @div(float %0, float %1) {
%3 = fcmp une float %1, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = fdiv float %0, %1
br label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi float [ %5, %4 ], [ 0.000000e+00, %6 ]
ret float %9
}
int main() {
  int a = 4;
  int b = 2;
  int c = 3;
  int d = 6;
  a = (b + c) * d - a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%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 i32
%3 = alloca i32
%4 = alloca i32
store i32 4, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 6, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %1
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void rewinddir(char *dirp) { printf("tcl>>> %s\n", __func__); }


x86 assembly (clang, -O0):
<rewinddir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewinddir>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.rewinddir = [10 x i8] c"rewinddir\00"
define void @rewinddir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.rewinddir, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.rewinddir = [10 x i8] c"rewinddir\00"
define void @rewinddir(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.rewinddir, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void _free(void *ptr) {
  printf("_free(): block at 0x%X lost.\n", (unsigned int)ptr);
}


x86 assembly (clang, -O0):
<_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"_free(): block at 0x%X lost.\0A\00"
define void @_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"_free(): block at 0x%X lost.\0A\00"
define void @_free(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DebugLog(char *);
void main(void) { DebugLog("Hello World!\n"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @main() {
%1 = tail call i32 @DebugLog(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_date(char *, char *);
void rfc822_date(char *date) { do_date(date, "%a, %d %b %Y %H:%M:%S "); }


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

x86 assembly (clang, -O2):
<rfc822_date>:
lea    0xee9(%rip),%rsi
jmp    1030 <do_date@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%a, %d %b %Y %H:%M:%S \00"
define void @rfc822_date(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @do_date(i8* %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%a, %d %b %Y %H:%M:%S \00"
define void @rfc822_date(i8* %0) {
%2 = tail call i32 @do_date(i8* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
char *whoami(void) { return ("general"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"general\00"
define i8* @whoami() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"general\00"
define i8* @whoami() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
void endDescribeFunJUnitXml(void) {}


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

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

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

LLVM IR (-O2):
define void @endDescribeFunJUnitXml() {
ret void
}
int clean_array(int *buffer, int num_bytes) {
  int i = 0;
  for (; i < num_bytes; i++)
    buffer[i] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<clean_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <clean_array+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clean_array+0x12>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_array>:
test   %esi,%esi
jle    1126 <clean_array+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @clean_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf("(%d)%d-%d", &a, &b, &c);
  printf("0086%d%d%d", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"(%d)%d-%d\00"
@.str.1 = [11 x i8] c"0086%d%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}
unsigned int lcm_compare_id(void) {
  unsigned int id = 0;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @lcm_compare_id() {
ret i32 1
}
/* Variables and functions */
void *stkp_load(void *);
void *__stkp_load_agent(void *addr) { return stkp_load(addr); }


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

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

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

LLVM IR (-O2):
define i8* @__stkp_load_agent(i8* %0) {
%2 = tail call i8* @stkp_load(i8* %0)
ret i8* %2
}
void *call_addr(void *source, void *target) {
  if (source > target) {
    return (void *)0xFFFFFFFF - 4 + (target - source);
  }
  return (void *)(target - source) - 4;
}


x86 assembly (clang, -O0):
<call_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    113a <call_addr+0x3a>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rax,%rcx
mov    $0xffffffff,%eax
add    $0xfffffffffffffffc,%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    114d <call_addr+0x4d>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_addr>:
sub    %rdi,%rsi
mov    $0xfffffffb,%ecx
mov    $0xfffffffffffffffc,%rax
cmovb  %rcx,%rax
add    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @call_addr(i8* %0, i8* %1) {
%3 = icmp ugt i8* %0, %1
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = getelementptr i8, i8* inttoptr (i64 4294967291 to i8*), i64 %6
%8 = inttoptr i64 %6 to i8*
%9 = getelementptr i8, i8* %8, i64 -4
%10 = select i1 %3, i8* %7, i8* %9
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ calc_coeffs();
void init_iir(void) { calc_coeffs(); }


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

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

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

LLVM IR (-O2):
define void @init_iir() {
%1 = tail call i32 (...) @calc_coeffs()
ret void
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(char const *s, int fd) {
  int l;
  l = ft_strlen(s);
  write(fd, s, l);
  return;
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @ft_putstr_fd(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 = call i32 @ft_strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sum = 0;
  int array[] = {0, 0, 0};
  for (int i = 0; i < 3; i++) {
    array[i] = array[i] + 1;
    sum += i;
  }
  printf("hello world %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1181 <main+0x61>
movslq -0x18(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%ecx
add    $0x1,%ecx
movslq -0x18(%rbp),%rax
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114d <main+0x2d>
mov    -0x8(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"hello world %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i32]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%5 = bitcast [3 x i32]* %3 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %16
store i32 %14, i32* %17
%18 = load i32, i32* %4
%19 = load i32, i32* %2
%20 = add nsw i32 %19, %18
store i32 %20, i32* %2
br label %21
21: ; preds = %9
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %6
24: ; preds = %6
%25 = load i32, i32* %2
%26 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"hello world %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}