xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintWelcome(void) {
  printf("\nmakefsfile - Generate a file containing a file system image.\n");
  printf("Copyright (c) 2008-2014 Texas Instruments Incorporated.  All rights "
         "reserved.\n\n");
}


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

x86 assembly (clang, -O2):
<PrintWelcome>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"\0Amakefsfile - Generate a file containing a file system image.\0A\00"
@.str.1 = [80 x i8] c"Copyright (c) 2008-2014 Texas Instruments Incorporated. All rights reserved.\0A\0A\00"
define void @PrintWelcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [62 x i8] c"\0Amakefsfile - Generate a file containing a file system image.\00"
@str.2 = [79 x i8] c"Copyright (c) 2008-2014 Texas Instruments Incorporated. All rights reserved.\0A\00"
define void @PrintWelcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
void numa_tonode_memory(void *start, size_t size, int node) {}


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

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

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

LLVM IR (-O2):
define void @numa_tonode_memory(i8* nocapture %0, i64 %1, i32 %2) {
ret void
}
double macheps() {
  double macheps;
  macheps = 1.0;
  while ((macheps + 1.0) > 1.0) {
    macheps = macheps / 2.0;
  }
  macheps = macheps * 2;
  return macheps;
}


x86 assembly (clang, -O0):
<macheps>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xee7(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xeda(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114b <macheps+0x4b>
movsd  -0x8(%rbp),%xmm0
movsd  0xecb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1111 <macheps+0x11>
movsd  0xeb5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<macheps>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @macheps() {
%1 = alloca double
store double 1.000000e+00, double* %1
br label %2
2: ; preds = %6, %0
%3 = load double, double* %1
%4 = fadd double %3, 1.000000e+00
%5 = fcmp ogt double %4, 1.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load double, double* %1
%8 = fdiv double %7, 2.000000e+00
store double %8, double* %1
br label %2
9: ; preds = %2
%10 = load double, double* %1
%11 = fmul double %10, 2.000000e+00
store double %11, double* %1
%12 = load double, double* %1
ret double %12
}

LLVM IR (-O2):
define double @macheps() {
ret double 0x3CB0000000000000
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int *malloc(int);
int /*<<< orphan*/ stderr;
__attribute__((no)) int t3(void) {
  int *ptr_to_undef_int = malloc(sizeof(int));
  int undef_int = *ptr_to_undef_int;
  fprintf(stderr, "\nUndef 3 of 8 (32 bit undef)\n");
  return (undef_int == 0x12345678 ? 13 : 24);
}


x86 assembly (clang, -O0):
<t3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edx
mov    $0x18,%eax
mov    $0xd,%ecx
cmp    $0x12345678,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t3>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    (%rax),%ebx
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x12345678,%ebx
mov    $0xd,%ecx
mov    $0x18,%eax
cmove  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"\0AUndef 3 of 8 (32 bit undef)\0A\00"
define i32 @t3() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = load i32, i32* %4
store i32 %5, i32* %2
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 305419896
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 13, i32 24
ret i32 %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"\0AUndef 3 of 8 (32 bit undef)\0A\00"
define i32 @t3() {
%1 = tail call i32* @malloc(i32 4)
%2 = load i32, i32* %1
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %2, 305419896
%6 = select i1 %5, i32 13, i32 24
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int /*<<< orphan*/ strlen(char const *);
int system(char *);
int system_silent(const char *command) {
  char command_silent[strlen(command) + 13];
  sprintf(command_silent, "%s > /dev/null", command);
  return system(command_silent);
}


x86 assembly (clang, -O0):
<system_silent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0xd,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <system@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_silent>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0xd,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s > /dev/null\00"
define i32 @system_silent(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 13
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i8, i64 %8
store i64 %8, i64* %4
%11 = load i8*, i8** %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @system(i8* %10)
%14 = load i8*, i8** %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s > /dev/null\00"
define i32 @system_silent(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 13
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @system(i8* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int errno;
void close_quietly(int fd) {
  int e = errno;
  close(fd);
  errno = e;
}


x86 assembly (clang, -O0):
<close_quietly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%ecx
mov    0x2ea7(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_quietly>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <close@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @close_quietly(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
%7 = load i32, i32* %3
store i32 %7, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @close_quietly(i32 %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @close(i32 %0)
store i32 %2, i32* @errno
ret void
}
/* Variables and functions */
int as_int(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i;
  for (i = 1; i < argc; i++) {
    printf("%d\n", as_int(argv[i]));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1176 <main+0x56>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <as_int@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     115c <main+0x3c>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xec1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rdi
call   1040 <as_int@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @as_int(i8* %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
void sui_default_callback(int e, int x, int y, int flag, void *d) { ; }


x86 assembly (clang, -O0):
<sui_default_callback>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sui_default_callback(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @sui_default_callback(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4) {
ret void
}
void ztrace_init() {}


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

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

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

LLVM IR (-O2):
define void @ztrace_init() {
ret void
}
/* Variables and functions */
int snprintf(char *, size_t, char *, int, char const *);
int sys_info(int argc, const char **argv, char *buf, size_t buf_size) {
  int bytes_writen;
  bytes_writen = snprintf(buf, buf_size,
                          "Info: argc=%d, arg[0]=%s"
                          "\n",
                          argc, argv[0]);
  return bytes_writen;
}


x86 assembly (clang, -O0):
<sys_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%r8
lea    0xec0(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_info>:
mov    %rdx,%rax
mov    %edi,%r9d
mov    (%rsi),%r8
lea    0xee0(%rip),%rdx
mov    %rax,%rdi
mov    %rcx,%rsi
mov    %r9d,%ecx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Info: argc=%d, arg[0]=%s\0A\00"
define i32 @sys_info(i32 %0, i8** %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %7
%11 = load i64, i64* %8
%12 = load i32, i32* %5
%13 = load i8**, i8*** %6
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @snprintf(i8* %10, i64 %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %15)
store i32 %16, i32* %9
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
@.str = [26 x i8] c"Info: argc=%d, arg[0]=%s\0A\00"
define i32 @sys_info(i32 %0, i8** nocapture %1, i8* %2, i64 %3) {
%5 = load i8*, i8** %1
%6 = tail call i32 @snprintf(i8* %2, i64 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %5)
ret i32 %6
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
void string_lower(char *lowstr) {
  int i;
  for (i = 0; i < strlen(lowstr); i++)
    lowstr[i] = tolower(lowstr[i]);
}


x86 assembly (clang, -O0):
<string_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <string_lower+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <string_lower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_lower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <string_lower+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <string_lower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @string_lower(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
float expf(float);
float logf(float);
float HMM_PowerF(float Base, float Exponent) {
  ;
  float Result = expf(Exponent * logf(Base));
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_PowerF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1040 <expf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_PowerF>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <logf@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <expf@plt>

LLVM IR (-O0):
define float @HMM_PowerF(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %3
%8 = call float @logf(float %7)
%9 = fmul float %6, %8
%10 = call float @expf(float %9)
store float %10, float* %5
%11 = load float, float* %5
ret float %11
}

LLVM IR (-O2):
define float @HMM_PowerF(float %0, float %1) {
%3 = tail call float @logf(float %0)
%4 = fmul float %3, %1
%5 = tail call float @expf(float %4)
ret float %5
}
float dt_fast_mexp2f(const float x) {
  const int i1 = 0x3f800000;
  const int i2 = 0x3f000000;
  const int k0 = i1 + (int)(x * (i2 - i1));
  union {
    float f;
    int i;
  } k;
  k.i = k0 >= 0x800000 ? k0 : 0;
  return k.f;
}


x86 assembly (clang, -O0):
<dt_fast_mexp2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movl   $0x3f800000,-0x8(%rbp)
movl   $0x3f000000,-0xc(%rbp)
movss  0xee1(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
add    $0x3f800000,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x800000,-0x10(%rbp)
jl     1148 <dt_fast_mexp2f+0x48>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1152 <dt_fast_mexp2f+0x52>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1152 <dt_fast_mexp2f+0x52>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_fast_mexp2f>:
mulss  0xef8(%rip),%xmm0
cvttss2si %xmm0,%eax
lea    0x3f800000(%rax),%ecx
xor    %edx,%edx
cmp    $0xc1000000,%eax
cmovge %ecx,%edx
movd   %edx,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @dt_fast_mexp2f(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %union.anon
store float %0, float* %2
store i32 1065353216, i32* %3
store i32 1056964608, i32* %4
%7 = load float, float* %2
%8 = fmul float %7, 0xC160000000000000
%9 = fptosi float %8 to i32
%10 = add nsw i32 1065353216, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp sge i32 %11, 8388608
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* %5
br label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %13
%17 = phi i32 [ %14, %13 ], [ 0, %15 ]
%18 = bitcast %union.anon* %6 to i32*
store i32 %17, i32* %18
%19 = bitcast %union.anon* %6 to float*
%20 = load float, float* %19
ret float %20
}

LLVM IR (-O2):
define float @dt_fast_mexp2f(float %0) {
%2 = fmul float %0, 0xC160000000000000
%3 = fptosi float %2 to i32
%4 = add nsw i32 %3, 1065353216
%5 = icmp sgt i32 %3, -1056964609
%6 = select i1 %5, i32 %4, i32 0
%7 = bitcast i32 %6 to float
ret float %7
}
void deallocate_dynamic_matrix(int **matrix, int row) {
  int i;
  for (i = 0; i < row; ++i)
    free(matrix[i]);
  free(matrix);
}


x86 assembly (clang, -O0):
<deallocate_dynamic_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <deallocate_dynamic_matrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <deallocate_dynamic_matrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deallocate_dynamic_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <deallocate_dynamic_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <deallocate_dynamic_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @deallocate_dynamic_matrix(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32**, i32*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %11, i64 %13
%15 = load i32*, i32** %14
%16 = bitcast i32* %15 to i8*
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load i32**, i32*** %3
%22 = bitcast i32** %21 to i8*
ret void
}

LLVM IR (-O2):
define void @deallocate_dynamic_matrix(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
void dummy_deinit_stream(struct bladerf_stream *stream) { return; }


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

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

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

LLVM IR (-O2):
%struct.bladerf_stream = type opaque
define void @dummy_deinit_stream(%struct.bladerf_stream* nocapture %0) {
ret void
}
/* Variables and functions */
double floor(double);
double solve_quadratic(double, double, int);
int is_pentagonal(int p) {
  double n = solve_quadratic(1.5, -0.5, -p);
  return (n == floor(n));
}


x86 assembly (clang, -O0):
<is_pentagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
sub    -0x4(%rbp),%edi
movsd  0xec8(%rip),%xmm0
movsd  0xec8(%rip),%xmm1
call   1030 <solve_quadratic@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pentagonal>:
push   %rax
neg    %edi
movsd  0xed5(%rip),%xmm0
movsd  0xed5(%rip),%xmm1
call   1030 <solve_quadratic@plt>
movsd  %xmm0,(%rsp)
call   1040 <floor@plt>
cmpeqsd (%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_pentagonal(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = call double @solve_quadratic(double 1.500000e+00, double -5.000000e-01, i32 %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = call double @llvm.floor.f64(double %8)
%10 = fcmp oeq double %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_pentagonal(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = tail call double @solve_quadratic(double 1.500000e+00, double -5.000000e-01, i32 %2)
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fcmp oeq double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ longjump(int);
int /*<<< orphan*/ printf(char *);
int C(void) {
  printf("enter C\n");
  printf("long jump? (y|n) ");
  if (getchar() == 'y')
    longjump(12345);
  printf("exit C\n");
}


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0x79,%eax
jne    116d <C+0x3d>
mov    $0x3039,%edi
call   1050 <longjump@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
push   %rax
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x79,%al
jne    116e <C+0x2e>
mov    $0x3039,%edi
call   1060 <longjump@plt>
lea    0xea5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"enter C\0A\00"
@.str.1 = [18 x i8] c"long jump? (y|n) \00"
@.str.2 = [8 x i8] c"exit C\0A\00"
define i32 @C() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 121
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @longjump(i32 12345)
br label %9
9: ; preds = %7, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"long jump? (y|n) \00"
@str = [8 x i8] c"enter C\00"
@str.3 = [7 x i8] c"exit C\00"
define i32 @C() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 121
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @longjump(i32 12345)
br label %7
7: ; preds = %5, %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
ret i32 undef
}
int logor_funktion(int var1, int var2) { return (var1 < 2 || 4 < var2); }


x86 assembly (clang, -O0):
<logor_funktion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1127 <logor_funktion+0x27>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logor_funktion>:
cmp    $0x2,%edi
setl   %al
cmp    $0x5,%esi
setge  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @logor_funktion(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 4, %8
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @logor_funktion(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 2
%4 = icmp sgt i32 %1, 4
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dd_div(double *, double *, double *);
int /*<<< orphan*/ dd_log(double const *, double *);
void dd_log10(const double *a, double *b) {
  const double log10hi = 2.302585092994045901e+00;
  const double log10lo = -2.170756223382249351e-16;
  double logten[2];
  logten[0] = log10hi;
  logten[1] = log10lo;
  dd_log(a, b);
  dd_div(b, logten, b);
}


x86 assembly (clang, -O0):
<dd_log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <dd_log@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <dd_div@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_log10>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
call   1030 <dd_log@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %rbx,%rdx
call   1040 <dd_div@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @dd_log10(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca [2 x double]
store double* %0, double** %3
store double* %1, double** %4
store double 0x40026BB1BBB55516, double* %5
store double 0xBCAF48AD494EA3E9, double* %6
%8 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
store double 0x40026BB1BBB55516, double* %8
%9 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 1
store double 0xBCAF48AD494EA3E9, double* %9
%10 = load double*, double** %3
%11 = load double*, double** %4
%12 = call i32 @dd_log(double* %10, double* %11)
%13 = load double*, double** %4
%14 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%15 = load double*, double** %4
%16 = call i32 @dd_div(double* %13, double* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @dd_log10(double* %0, double* %1) {
%3 = alloca <2 x double>
%4 = bitcast <2 x double>* %3 to i8*
%5 = getelementptr inbounds <2 x double>, <2 x double>* %3, i64 0, i64 0
store <2 x double> <double 0x40026BB1BBB55516, double 0xBCAF48AD494EA3E9>, <2 x double>* %3
%6 = tail call i32 @dd_log(double* %0, double* %1)
%7 = call i32 @dd_div(double* %1, double* %5, double* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void progExecuteCLS(void *vp) { system("clear"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
define void @progExecuteCLS(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @progExecuteCLS(i8* nocapture readnone %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void debug_led(int state) {
  volatile long *p = (void *)0xc0220084;
  if (state)
    p[0] = 0x46;
  else
    p[0] = 0x44;
}


x86 assembly (clang, -O0):
<debug_led>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xc0220084,%eax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <debug_led+0x2a>
mov    -0x10(%rbp),%rax
movq   $0x46,(%rax)
jmp    1135 <debug_led+0x35>
mov    -0x10(%rbp),%rax
movq   $0x44,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_led>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
add    %rax,%rax
add    $0x44,%rax
mov    $0xc0220084,%ecx
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @debug_led(i32 %0) {
%2 = alloca i32
%3 = alloca i64*
store i32 %0, i32* %2
store i64* inttoptr (i64 3223453828 to i64*), i64** %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
store volatile i64 70, i64* %8
br label %12
9: ; preds = %1
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 0
store volatile i64 68, i64* %11
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
define void @debug_led(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i64 68, i64 70
store volatile i64 %3, i64* inttoptr (i64 3223453828 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char string[10];
  scanf("%s", &string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rsi
lea    0xedd(%rip),%rdi
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0xe(%rsp),%rsi
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8**
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = bitcast [10 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void file_limit_handler(int signo) { printf("catch %d\n", signo); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"catch %d\0A\00"
define void @file_limit_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t _buffer_new_realloc_size(size_t from, size_t to) {
  assert(from < to);
  size_t size = from;
  while (size < to) {
    size *= 2;
    if (size < from) {
      size = to;
    }
  }
  return size;
}


x86 assembly (clang, -O0):
<_buffer_new_realloc_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1172 <_buffer_new_realloc_size+0x62>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    116d <_buffer_new_realloc_size+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    113d <_buffer_new_realloc_size+0x2d>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_buffer_new_realloc_size>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    %rsi,%r14
setb   %dil
call   1030 <assert@plt>
cmp    %rbx,%r14
jae    1141 <_buffer_new_realloc_size+0x31>
mov    %r14,%rax
add    %rax,%rax
cmp    %r14,%rax
cmovb  %rbx,%rax
cmp    %rbx,%rax
jb     1130 <_buffer_new_realloc_size+0x20>
jmp    1144 <_buffer_new_realloc_size+0x34>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @_buffer_new_realloc_size(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
br i1 %3, label %6, label %12
6: ; preds = %2, %6
%7 = phi i64 [ %10, %6 ], [ %0, %2 ]
%8 = shl i64 %7, 1
%9 = icmp ult i64 %8, %0
%10 = select i1 %9, i64 %1, i64 %8
%11 = icmp ult i64 %10, %1
br i1 %11, label %6, label %12
12: ; preds = %6, %2
%13 = phi i64 [ %0, %2 ], [ %10, %6 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ malloc(int);
int main() {
  int *x = (int *)malloc(sizeof(int));
  assert(x != NULL);
  *x = 5;
  assert(*x == 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x5,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
movl   $0x5,(%rbx)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %2
store i32 5, i32* %9
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 5
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = icmp ne i64 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
store i32 5, i32* %2
%6 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ioline_defer_close() {
  printf("NOT IMPLEMENTED:"
         "pa_ioline_defer_close"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_ioline_defer_close\0A\00"
define i32 @pa_ioline_defer_close() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_ioline_defer_close\00"
define i32 @pa_ioline_defer_close() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Running ps with execlp\n");
  execlp("ps", "ps", "ax", 0);
  printf("Done.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rsi
lea    0xec2(%rip),%rdx
xor    %ecx,%ecx
mov    %rsi,%rdi
call   1050 <execlp@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0xeb8(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1050 <execlp@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Running ps with execlp\0A\00"
@.str.1 = [3 x i8] c"ps\00"
@.str.2 = [3 x i8] c"ax\00"
@.str.3 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"ps\00"
@.str.2 = [3 x i8] c"ax\00"
@str = [23 x i8] c"Running ps with execlp\00"
@str.4 = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
int foo(int a) {
  int t;
  *(volatile int *)&t = a;
}


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

x86 assembly (clang, -O2):
<foo>:
mov    %edi,-0x4(%rsp)
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 %0, i32* %2
ret i32 undef
}
/* Type definitions */
struct student {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct student *);
void deallocate(struct student *stud) {
  if (stud != 0)
    free(stud);
}


x86 assembly (clang, -O0):
<deallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <deallocate+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deallocate>:
test   %rdi,%rdi
je     111a <deallocate+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.student = type { i32 }
define void @deallocate(%struct.student* %0) {
%2 = alloca %struct.student*
store %struct.student* %0, %struct.student** %2
%3 = load %struct.student*, %struct.student** %2
%4 = icmp ne %struct.student* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.student*, %struct.student** %2
%7 = call i32 @free(%struct.student* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.student = type { i32 }
define void @deallocate(%struct.student* %0) {
%2 = icmp eq %struct.student* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.student* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int import();
int func2(void) { return import(); }


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

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

LLVM IR (-O0):
define i32 @func2() {
%1 = call i32 (...) @import()
ret i32 %1
}

LLVM IR (-O2):
define i32 @func2() {
%1 = tail call i32 (...) @import()
ret i32 %1
}
/* Variables and functions */
int ack(int, int);
int printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int a, b, r;
  r = scanf("%d %d", &a, &b);
  r = printf("%d", ack(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ack@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <ack@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <Xfgetc@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xd,%eax
jne    1136 <fgetc+0x26>
jmp    111b <fgetc+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <Xfgetc@plt>
cmp    $0xd,%eax
je     1120 <fgetc+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fgetc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @Xfgetc to i32 (i32, ...)*)(i32 %5)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, 13
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @fgetc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @Xfgetc to i32 (i32, ...)*)(i32 %0)
%4 = icmp eq i32 %3, 13
br i1 %4, label %2, label %5
5: ; preds = %2
ret i32 %3
}