xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double, double);
int printConfiguration(double q[3], double x, void *user_data) {
  printf("%f,%f,%f,%f\n", q[0], q[1], q[2], x);
  return 0;
}


x86 assembly (clang, -O0):
<printConfiguration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
movsd  -0x10(%rbp),%xmm3
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printConfiguration>:
push   %rax
movaps %xmm0,%xmm3
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%f,%f,%f,%f\0A\00"
define i32 @printConfiguration(double* %0, double %1, i8* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca i8*
store double* %0, double** %4
store double %1, double* %5
store i8* %2, i8** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 2
%15 = load double, double* %14
%16 = load double, double* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %9, double %12, double %15, double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%f,%f,%f,%f\0A\00"
define i32 @printConfiguration(double* nocapture %0, double %1, i8* nocapture readnone %2) {
%4 = load double, double* %0
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %4, double %6, double %8, double %1)
ret i32 0
}
void stosb(void *addr, int data, int cnt) {
  asm volatile("cld; rep stosb"
               : "=D"(addr), "=c"(cnt)
               : "0"(addr), "1"(cnt), "a"(data)
               : "memory", "cc");
}


x86 assembly (clang, -O0):
<stosb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
cld
rep stos %al,%es:(%rdi)
mov    %rdi,-0x8(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stosb>:
mov    %edx,%ecx
mov    %esi,%eax
cld
rep stos %al,%es:(%rdi)
ret

LLVM IR (-O0):
define void @stosb(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = call { i8*, i32 } asm sideeffect "cld; rep stosb", "={di},={cx},0,1,{ax},~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i8* %7, i32 %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %4
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @stosb(i8* %0, i32 %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld; rep stosb", "={di},={cx},0,1,{ax},~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %2, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ThreeFile() { printf("Inside of three.c now\n"); }


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"Inside of three.c now\00"
define void @ThreeFile() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sequence();
int /*<<< orphan*/ system(char *);
int main() {
  sequence();
  printf("\n");
  system("pause");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 (...) @sequence()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void sws_freeContext() {}


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

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

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

LLVM IR (-O2):
define void @sws_freeContext() {
ret void
}
float sq_f(float f) { return f * f; }


x86 assembly (clang, -O0):
<sq_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sq_f>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sq_f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @sq_f(float %0) {
%2 = fmul float %0, %0
ret float %2
}
int twenty_one(void) { return 21; }


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

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

LLVM IR (-O0):
define i32 @twenty_one() {
ret i32 21
}

LLVM IR (-O2):
define i32 @twenty_one() {
ret i32 21
}
/* Variables and functions */
int /*<<< orphan*/ sse2_test();
void __attribute__((no)) do_test(void) { sse2_test(); }


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

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

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

LLVM IR (-O2):
define void @do_test() {
%1 = tail call i32 (...) @sse2_test()
ret void
}
/* Variables and functions */
int _semop(int, int);
int semaphoreRelease(int semid) { return _semop(semid, 1); }


x86 assembly (clang, -O0):
<semaphoreRelease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <_semop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semaphoreRelease>:
mov    $0x1,%esi
jmp    1030 <_semop@plt>

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

LLVM IR (-O2):
define i32 @semaphoreRelease(i32 %0) {
%2 = tail call i32 @_semop(i32 %0, i32 1)
ret i32 %2
}
/* Type definitions */
struct frame {
  int dummy;
};

/* Variables and functions */
double compute_tpf(struct frame *);
long time_to_frame(struct frame *fr, double seconds) {
  return (long)(seconds / compute_tpf(fr));
}


x86 assembly (clang, -O0):
<time_to_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <compute_tpf@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_to_frame>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <compute_tpf@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.frame = type { i32 }
define i64 @time_to_frame(%struct.frame* %0, double %1) {
%3 = alloca %struct.frame*
%4 = alloca double
store %struct.frame* %0, %struct.frame** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load %struct.frame*, %struct.frame** %3
%7 = call double @compute_tpf(%struct.frame* %6)
%8 = fdiv double %5, %7
%9 = fptosi double %8 to i64
ret i64 %9
}

LLVM IR (-O2):
%struct.frame = type { i32 }
define i64 @time_to_frame(%struct.frame* %0, double %1) {
%3 = tail call double @compute_tpf(%struct.frame* %0)
%4 = fdiv double %1, %3
%5 = fptosi double %4 to i64
ret i64 %5
}
/* Type definitions */
struct mbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mb_pool_chain_free(struct mbuf *);
void mb_chain_free(struct mbuf *m) { mb_pool_chain_free(m); }


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

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

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

LLVM IR (-O2):
%struct.mbuf = type { i32 }
define void @mb_chain_free(%struct.mbuf* %0) {
%2 = tail call i32 @mb_pool_chain_free(%struct.mbuf* %0)
ret void
}
int check_solution(int board[]) {
  for (int i = 0; i < 81; i++) {
    if (0 == board[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_solution>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x51,-0x14(%rbp)
jge    114b <check_solution+0x4b>
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
xor    %eax,%eax
cmp    (%rcx,%rdx,4),%eax
jne    1138 <check_solution+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1152 <check_solution+0x52>
jmp    113d <check_solution+0x3d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <check_solution+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_solution>:
mov    $0x1,%al
cmpl   $0x0,(%rdi)
je     113d <check_solution+0x3d>
xor    %ecx,%ecx
nopl   0x0(%rax)
cmpl   $0x0,0x4(%rdi,%rcx,4)
je     113d <check_solution+0x3d>
cmpl   $0x0,0x8(%rdi,%rcx,4)
je     113d <check_solution+0x3d>
cmp    $0x4e,%rcx
je     113a <check_solution+0x3a>
lea    0x3(%rcx),%rdx
cmpl   $0x0,0xc(%rdi,%rcx,4)
mov    %rdx,%rcx
jne    1110 <check_solution+0x10>
add    $0xfffffffffffffffd,%rdx
cmp    $0x4e,%rdx
setb   %al
xor    $0x1,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @check_solution(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %26, label %4
4: ; preds = %1, %18
%5 = phi i64 [ %16, %18 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %26, label %10
10: ; preds = %4
%11 = add nuw nsw i64 %5, 2
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %26, label %15
15: ; preds = %10
%16 = add nuw nsw i64 %5, 3
%17 = icmp eq i64 %16, 81
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = getelementptr inbounds i32, i32* %0, i64 %16
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %4
22: ; preds = %18
%23 = icmp ult i64 %5, 78
br label %26
24: ; preds = %15
%25 = icmp ult i64 %5, 78
br label %26
26: ; preds = %22, %24, %10, %4, %1
%27 = phi i1 [ true, %1 ], [ %23, %22 ], [ %25, %24 ], [ true, %10 ], [ true, %4 ]
%28 = xor i1 %27, true
%29 = zext i1 %28 to i32
ret i32 %29
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, char *);
int sout() { syscall(9, "serial line from Umode\r\n"); }


x86 assembly (clang, -O0):
<sout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x9,%edi
lea    0xedc(%rip),%rsi
call   1030 <syscall@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sout>:
lea    0xee9(%rip),%rsi
mov    $0x9,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"serial line from Umode\0D\0A\00"
define i32 @sout() {
%1 = alloca i32
%2 = call i32 @syscall(i32 9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [25 x i8] c"serial line from Umode\0D\0A\00"
define i32 @sout() {
%1 = tail call i32 @syscall(i32 9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ HSUSBD_CLR_SE0();
void HSUSBD_Start(void) { HSUSBD_CLR_SE0(); }


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

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

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

LLVM IR (-O2):
define void @HSUSBD_Start() {
%1 = tail call i32 (...) @HSUSBD_CLR_SE0()
ret void
}
void ata_sff_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @ata_sff_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_help(const char *bin_name) {
  puts("Convert an Y-m-d formatted date of birth to seconds\n");
  printf("Usage: %s Y-m-d\n", bin_name);
  puts("  Y - year e.g. 1965\n"
       "  m - month e.g. 05 for May\n"
       "  d - day e.g. 14");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xef2(%rip),%rdi
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [53 x i8] c"Convert an Y-m-d formatted date of birth to seconds\0A\00"
@.str.1 = [17 x i8] c"Usage: %s Y-m-d\0A\00"
@.str.2 = [67 x i8] c" Y - year e.g. 1965\0A m - month e.g. 05 for May\0A d - day e.g. 14\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @puts(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Convert an Y-m-d formatted date of birth to seconds\0A\00"
@.str.1 = [17 x i8] c"Usage: %s Y-m-d\0A\00"
@.str.2 = [67 x i8] c" Y - year e.g. 1965\0A m - month e.g. 05 for May\0A d - day e.g. 14\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cc3000_clear_pin_WL_EN();
int /*<<< orphan*/ cc3000_interrupt_disable();
int cc3000_read_irq_pin();
void cc3000_stop() {
  cc3000_interrupt_disable();
  cc3000_clear_pin_WL_EN();
  while (cc3000_read_irq_pin() != 1)
    ;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cc3000_interrupt_disable@plt>
mov    $0x0,%al
call   1030 <cc3000_clear_pin_WL_EN@plt>
mov    $0x0,%al
call   1050 <cc3000_read_irq_pin@plt>
cmp    $0x1,%eax
je     1157 <cc3000_stop+0x27>
jmp    1142 <cc3000_stop+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1040 <cc3000_interrupt_disable@plt>
xor    %eax,%eax
call   1030 <cc3000_clear_pin_WL_EN@plt>
nop
xor    %eax,%eax
call   1050 <cc3000_read_irq_pin@plt>
cmp    $0x1,%eax
jne    1140 <cc3000_stop+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @cc3000_stop() {
%1 = call i32 (...) @cc3000_interrupt_disable()
%2 = call i32 (...) @cc3000_clear_pin_WL_EN()
br label %3
3: ; preds = %6, %0
%4 = call i32 (...) @cc3000_read_irq_pin()
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @cc3000_stop() {
%1 = tail call i32 (...) @cc3000_interrupt_disable()
%2 = tail call i32 (...) @cc3000_clear_pin_WL_EN()
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @cc3000_read_irq_pin()
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
int main(int argc, char *argv[]) {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
    printf("hello");
  }
  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    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
je     1178 <main+0x48>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea6(%rip),%r14
cmp    (%r14),%eax
je     116b <main+0x3b>
lea    0xeb2(%rip),%rbx
xchg   %ax,%ax
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r14),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [6 x i8] c"hello\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
br label %7
7: ; preds = %11, %2
%8 = call i32 (...) @getchar()
store i32 %8, i32* %6
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %6
%13 = call i32 @putchar(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ %3, %2 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void clearscreen(void) { fprintf(stdout, "%c[2J", 0x1B); }


x86 assembly (clang, -O0):
<clearscreen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x1b,%edx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearscreen>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x1b,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"%c[2J\00"
define void @clearscreen() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"%c[2J\00"
define void @clearscreen() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge_(int *, int, int *, int, int *);
void merge(int A[], int low1, int high1, int low2, int high2, int B[]) {
  merge_(&A[low1], high1 - low1 + 1, &A[low2], high2 - low2 + 1, &B[low1]);
}


x86 assembly (clang, -O0):
<merge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%esi
sub    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%r8
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r8
call   1030 <merge_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%r10
sub    %eax,%edx
lea    0x1(%rdx),%esi
movslq %ecx,%rcx
lea    (%rdi,%rcx,4),%rdx
sub    %ecx,%r8d
lea    0x1(%r8),%ecx
lea    (%r9,%rax,4),%r8
mov    %r10,%rdi
jmp    1030 <merge_@plt>

LLVM IR (-O0):
define void @merge(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = sub nsw i32 %17, %18
%20 = add nsw i32 %19, 1
%21 = load i32*, i32** %7
%22 = load i32, i32* %10
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %11
%26 = load i32, i32* %10
%27 = sub nsw i32 %25, %26
%28 = add nsw i32 %27, 1
%29 = load i32*, i32** %12
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
%33 = call i32 @merge_(i32* %16, i32 %20, i32* %24, i32 %28, i32* %32)
ret void
}

LLVM IR (-O2):
define void @merge(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* %5) {
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = sub i32 1, %1
%10 = add i32 %9, %2
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = sub i32 1, %3
%14 = add i32 %13, %4
%15 = getelementptr inbounds i32, i32* %5, i64 %7
%16 = tail call i32 @merge_(i32* %8, i32 %10, i32* %12, i32 %14, i32* %15)
ret void
}
void caller_with_vp1() {}


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

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

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

LLVM IR (-O2):
define void @caller_with_vp1() {
ret void
}
char *ecvt(double arg, int ndigits, int *decpt, int *sign) {}


x86 assembly (clang, -O0):
<ecvt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @ecvt(double %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i8* undef
}
str_nr_test(p) char *p;
{
  if (*p != '\\')
    return 0;
  if (*(p + 1) != 'n' && *(p + 1) != '*')
    return 0;
  if (*(p + 2) == '(')
    return 5;
  else
    return 3;
}


x86 assembly (clang, -O0):
<str_nr_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1124 <str_nr_test+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1176 <str_nr_test+0x76>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6e,%eax
je     1152 <str_nr_test+0x52>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2a,%eax
je     1152 <str_nr_test+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1176 <str_nr_test+0x76>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x28,%eax
jne    116f <str_nr_test+0x6f>
movl   $0x5,-0x4(%rbp)
jmp    1176 <str_nr_test+0x76>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_nr_test>:
xor    %eax,%eax
cmpb   $0x5c,(%rdi)
jne    1122 <str_nr_test+0x22>
mov    0x1(%rdi),%cl
cmp    $0x6e,%cl
je     1114 <str_nr_test+0x14>
cmp    $0x2a,%cl
jne    1122 <str_nr_test+0x22>
xor    %eax,%eax
cmpb   $0x28,0x2(%rdi)
sete   %al
add    %eax,%eax
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @str_nr_test(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 92
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %12 [
i8 110, label %7
i8 42, label %7
]
7: ; preds = %4, %4
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 40
%11 = select i1 %10, i32 5, i32 3
br label %12
12: ; preds = %7, %4, %1
%13 = phi i32 [ 0, %1 ], [ 0, %4 ], [ %11, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ t;

/* Variables and functions */
int open(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncat(char *, char const *, int);
int devopen(const char *dev, int flags) {
  char t[32];
  strcpy(t, "/dev/");
  strncat(t, dev, sizeof(t) - 5);
  return open(t, flags);
}


x86 assembly (clang, -O0):
<devopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x1b,%edx
call   1040 <strncat@plt>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <open@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devopen>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xebb(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x1b,%edx
call   1040 <strncat@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1050 <open@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/dev/\00"
define i32 @devopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 @strncat(i8* %8, i8* %9, i32 27)
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%12 = load i32, i32* %4
%13 = call i32 @open(i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"/dev/\00"
define i32 @devopen(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strncat(i8* %4, i8* %0, i32 27)
%7 = call i32 @open(i8* %4, i32 %1)
ret i32 %7
}
unsigned int initial_offset(const unsigned int first_padding,
                            const unsigned int halo, const unsigned jstride,
                            const unsigned kstride) {
  return first_padding + halo + halo * jstride + halo * kstride;
}


x86 assembly (clang, -O0):
<initial_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initial_offset>:
lea    (%rdx,%rcx,1),%eax
imul   %esi,%eax
add    %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @initial_offset(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %9, %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = mul i32 %12, %13
%15 = add i32 %11, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = mul i32 %16, %17
%19 = add i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @initial_offset(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %3, %2
%6 = mul i32 %5, %1
%7 = add i32 %1, %0
%8 = add i32 %7, %6
ret i32 %8
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
double strtod(char *, char **);
int32_t read_dbl(char **pointer, double *value) {
  char *start = *pointer;
  *value = strtod(start, pointer);
  return start != *pointer;
}


x86 assembly (clang, -O0):
<read_dbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_dbl>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strtod@plt>
movsd  %xmm0,(%r14)
xor    %eax,%eax
cmp    (%rbx),%r15
setne  %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @read_dbl(i8** nocapture %0, double* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = tail call double @strtod(i8* %3, i8** %0)
store double %4, double* %1
%5 = load i8*, i8** %0
%6 = icmp ne i8* %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ _syscall5(int, void *, void *, void *, void *, void *);
int errno;
int pipe(int pipefd[2]) {
  int ret = (int)_syscall5(16, (void *)pipefd, ((void *)0), ((void *)0),
                           ((void *)0), ((void *)0));
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x10,%edi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <_syscall5@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115f <pipe+0x4f>
xor    %ecx,%ecx
sub    -0x14(%rbp),%ecx
mov    0x2e8f(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <pipe+0x55>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe>:
push   %rax
mov    %rdi,%rsi
mov    $0x10,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <_syscall5@plt>
test   %eax,%eax
js     112e <pipe+0x1e>
pop    %rcx
ret
neg    %eax
mov    0x2ea9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @pipe(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = bitcast i32* %5 to i8*
%7 = call i64 @_syscall5(i32 16, i8* %6, i8* null, i8* null, i8* null, i8* null)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = sub nsw i32 0, %12
store i32 %13, i32* @errno
store i32 -1, i32* %2
br label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @pipe(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i64 @_syscall5(i32 16, i8* %2, i8* null, i8* null, i8* null, i8* null)
%4 = trunc i64 %3 to i32
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = sub nsw i32 0, %4
store i32 %7, i32* @errno
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ -1, %6 ], [ %4, %1 ]
ret i32 %9
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct icmp6hdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_transport_header(struct sk_buff const *);
struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb) {
  return (struct icmp6hdr *)skb_transport_header(skb);
}


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

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

LLVM IR (-O0):
%struct.icmp6hdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.icmp6hdr* @icmp6_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_transport_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.icmp6hdr*
ret %struct.icmp6hdr* %5
}

LLVM IR (-O2):
%struct.icmp6hdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.icmp6hdr* @icmp6_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_transport_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.icmp6hdr*
ret %struct.icmp6hdr* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void yac_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @yac_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
char *uitoa(int, char *, int);
char *itoa(int value, char *result, int base) {
  char *cur, *uret;
  cur = result;
  if (0 > value) {
    *cur++ = '-';
    value *= -1;
  }
  uret = uitoa(value, cur, base);
  if (NULL == uret)
    return NULL;
  return result;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jle    114e <itoa+0x3e>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x2d,(%rax)
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <uitoa@plt>
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
cmp    -0x30(%rbp),%rax
jne    117a <itoa+0x6a>
movq   $0x0,-0x8(%rbp)
jmp    1182 <itoa+0x72>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
js     111d <itoa+0xd>
mov    %rbx,%rsi
jmp    1126 <itoa+0x16>
lea    0x1(%rbx),%rsi
movb   $0x2d,(%rbx)
neg    %edi
call   1030 <uitoa@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @itoa(i32 %0, i8* %1, i32 %2) {
%4 = icmp slt i32 %0, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%7 = sub nsw i32 0, %0
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ %7, %5 ], [ %0, %3 ]
%10 = phi i8* [ %6, %5 ], [ %1, %3 ]
%11 = tail call i8* @uitoa(i32 %9, i8* %10, i32 %2)
%12 = icmp eq i8* %11, null
%13 = select i1 %12, i8* null, i8* %1
ret i8* %13
}
/* Variables and functions */
int f98(int *);
int f99(int *p) { return f98(p); }


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

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

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

LLVM IR (-O2):
define i32 @f99(i32* %0) {
%2 = tail call i32 @f98(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t BSP_LCD_Color565(uint8_t r, uint8_t g, uint8_t b) {
  return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
}


x86 assembly (clang, -O0):
<BSP_LCD_Color565>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf8,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xfc,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_LCD_Color565>:
shl    $0x8,%edi
and    $0xf800,%edi
and    $0xfc,%esi
lea    (%rdi,%rsi,8),%eax
sar    $0x3,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @BSP_LCD_Color565(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = and i32 %7, 248
%9 = shl i32 %8, 8
%10 = load i32, i32* %5
%11 = and i32 %10, 252
%12 = shl i32 %11, 3
%13 = or i32 %9, %12
%14 = load i32, i32* %6
%15 = ashr i32 %14, 3
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @BSP_LCD_Color565(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = and i32 %4, 63488
%6 = shl i32 %1, 3
%7 = and i32 %6, 2016
%8 = or i32 %7, %5
%9 = ashr i32 %2, 3
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ gmx_rdf(int, char **);
int main(int argc, char *argv[]) {
  gmx_rdf(argc, argv);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_rdf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gmx_rdf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_rdf(i32 %0, i8** %1)
ret i32 0
}
float ltoh_float(float littleval) { return littleval; }


x86 assembly (clang, -O0):
<ltoh_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @ltoh_float(float returned %0) {
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ lua_reportbug(char *);
void arithFB(void) { lua_reportbug("unexpected type at conversion to number"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"unexpected type at conversion to number\00"
define void @arithFB() {
%1 = call i32 @lua_reportbug(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"unexpected type at conversion to number\00"
define void @arithFB() {
%1 = tail call i32 @lua_reportbug(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
int two(int a, int b) {
  if (a != 1)
    return 1;
  if (b != 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1120 <two+0x20>
movl   $0x1,-0x4(%rbp)
jmp    113d <two+0x3d>
cmpl   $0x2,-0xc(%rbp)
je     1136 <two+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <two+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<two>:
xor    $0x1,%edi
xor    $0x2,%esi
xor    %eax,%eax
or     %edi,%esi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @two(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 1
%4 = icmp ne i32 %1, 2
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int dns_lookup(const char *host, int (*callback)()) {}


x86 assembly (clang, -O0):
<dns_lookup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dns_lookup(i8* nocapture readnone %0, i32 (...)* nocapture readnone %1) {
ret i32 undef
}
void RTStrToInt16(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToInt16() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPLinkSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void OPLinkSettingsLogging() { UAVObjLogging(OPLinkSettingsHandle()); }


x86 assembly (clang, -O0):
<OPLinkSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <OPLinkSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPLinkSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <OPLinkSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @OPLinkSettingsLogging() {
%1 = call i32 (...) @OPLinkSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OPLinkSettingsLogging() {
%1 = tail call i32 (...) @OPLinkSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}