xunge/DecIR huggingface dataset:
void exit_thread(void) {}


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

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

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

LLVM IR (-O2):
define void @exit_thread() {
ret void
}
/* Variables and functions */
int debug_active_process();
int debug_dmt_pid(int);
int /*<<< orphan*/ printf(char *);
int debug_display_dmt() {
  int pid = debug_active_process();
  if (pid > -1)
    return debug_dmt_pid(pid);
  printf("No active processes.\n");
  return 0;
}


x86 assembly (clang, -O0):
<debug_display_dmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <debug_active_process@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jle    115c <debug_display_dmt+0x2c>
mov    -0x8(%rbp),%edi
call   1050 <debug_dmt_pid@plt>
mov    %eax,-0x4(%rbp)
jmp    116f <debug_display_dmt+0x3f>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_display_dmt>:
push   %rax
xor    %eax,%eax
call   1040 <debug_active_process@plt>
test   %eax,%eax
js     1144 <debug_display_dmt+0x14>
mov    %eax,%edi
pop    %rax
jmp    1050 <debug_dmt_pid@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"No active processes.\0A\00"
define i32 @debug_display_dmt() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @debug_active_process()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @debug_dmt_pid(i32 %7)
store i32 %8, i32* %1
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@str = [21 x i8] c"No active processes.\00"
define i32 @debug_display_dmt() {
%1 = tail call i32 (...) @debug_active_process()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @debug_dmt_pid(i32 %1)
br label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ 0, %5 ]
ret i32 %8
}
char *numstr_to_pad0(char *s) {
  char *r = s;
  if (s) {
    while (*s == ' ')
      *s++ = '0';
    if (*s == '-') {
      *s = '0';
      *r = '-';
    }
  }
  return r;
}


