xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void alarm_handler(int signal) { printf("alarm\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"alarm\00"
define void @alarm_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Sorry, this program wasn't compiled with PTHREADS defined.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"Sorry, this program wasn't compiled with PTHREADS defined.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [59 x i8] c"Sorry, this program wasn't compiled with PTHREADS defined.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ port_reset();
int /*<<< orphan*/ puts(char const *);
void errexit(const char *a, int error_code) {
  ;
  port_reset();
  puts("");
  if (a != NULL)
    puts(a);
  else
    puts("An unknown error occured.");
  exit(error_code);
}


x86 assembly (clang, -O0):
<errexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <port_reset@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
cmpq   $0x0,-0x8(%rbp)
je     116b <errexit+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
jmp    1177 <errexit+0x47>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<errexit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <port_reset@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %rbx,%rbx
jne    1167 <errexit+0x27>
lea    0xe9b(%rip),%rdi
jmp    116a <errexit+0x2a>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [26 x i8] c"An unknown error occured.\00"
define void @errexit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @port_reset()
%6 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @puts(i8* %10)
br label %14
12: ; preds = %2
%13 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %4
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"An unknown error occured.\00"
define void @errexit(i8* %0, i32 %1) {
%3 = tail call i32 (...) @port_reset()
%4 = tail call i32 @putchar(i32 10)
%5 = icmp eq i8* %0, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* %0)
br label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = tail call i32 @exit(i32 %1)
unreachable
}
int FuncaoASerUsada(void *lhs, void *rhs) {
  unsigned int a = *((unsigned int *)lhs);
  unsigned int b = *((unsigned int *)rhs);
  return (b - a);
}


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

x86 assembly (clang, -O2):
<FuncaoASerUsada>:
mov    (%rsi),%eax
sub    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @FuncaoASerUsada(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = sub i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @FuncaoASerUsada(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub i32 %6, %4
ret i32 %7
}
int compare(const void *a, const void *b) {
  float *pa = (float *)a, *pb = (float *)b;
  return *pa - *pb;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
subss  (%rax),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float*
%6 = alloca float*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
store float* %8, float** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to float*
store float* %10, float** %6
%11 = load float*, float** %5
%12 = load float, float* %11
%13 = load float*, float** %6
%14 = load float, float* %13
%15 = fsub float %12, %14
%16 = fptosi float %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = fptosi float %7 to i32
ret i32 %8
}
int main(int argc, char *argv[]) {
  char name[4] = {'A'};
  int *name_int = &name;
  printf("%d\n", *name_int);
  return 0;
}


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)
mov    0xed4(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
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    $0x41,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.name = [4 x i8] c"A\00\00\00"
@.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 [4 x i8]
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [4 x i8]* %6 to i8*
%9 = bitcast [4 x i8]* %6 to i32*
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 65)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void this_seems_bad(char *input) {
  char buf[64];
  strcpy(buf, input);
  printf("Phew, we're okay here.\n");
}


x86 assembly (clang, -O0):
<this_seems_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<this_seems_bad>:
sub    $0x48,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Phew, we're okay here.\0A\00"
define void @this_seems_bad(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Phew, we're okay here.\00"
define void @this_seems_bad(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
void gtk_editable_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_editable_get_type() {
ret void
}
int tdefault_insert_hw_breakpoint(struct target_ops *self, struct gdbarch *arg1,
                                  struct bp_target_info *arg2) {
  return -1;
}


x86 assembly (clang, -O0):
<tdefault_insert_hw_breakpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.target_ops = type opaque
%struct.gdbarch = type opaque
%struct.bp_target_info = type opaque
define i32 @tdefault_insert_hw_breakpoint(%struct.target_ops* %0, %struct.gdbarch* %1, %struct.bp_target_info* %2) {
%4 = alloca %struct.target_ops*
%5 = alloca %struct.gdbarch*
%6 = alloca %struct.bp_target_info*
store %struct.target_ops* %0, %struct.target_ops** %4
store %struct.gdbarch* %1, %struct.gdbarch** %5
store %struct.bp_target_info* %2, %struct.bp_target_info** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.target_ops = type opaque
%struct.gdbarch = type opaque
%struct.bp_target_info = type opaque
define i32 @tdefault_insert_hw_breakpoint(%struct.target_ops* nocapture readnone %0, %struct.gdbarch* nocapture readnone %1, %struct.bp_target_info* nocapture readnone %2) {
ret i32 -1
}
void INT_Excep_PDC_PCERI(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PDC_PCERI() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int w;
  scanf("%d", &w);
  if (w == 2)
    printf("NO\n");
  else if ((w % 2) == 0)
    printf("YES\n");
  else
    printf("NO\n");
  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
call   1040 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <main+0x70>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117f <main+0x5f>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    118b <main+0x6b>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <main+0x70>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   $0x1,%al
lea    0xec4(%rip),%rdi
lea    0xec1(%rip),%rcx
cmovne %rcx,%rdi
cmp    $0x2,%eax
cmove  %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"NO\0A\00"
@.str.2 = [5 x i8] c"YES\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %17
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %16
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
br label %17
17: ; preds = %16, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str.3 = [4 x i8] c"YES\00"
@str.4 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 2
%6 = and i32 %4, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0)
%9 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0), i8* %8
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ goHome();
int /*<<< orphan*/ stderr;
void cd(char *directory) {
  if (directory == NULL) {
    goHome();
    return;
  }
  if (chdir(directory) == -1) {
    fprintf(
        stderr,
        "Unable to go to directory %s. Attempting to go to HOME directory\n",
        directory);
    goHome();
  }
}


x86 assembly (clang, -O0):
<cd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <cd+0x23>
mov    $0x0,%al
call   1040 <goHome@plt>
jmp    1185 <cd+0x55>
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
jne    1185 <cd+0x55>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1040 <goHome@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd>:
push   %rbx
test   %rdi,%rdi
je     115d <cd+0x2d>
mov    %rdi,%rbx
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
je     1145 <cd+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <goHome@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"Unable to go to directory %s. Attempting to go to HOME directory\0A\00"
define void @cd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @goHome()
br label %16
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @chdir(i8* %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %2
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 (...) @goHome()
br label %16
16: ; preds = %5, %11, %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"Unable to go to directory %s. Attempting to go to HOME directory\0A\00"
define void @cd(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @chdir(i8* %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %1, %6
%10 = tail call i32 (...) @goHome()
br label %11
11: ; preds = %9, %3
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int cmpdefault(const void *x, const void *y) {
  return strcmp((char *)x, (char *)y);
}


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

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

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

LLVM IR (-O2):
define i32 @cmpdefault(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
clock_t outside_times(struct tms *buf) { return times(buf); }


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

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

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @outside_times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load %struct.tms*, %struct.tms** %2
%4 = call i32 @times(%struct.tms* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @outside_times(%struct.tms* nocapture %0) {
%2 = tail call i32 @times(%struct.tms* %0)
ret i32 %2
}
/* Variables and functions */
int ERR_isError(size_t);
unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }


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

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

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

LLVM IR (-O2):
define i32 @ZSTD_isError(i64 %0) {
%2 = tail call i32 @ERR_isError(i64 %0)
ret i32 %2
}
void trace_log(const char *const format, ...) { (void)format; }


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

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

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

LLVM IR (-O2):
define void @trace_log(i8* nocapture %0, ...) {
ret void
}
void q6audio_set_acdb_file(char *filename) {}


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

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

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

LLVM IR (-O2):
define void @q6audio_set_acdb_file(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__2__GeneralIO__makeOutput();
void LedsP__Led2__makeOutput(void) { Msp430GpioC__2__GeneralIO__makeOutput(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__2__GeneralIO__makeOutput()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fputc(unsigned int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void MarkFileAsDucked(FILE *target) {
  unsigned int signatures[4] = {0x0A, 0xA0, 0x5A, 0x95};
  fseek(target, 0, SEEK_SET);
  int i;
  for (i = 0; i < 4; i++) {
    fputc(signatures[i], target);
  }
}


x86 assembly (clang, -O0):
<MarkFileAsDucked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    1186 <MarkFileAsDucked+0x66>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115d <MarkFileAsDucked+0x3d>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MarkFileAsDucked>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0xa0,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x5a,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x95,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@__const.MarkFileAsDucked.signatures = [4 x i32] [i32 10, i32 160, i32 90, i32 149]
@SEEK_SET = global i32 0
define void @MarkFileAsDucked(i32* %0) {
%2 = alloca i32*
%3 = alloca [4 x i32]
%4 = alloca i32
store i32* %0, i32** %2
%5 = bitcast [4 x i32]* %3 to i8*
%6 = load i32*, i32** %2
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @fseek(i32* %6, i32 0, i32 %7)
store i32 0, i32* %4
br label %9
9: ; preds = %19, %1
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %2
%18 = call i32 @fputc(i32 %16, i32* %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %9
22: ; preds = %9
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @MarkFileAsDucked(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 @fputc(i32 10, i32* %0)
%5 = tail call i32 @fputc(i32 160, i32* %0)
%6 = tail call i32 @fputc(i32 90, i32* %0)
%7 = tail call i32 @fputc(i32 149, i32* %0)
ret void
}
int f(long long a, int b) {
  int c = a == 0;
  return c + b;
}


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

x86 assembly (clang, -O2):
<f>:
mov    %esi,%eax
cmp    $0x1,%rdi
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @f(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f(i64 %0, i32 %1) {
%3 = icmp eq i64 %0, 0
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Type definitions */
struct hash_struct {
  int dummy;
};

/* Variables and functions */
int hash_init_sz(struct hash_struct *, int);
int hash_init(struct hash_struct *table) { return hash_init_sz(table, 8); }


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

x86 assembly (clang, -O2):
<hash_init>:
mov    $0x8,%esi
jmp    1030 <hash_init_sz@plt>

LLVM IR (-O0):
%struct.hash_struct = type { i32 }
define i32 @hash_init(%struct.hash_struct* %0) {
%2 = alloca %struct.hash_struct*
store %struct.hash_struct* %0, %struct.hash_struct** %2
%3 = load %struct.hash_struct*, %struct.hash_struct** %2
%4 = call i32 @hash_init_sz(%struct.hash_struct* %3, i32 8)
ret i32 %4
}

LLVM IR (-O2):
%struct.hash_struct = type { i32 }
define i32 @hash_init(%struct.hash_struct* %0) {
%2 = tail call i32 @hash_init_sz(%struct.hash_struct* %0, i32 8)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void UARTDMADisable(uint32_t ui32Base, uint32_t ui32DMAFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000048))) &= ~ui32DMAFlags;
}


x86 assembly (clang, -O0):
<UARTDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x48(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMADisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x48(%rcx)
ret

LLVM IR (-O0):
define void @UARTDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 72
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @UARTDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 72
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Variables and functions */
int S_IRGRP;
int S_IRWXU;
int S_IXGRP;
scalar_t__ mkdir(char *, int);
int DirCreate(char *path) {
  if (mkdir(path, S_IRWXU | S_IRGRP | S_IXGRP) == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<DirCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
mov    0x2ea7(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
jne    1156 <DirCreate+0x46>
movl   $0x1,-0x4(%rbp)
jmp    115d <DirCreate+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DirCreate>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eb6(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@S_IRWXU = global i32 0
@S_IRGRP = global i32 0
@S_IXGRP = global i32 0
define i32 @DirCreate(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @S_IRWXU
%6 = load i32, i32* @S_IRGRP
%7 = or i32 %5, %6
%8 = load i32, i32* @S_IXGRP
%9 = or i32 %7, %8
%10 = call i64 @mkdir(i8* %4, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@S_IRGRP = global i32 0
@S_IXGRP = global i32 0
define i32 @DirCreate(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = load i32, i32* @S_IRGRP
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IXGRP
%6 = or i32 %4, %5
%7 = tail call i64 @mkdir(i8* %0, i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fork_test_sigchld_ignored();
int /*<<< orphan*/ fork_test_signal();
int /*<<< orphan*/ fork_test_wait();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Testing fork/wait.\n");
  fork_test_wait();
  fork_test_signal();
  fork_test_sigchld_ignored();
  printf("Success!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <fork_test_wait@plt>
mov    $0x0,%al
call   1060 <fork_test_signal@plt>
mov    $0x0,%al
call   1050 <fork_test_sigchld_ignored@plt>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <fork_test_wait@plt>
xor    %eax,%eax
call   1060 <fork_test_signal@plt>
xor    %eax,%eax
call   1050 <fork_test_sigchld_ignored@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Testing fork/wait.\0A\00"
@.str.1 = [10 x i8] c"Success!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @fork_test_wait()
%4 = call i32 (...) @fork_test_signal()
%5 = call i32 (...) @fork_test_sigchld_ignored()
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Testing fork/wait.\00"
@str.2 = [9 x i8] c"Success!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fork_test_wait()
%3 = tail call i32 (...) @fork_test_signal()
%4 = tail call i32 (...) @fork_test_sigchld_ignored()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int pathcon_nm2_f0(double const **, double **, int *, double *, int);
int pathcon_nm2(const double **arg, double **res, int *iw, double *w, int mem) {
  return pathcon_nm2_f0(arg, res, iw, w, mem);
}


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

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

LLVM IR (-O0):
define i32 @pathcon_nm2(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @pathcon_nm2_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @pathcon_nm2(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @pathcon_nm2_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
char *strchr(char const *, char);
int strpos(const char *str, char what) {
  const char *p = strchr(str, what);
  if (!p)
    return -1;
  return (int)(p - str);
}


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114a <strpos+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <strpos+0x48>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @strpos(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = call i8* @strchr(i8* %7, i8 signext %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @strpos(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_uint32(uint32_t n) { printf("%u", n); }


x86 assembly (clang, -O0):
<print_uint32>:
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):
<print_uint32>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define void @print_uint32(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ __sclearerr(int /*<<< orphan*/ *);
void clearerr(FILE *fp) {
  _DIAGASSERT(fp != NULL);
  ;
  __sclearerr(fp);
  ;
}


x86 assembly (clang, -O0):
<clearerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1030 <__sclearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearerr>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <_DIAGASSERT@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__sclearerr@plt>

LLVM IR (-O0):
define void @clearerr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @_DIAGASSERT(i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @__sclearerr(i32* %7)
ret void
}

LLVM IR (-O2):
define void @clearerr(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @_DIAGASSERT(i32 %3)
%5 = tail call i32 @__sclearerr(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ReverseHelper(char *, char *);
size_t strlen(char *);
int Reverse(char *s) {
  if (!s) {
    return 1;
  }
  size_t len = strlen(s);
  ReverseHelper(&s[0], &s[len]);
  return 0;
}


x86 assembly (clang, -O0):
<Reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <Reverse+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1168 <Reverse+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    -0x18(%rbp),%rsi
call   1040 <ReverseHelper@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reverse>:
test   %rdi,%rdi
je     113e <Reverse+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    (%rax,%rbx,1),%rsi
mov    %rbx,%rdi
call   1040 <ReverseHelper@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @Reverse(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @ReverseHelper(i8* %0, i8* %5)
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %8
}
int Dprintf(char *format, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Dprintf(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printN1(int);
int /*<<< orphan*/ printN2(int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d", &n);
  printN1(n);
  printN2(n);
  return 0;
}


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)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <printN1@plt>
mov    -0x14(%rbp),%edi
call   1030 <printN2@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\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
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = call i32 @printN1(i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @printN2(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printN1(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @printN2(i32 %8)
ret i32 0
}
/* Variables and functions */
int find_rudolph(int *, int);
int /*<<< orphan*/ null_array(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number_deers;
  int deers[100];
  null_array(deers);
  scanf("%d", &number_deers);
  printf("%d\n", find_rudolph(deers, number_deers));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
call   1030 <null_array@plt>
lea    0xe9b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <find_rudolph@plt>
mov    %eax,%esi
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1a0,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <null_array@plt>
lea    0xea4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1050 <find_rudolph@plt>
lea    0xe8a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [100 x i32]* %2 to i8*
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%6 = call i32 @null_array(i32* %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = call i32 @find_rudolph(i32* %5, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
char *strrchr(char *, char);
char *basename(char *name) {
  char *c = strrchr(name, '/');
  if (c) {
    return (c + 1);
  } else {
    return (name);
  }
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <basename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <basename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
scalar_t__ pow(double, float);
float mw2dbm(float in) { return ((float)pow(10.0, in / 10.0)); }


x86 assembly (clang, -O0):
<mw2dbm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
call   1030 <pow@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mw2dbm>:
push   %rax
movaps %xmm0,%xmm1
divss  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mw2dbm(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 1.000000e+01
%6 = fptrunc double %5 to float
%7 = call i64 @pow(double 1.000000e+01, float %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @mw2dbm(float %0) {
%2 = fdiv float %0, 1.000000e+01
%3 = tail call i64 @pow(double 1.000000e+01, float %2)
%4 = sitofp i64 %3 to float
ret float %4
}
phex(val) {
  int i;
  printf("%04x", val);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%04x\00"
define i32 @phex(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}