x86 assembly (clang, -O0):
<numstr_to_pad0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116a <numstr_to_pad0+0x6a>
jmp    1120 <numstr_to_pad0+0x20>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1147 <numstr_to_pad0+0x47>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x30,(%rax)
jmp    1120 <numstr_to_pad0+0x20>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1165 <numstr_to_pad0+0x65>
mov    -0x8(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2d,(%rax)
jmp    116a <numstr_to_pad0+0x6a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numstr_to_pad0>:
mov    %rdi,%rax
test   %rdi,%rdi
je     112c <numstr_to_pad0+0x2c>
mov    %rax,%rcx
nopl   0x0(%rax,%rax,1)
movzbl (%rcx),%edx
cmp    $0x20,%dl
jne    1121 <numstr_to_pad0+0x21>
movb   $0x30,(%rcx)
add    $0x1,%rcx
jmp    1110 <numstr_to_pad0+0x10>
cmp    $0x2d,%dl
jne    112c <numstr_to_pad0+0x2c>
movb   $0x30,(%rcx)
movb   $0x2d,(%rax)
ret

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

LLVM IR (-O2):
define i8* @numstr_to_pad0(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 32, label %6
i8 45, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 48, i8* %4
br label %3
8: ; preds = %3
store i8 48, i8* %4
store i8 45, i8* %0
br label %9
9: ; preds = %3, %8, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("main");
  foo();
  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    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"main\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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sla_evp(double *, double *, double *, double *, double *,
                           double *);
void csla_evp(double date, double deqx, double dvb[3], double dpb[3],
              double dvh[3], double dph[3]) {
  sla_evp(&date, &deqx, dvb, dpb, dvh, dph);
}


x86 assembly (clang, -O0):
<csla_evp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <sla_evp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csla_evp>:
sub    $0x18,%rsp
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <sla_evp@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @csla_evp(double %0, double %1, double* %2, double* %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
store double %0, double* %7
store double %1, double* %8
%9 = call i32 @sla_evp(double* %7, double* %8, double* %2, double* %3, double* %4, double* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
scalar_t__ pthread_self();
int /*<<< orphan*/ sleep(int);
void *task(void *arg) {
  int task_id = (int)arg;
  printf("START TASK %d BY THREAD #%u\n", task_id,
         (unsigned int)pthread_self());
  sleep(1);
  printf("FINISH TASK %d.\n", task_id);
  return NULL;
}


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xebe(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xebf(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"START TASK %d BY THREAD #%u\0A\00"
@.str.1 = [17 x i8] c"FINISH TASK %d.\0A\00"
define i8* @task(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i64 (...) @pthread_self()
%8 = trunc i64 %7 to i32
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
%10 = call i32 @sleep(i32 1)
%11 = load i32, i32* %3
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i8* null
}

LLVM IR (-O2):
@.str = [29 x i8] c"START TASK %d BY THREAD #%u\0A\00"
@.str.1 = [17 x i8] c"FINISH TASK %d.\0A\00"
define noalias i8* @task(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ BFS_run();
int /*<<< orphan*/ graph_initiator();
int /*<<< orphan*/ printf(char *);
int main() {
  graph_initiator();
  BFS_run();
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <graph_initiator@plt>
mov    $0x0,%al
call   1050 <BFS_run@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <graph_initiator@plt>
xor    %eax,%eax
call   1050 <BFS_run@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @graph_initiator()
%2 = tail call i32 (...) @BFS_run()
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pgfunx_(float (*)(), int *, float *, float *, int *);
cpgfunx(float pgfun1(), int n, float xmin, float xmax, int pgflag) {
  pgfunx_(pgfun1, &n, &xmin, &xmax, &pgflag);
}


x86 assembly (clang, -O0):
<cpgfunx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movss  %xmm0,-0x18(%rbp)
movss  %xmm1,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1030 <pgfunx_@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpgfunx>:
sub    $0x18,%rsp
mov    %esi,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
mov    %edx,0x8(%rsp)
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <pgfunx_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpgfunx(float (...)* %0, i32 %1, float %2, float %3, i32 %4) {
%6 = alloca i32
%7 = alloca float (...)*
%8 = alloca i32
%9 = alloca float
%10 = alloca float
%11 = alloca i32
store float (...)* %0, float (...)** %7
store i32 %1, i32* %8
store float %2, float* %9
store float %3, float* %10
store i32 %4, i32* %11
%12 = load float (...)*, float (...)** %7
%13 = call i32 @pgfunx_(float (...)* %12, i32* %8, float* %9, float* %10, i32* %11)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @cpgfunx(float (...)* %0, i32 %1, float %2, float %3, i32 %4) {
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store i32 %1, i32* %6
store float %2, float* %7
store float %3, float* %8
store i32 %4, i32* %9
%10 = call i32 @pgfunx_(float (...)* %0, i32* %6, float* %7, float* %8, i32* %9)
ret i32 undef
}
int iora_buffer_save_record(int filno, int record_num) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @iora_buffer_save_record(i32 %0, i32 %1) {
ret i32 0
}
int termios_tcflowoffo(int fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @termios_tcflowoffo(i32 %0) {
ret i32 1
}
/* Variables and functions */
int pack_length_bits(int);
int pack_offset_bits(int, int);
int pack_bits(int length, int offset) {
  return pack_length_bits(length) + pack_offset_bits(length, offset);
}


x86 assembly (clang, -O0):
<pack_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pack_length_bits@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <pack_offset_bits@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_bits>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <pack_length_bits@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <pack_offset_bits@plt>
add    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pack_bits(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 = call i32 @pack_length_bits(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @pack_offset_bits(i32 %7, i32 %8)
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @pack_bits(i32 %0, i32 %1) {
%3 = tail call i32 @pack_length_bits(i32 %0)
%4 = tail call i32 @pack_offset_bits(i32 %0, i32 %1)
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int _strnicmp(char const *, char const *, size_t);
int strncasecmp(const char *sz1, const char *sz2, size_t sizeMaxCompare) {
  return _strnicmp(sz1, sz2, sizeMaxCompare);
}


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

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

LLVM IR (-O0):
define i32 @strncasecmp(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @_strnicmp(i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @strncasecmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @_strnicmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
int validate_position(char maze[23][30], int x, int y) {
  if (maze[x][y] == ' ') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<validate_position>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    113a <validate_position+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <validate_position+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_position>:
movslq %esi,%rax
movslq %edx,%rcx
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rax,%rdx
sub    %rax,%rdx
add    %rdi,%rdx
xor    %eax,%eax
cmpb   $0x20,(%rcx,%rdx,1)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @validate_position([30 x i8]* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %0, i64 %4, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 32
%9 = zext i1 %8 to i32
ret i32 %9
}
int func2() { return 42; }


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

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

LLVM IR (-O0):
define i32 @func2() {
ret i32 42
}

LLVM IR (-O2):
define i32 @func2() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ foo02(char);
void bar02() { foo02('a'); }


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

x86 assembly (clang, -O2):
<bar02>:
mov    $0x61,%edi
jmp    1030 <foo02@plt>

LLVM IR (-O0):
define void @bar02() {
%1 = call i32 @foo02(i8 signext 97)
ret void
}

LLVM IR (-O2):
define void @bar02() {
%1 = tail call i32 @foo02(i8 signext 97)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool ts_has_adaptation(const uint8_t *p_ts) { return !!(p_ts[3] & 0x20); }


x86 assembly (clang, -O0):
<ts_has_adaptation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_has_adaptation>:
mov    0xc(%rdi),%eax
shr    $0x5,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ts_has_adaptation(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ts_has_adaptation(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = and i32 %4, 1
ret i32 %5
}
int main(int argc, char *argv[]) {
  signed char f2 = 7;
  signed char l_1857 = ((0xFFBD4A17L && f2) | f2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x7,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x11(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0x12(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8 7, i8* %5
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
double distanceS(double x, double y, double z, double xc, double yc,
                 double zc) {
  return (x - xc) * (x - xc) + (y - yc) * (y - yc) + (z - zc) * (z - zc);
}


x86 assembly (clang, -O0):
<distanceS>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm3
subsd  -0x28(%rbp),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distanceS>:
subsd  %xmm3,%xmm0
subsd  %xmm4,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm5,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @distanceS(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %10
%15 = fsub double %13, %14
%16 = load double, double* %7
%17 = load double, double* %10
%18 = fsub double %16, %17
%19 = load double, double* %8
%20 = load double, double* %11
%21 = fsub double %19, %20
%22 = load double, double* %8
%23 = load double, double* %11
%24 = fsub double %22, %23
%25 = fmul double %21, %24
%26 = call double @llvm.fmuladd.f64(double %15, double %18, double %25)
%27 = load double, double* %9
%28 = load double, double* %12
%29 = fsub double %27, %28
%30 = load double, double* %9
%31 = load double, double* %12
%32 = fsub double %30, %31
%33 = call double @llvm.fmuladd.f64(double %29, double %32, double %26)
ret double %33
}

LLVM IR (-O2):
define double @distanceS(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %0, %3
%8 = fsub double %1, %4
%9 = fmul double %8, %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %9)
%11 = fsub double %2, %5
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %10)
ret double %12
}
int main() {
  printf(3);
  printf("BAR");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"BAR\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 3 to i8*))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void g_signal_handlers_disconnect_matched() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_handlers_disconnect_matched() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void set_brightness(uint8_t *data, uint8_t brightness) {
  data[0] = 0xE0 | brightness;
}


x86 assembly (clang, -O0):
<set_brightness>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
or     $0xe0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_brightness>:
or     $0xe0,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @set_brightness(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = or i32 224, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_brightness(i32* nocapture writeonly %0, i32 %1) {
%3 = or i32 %1, 224
store i32 %3, i32* %0
ret void
}
void ufs_debugfs_hba_exit(struct ufs_hba *hba) {}


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

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

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

LLVM IR (-O2):
%struct.ufs_hba = type opaque
define void @ufs_debugfs_hba_exit(%struct.ufs_hba* nocapture %0) {
ret void
}
_Bool eq_float_rc(float a, float _Complex b) { return a == b; }


x86 assembly (clang, -O0):
<eq_float_rc>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
ucomiss %xmm2,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
sete   %cl
setnp  %dl
and    %dl,%cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_float_rc>:
ucomiss %xmm0,%xmm1
shufps $0x55,%xmm1,%xmm1
setnp  %al
sete   %cl
and    %al,%cl
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
setnp  %dl
sete   %al
and    %dl,%al
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i1 @eq_float_rc(float %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca float
%5 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %1, <2 x float>* %5
store float %0, float* %4
%6 = load float, float* %4
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%10 = load float, float* %9
%11 = fcmp oeq float %6, %8
%12 = fcmp oeq float 0.000000e+00, %10
%13 = and i1 %11, %12
ret i1 %13
}

LLVM IR (-O2):
define zeroext i1 @eq_float_rc(float %0, <2 x float> %1) {
%3 = extractelement <2 x float> %1, i64 0
%4 = extractelement <2 x float> %1, i64 1
%5 = fcmp oeq float %3, %0
%6 = fcmp oeq float %4, 0.000000e+00
%7 = and i1 %5, %6
ret i1 %7
}
/* Variables and functions */
char inb(int);
char get_status() { return inb(0x64); }


x86 assembly (clang, -O0):
<get_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <inb@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_status>:
mov    $0x64,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define signext i8 @get_status() {
%1 = call signext i8 @inb(i32 100)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @get_status() {
%1 = tail call signext i8 @inb(i32 100)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_MediaRenderer_AVTransport_Seek(void *);
int /*<<< orphan*/ printf(char *, unsigned int, char *, char *);
void UpnpMediaRenderer_AVTransport_Seek(void *upnptoken,
                                        unsigned int InstanceID, char *Unit,
                                        char *Target) {
  printf("Invoke: UpnpMediaRenderer_AVTransport_Seek(%u,%s,%s);\r\n",
         InstanceID, Unit, Target);
  UpnpResponse_MediaRenderer_AVTransport_Seek(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpMediaRenderer_AVTransport_Seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_MediaRenderer_AVTransport_Seek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpMediaRenderer_AVTransport_Seek>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_MediaRenderer_AVTransport_Seek@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_Seek(%u,%s,%s);\0D\0A\00"
define void @UpnpMediaRenderer_AVTransport_Seek(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @UpnpResponse_MediaRenderer_AVTransport_Seek(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"Invoke: UpnpMediaRenderer_AVTransport_Seek(%u,%s,%s);\0D\0A\00"
define void @UpnpMediaRenderer_AVTransport_Seek(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i8* %3)
%6 = tail call i32 @UpnpResponse_MediaRenderer_AVTransport_Seek(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nth_prime(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int main() {
  printf("%d -> %lu\n", 10001, nth_prime(10001));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"%d -> %lu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @nth_prime(i32 10001)
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10001, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d -> %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @nth_prime(i32 10001)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10001, i32 %1)
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ die(char *);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double d_clock_gettime() {
  struct timeval t;
  if (gettimeofday(&t, NULL) != 0) {
    die("Cannot get time!");
  }
  return ((t.tv_sec) + ((double)(t.tv_usec)) / (1000 * 1000));
}


x86 assembly (clang, -O0):
<d_clock_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     114b <d_clock_gettime+0x2b>
lea    0xec2(%rip),%rdi
call   1040 <die@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xea2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_clock_gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     1141 <d_clock_gettime+0x21>
lea    0xecc(%rip),%rdi
call   1040 <die@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xeb0(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
@.str = [17 x i8] c"Cannot get time!\00"
define double @d_clock_gettime() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = fdiv double %11, 1.000000e+06
%13 = fadd double %8, %12
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
@.str = [17 x i8] c"Cannot get time!\00"
define double @d_clock_gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = fdiv double %12, 1.000000e+06
%14 = fadd double %9, %13
ret double %14
}
/* Type definitions */
struct fcb {
  int dummy;
};

/* Variables and functions */
int kf7_create_key_ld(struct fcb *, char *, int, int);
int create_key_ld(struct fcb *f, char id[], int fcb_lc, int data_in_index_lc) {
  int err;
  err = kf7_create_key_ld(f, id, fcb_lc, data_in_index_lc);
  return (err);
}


x86 assembly (clang, -O0):
<create_key_ld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <kf7_create_key_ld@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fcb = type { i32 }
define i32 @create_key_ld(%struct.fcb* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.fcb*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.fcb* %0, %struct.fcb** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load %struct.fcb*, %struct.fcb** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @kf7_create_key_ld(%struct.fcb* %10, i8* %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.fcb = type { i32 }
define i32 @create_key_ld(%struct.fcb* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @kf7_create_key_ld(%struct.fcb* %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
char *luaI_malloc(int);
char *LoadBlock(int size, FILE *D) {
  char *b = luaI_malloc(size);
  fread(b, size, 1, D);
  return b;
}


x86 assembly (clang, -O0):
<LoadBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <luaI_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadBlock>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1040 <luaI_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @LoadBlock(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = call i8* @luaI_malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = call i32 @fread(i8* %8, i32 %9, i32 1, i32* %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @LoadBlock(i32 %0, i32* nocapture %1) {
%3 = tail call i8* @luaI_malloc(i32 %0)
%4 = tail call i32 @fread(i8* %3, i32 %0, i32 1, i32* %1)
ret i8* %3
}
int insertarEnPos(int *v, int pos, int dato) {
  if (pos <= 100) {
    *(v + pos - 1) = dato;
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<insertarEnPos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1133 <insertarEnPos+0x33>
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,-0x4(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
jmp    113a <insertarEnPos+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertarEnPos>:
xor    %eax,%eax
cmp    $0x64,%esi
jg     1113 <insertarEnPos+0x13>
movslq %esi,%rax
mov    %edx,-0x4(%rdi,%rax,4)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @insertarEnPos(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 101
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = getelementptr inbounds i32, i32* %7, i64 -1
store i32 %2, i32* %8
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ 1, %5 ], [ 0, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
unsigned int le8get(void *p, uint8_t *v) {
  uint8_t *a;
  a = p;
  *v = a[0];
  return 1;
}


x86 assembly (clang, -O0):
<le8get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @le8get(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
store i32 %4, i32* %1
ret i32 1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_quaddobl_t_value(double *tval) {
  int fail;
  int precision = 2;
  int *b;
  fail = _ada_use_c2phc4c(867, &precision, b, tval, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_quaddobl_t_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x363,%edi
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_quaddobl_t_value>:
push   %rax
mov    %rdi,%rcx
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x363,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_get_quaddobl_t_value(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store double* %0, double** %2
store i32 2, i32* %4
%6 = load i32*, i32** %5
%7 = load double*, double** %2
%8 = call i32 @_ada_use_c2phc4c(i32 867, i32* %4, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @padcon_get_quaddobl_t_value(double* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%4 = call i32 @_ada_use_c2phc4c(i32 867, i32* %2, i32* undef, double* %0, i32 0)
ret i32 %4
}
char *iWar_Remove_Return(char *s) {
  char *s1, *s2;
  for (s1 = s2 = s; *s1; *s1++ = *s2++)
    while (*s2 == '\n')
      s2++;
  return s;
}


x86 assembly (clang, -O0):
<iWar_Remove_Return>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1173 <iWar_Remove_Return+0x73>
jmp    1126 <iWar_Remove_Return+0x26>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1147 <iWar_Remove_Return+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1126 <iWar_Remove_Return+0x26>
jmp    114c <iWar_Remove_Return+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1114 <iWar_Remove_Return+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iWar_Remove_Return>:
mov    %rdi,%rax
cmpb   $0x0,(%rdi)
je     1128 <iWar_Remove_Return+0x28>
mov    %rax,%rcx
mov    %rax,%rsi
xchg   %ax,%ax
movzbl (%rcx),%edx
add    $0x1,%rcx
cmp    $0xa,%dl
je     1110 <iWar_Remove_Return+0x10>
mov    %dl,(%rsi)
cmpb   $0x0,0x1(%rsi)
lea    0x1(%rsi),%rsi
jne    1110 <iWar_Remove_Return+0x10>
ret

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

LLVM IR (-O2):
define i8* @iWar_Remove_Return(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8* [ %11, %12 ], [ %0, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
br label %7
7: ; preds = %7, %4
%8 = phi i8* [ %11, %7 ], [ %5, %4 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
%11 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %10, label %7, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret i8* %0
}
double bam_aux2d(const unsigned char *s) {
  int type = *s++;
  if (s == 0)
    return 0.0;
  if (type == 'd')
    return *(double *)s;
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<bam_aux2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1135 <bam_aux2d+0x35>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1159 <bam_aux2d+0x59>
cmpl   $0x64,-0x14(%rbp)
jne    1151 <bam_aux2d+0x51>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1159 <bam_aux2d+0x59>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bam_aux2d>:
xorps  %xmm0,%xmm0
cmpb   $0x64,(%rdi)
jne    110d <bam_aux2d+0xd>
movsd  0x1(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @bam_aux2d(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %3
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
store i32 %8, i32* %4
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store double 0.000000e+00, double* %2
br label %20
12: ; preds = %1
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 100
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i8*, i8** %3
%17 = bitcast i8* %16 to double*
%18 = load double, double* %17
store double %18, double* %2
br label %20
19: ; preds = %12
store double 0.000000e+00, double* %2
br label %20
20: ; preds = %19, %15, %11
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @bam_aux2d(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 100
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
br label %8
8: ; preds = %1, %4
%9 = phi double [ %7, %4 ], [ 0.000000e+00, %1 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void branch_both() {
  int r;
  if (r) {
    while (1)
      assert(1);
  } else {
    while (1)
      assert(1);
  }
}


x86 assembly (clang, -O0):
<branch_both>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,-0x4(%rbp)
je     1136 <branch_both+0x26>
jmp    1127 <branch_both+0x17>
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1127 <branch_both+0x17>
jmp    113b <branch_both+0x2b>
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    113b <branch_both+0x2b>

x86 assembly (clang, -O2):
<branch_both>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1120 <branch_both+0x10>

LLVM IR (-O0):
define void @branch_both() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
br label %5
5: ; preds = %4, %5
%6 = call i32 @assert(i32 1)
br label %5
7: ; preds = %0
br label %8
8: ; preds = %7, %8
%9 = call i32 @assert(i32 1)
br label %8
}

LLVM IR (-O2):
define void @branch_both() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @assert(i32 1)
br label %1
}