xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getch();
double modf(double, double *);
int /*<<< orphan*/ printf(char *, ...);
main() {
  double fraction, integer;
  double number = 100.567;
  fraction = modf(number, &integer);
  printf("The whole and fractional parts of\n");
  printf("%lf are %lf and %lf\n", number, integer, fraction);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x8(%rbp)
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
lea    0xeaf(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xeb4(%rip),%xmm0
lea    0x10(%rsp),%rdi
call   1050 <modf@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
movsd  0x10(%rsp),%xmm1
lea    0xe93(%rip),%rdi
movsd  0xe83(%rip),%xmm0
movsd  0x8(%rsp),%xmm2
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"The whole and fractional parts of\0A\00"
@.str.1 = [21 x i8] c"%lf are %lf and %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 1.005670e+02, double* %3
%4 = load double, double* %3
%5 = call double @modf(double %4, double* %2)
store double %5, double* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = load double, double* %3
%8 = load double, double* %2
%9 = load double, double* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %7, double %8, double %9)
%11 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"%lf are %lf and %lf\0A\00"
@str = [34 x i8] c"The whole and fractional parts of\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call double @modf(double 1.005670e+02, double* %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%5 = load double, double* %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 1.005670e+02, double %5, double %3)
%7 = tail call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
int main2(int, char **);
int main(int argc, char **argv) { return main2(argc, argv); }


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 <main2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main2@plt>

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 @main2(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main2(i32 %0, i8** %1)
ret i32 %3
}
int strcpy2(char *dst, char *src) {
  int i;
  for (i = 0; src[i] != '\0'; i++)
    dst[i] = src[i];
  dst[i] = '\0';
  return i;
}


x86 assembly (clang, -O0):
<strcpy2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <strcpy2+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy2+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy2>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <strcpy2+0x20>
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy2+0x10>
mov    %eax,%ecx
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define i32 @strcpy2(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %9 to i32
br label %15
15: ; preds = %13, %2
%16 = phi i32 [ 0, %2 ], [ %14, %13 ]
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
store i8 0, i8* %18
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  assume(x < y);
  while (x < y) {
    x = x + 1;
  }
  assert(x == y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <main+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x22>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
int start_listen(const char *ip, int port) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @start_listen(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int si_signo;
  int si_code;
  scalar_t__ si_addr;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, unsigned long);
void handler(int sig, siginfo_t *info, void *v) {
  printf("info: sig=%d code=%d addr=0x%lx\n", info->si_signo, info->si_code,
         (unsigned long)info->si_addr);
  exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    (%rsi),%eax
mov    0x4(%rsi),%edx
mov    0x8(%rsi),%rcx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i64 }
@.str = [33 x i8] c"info: sig=%d code=%d addr=0x%lx\0A\00"
define void @handler(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 2
%15 = load i64, i64* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12, i64 %15)
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i64 }
@.str = [33 x i8] c"info: sig=%d code=%d addr=0x%lx\0A\00"
define void @handler(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 2
%9 = load i64, i64* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7, i64 %9)
%11 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_50uint8_reg(unsigned char val) {
  return ((val) & (-0x50 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_50uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffb0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_50uint8_reg>:
test   $0xb0,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_50uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -80
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_50uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -80
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ imv_source_free(void *);
void *free_thread(void *src) {
  imv_source_free(src);
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @free_thread(i8* %0) {
%2 = tail call i32 @imv_source_free(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ ArgItem();
void Act_Tie(void) {
  ArgItem();
  ArgItem();
}


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

x86 assembly (clang, -O2):
<Act_Tie>:
push   %rax
xor    %eax,%eax
call   1030 <ArgItem@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ArgItem@plt>

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

LLVM IR (-O2):
define void @Act_Tie() {
%1 = tail call i32 (...) @ArgItem()
%2 = tail call i32 (...) @ArgItem()
ret void
}
void *mem_cache_zalloc(void *cache) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @mem_cache_zalloc(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __REV16(uint32_t value) {
  uint32_t result;
  return (result);
}


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

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

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

LLVM IR (-O2):
define i32 @__REV16(i32 %0) {
ret i32 undef
}
/* Variables and functions */
double ribeta(double, double, double);
double fcdf(double x, double d1, double d2) {
  return ribeta((d1 * x) / ((d1 * x) + d2), 0.5 * d1, 0.5 * d2);
}


x86 assembly (clang, -O0):
<fcdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xeac(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe9f(%rip),%xmm2
mulsd  -0x18(%rbp),%xmm2
call   1030 <ribeta@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcdf>:
mulsd  %xmm1,%xmm0
movapd %xmm0,%xmm3
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm0
movsd  0xed8(%rip),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm3,%xmm2
jmp    1030 <ribeta@plt>

LLVM IR (-O0):
define double @fcdf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = load double, double* %5
%11 = load double, double* %4
%12 = load double, double* %6
%13 = call double @llvm.fmuladd.f64(double %10, double %11, double %12)
%14 = fdiv double %9, %13
%15 = load double, double* %5
%16 = fmul double 5.000000e-01, %15
%17 = load double, double* %6
%18 = fmul double 5.000000e-01, %17
%19 = call double @ribeta(double %14, double %16, double %18)
ret double %19
}

LLVM IR (-O2):
define double @fcdf(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = tail call double @llvm.fmuladd.f64(double %1, double %0, double %2)
%6 = fdiv double %4, %5
%7 = fmul double %1, 5.000000e-01
%8 = fmul double %2, 5.000000e-01
%9 = tail call double @ribeta(double %6, double %7, double %8)
ret double %9
}
/* Type definitions */
typedef void pthread_mutex_t;

/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ pthread_mutex_init(void *, int /*<<< orphan*/ *);
void *init_mutx() {
  pthread_mutex_t *mutx = malloc(sizeof(pthread_mutex_t));
  pthread_mutex_init(mutx, NULL);
  return (mutx);
}


x86 assembly (clang, -O0):
<init_mutx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_mutex_init@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_mutx>:
push   %rbx
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <pthread_mutex_init@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @init_mutx() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @pthread_mutex_init(i8* %3, i32* null)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @init_mutx() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = tail call i32 @pthread_mutex_init(i8* %1, i32* null)
ret i8* %1
}
unsigned int getEthernetType(const unsigned char *tr) {
  unsigned int d, x[2];
  x[0] = (unsigned int)tr[12];
  x[1] = (unsigned int)tr[13];
  return d = (x[0] << 8) | x[1];
}


x86 assembly (clang, -O0):
<getEthernetType>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0xc(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0xd(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEthernetType>:
movzwl 0xc(%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @getEthernetType(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [2 x i32]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 12
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 13
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%16 = load i32, i32* %15
%17 = shl i32 %16, 8
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%19 = load i32, i32* %18
%20 = or i32 %17, %19
store i32 %20, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @getEthernetType(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 13
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %4, 8
%9 = or i32 %8, %7
ret i32 %9
}
/* Variables and functions */
scalar_t__ remove(char const *);
int fs_remove(const char *filename) {
  if (remove(filename) != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<fs_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
je     113b <fs_remove+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <fs_remove+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_remove>:
push   %rax
call   1030 <remove@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fs_remove(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @remove(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @fs_remove(i8* nocapture %0) {
%2 = tail call i64 @remove(i8* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_seconds_gettimeofday() {
  struct timeval tv;
  assert(0 == gettimeofday(&tv, NULL));
  return (double)tv.tv_sec + 1.0e-6 * ((double)tv.tv_usec);
}


x86 assembly (clang, -O0):
<get_seconds_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xea2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_seconds_gettimeofday>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeac(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @get_seconds_gettimeofday() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp eq i64 0, %2
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %11, double %8)
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @get_seconds_gettimeofday() {
%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
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %9)
ret double %13
}
/* Variables and functions */
int tint3_main(int, char **);
int main(int argc, char *argv[]) { return tint3_main(argc, argv); }


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 <tint3_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <tint3_main@plt>

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 @tint3_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @tint3_main(i32 %0, i8** %1)
ret i32 %3
}
int gcd(int a, int b) {
  if (a == 0)
    return b;
  if (b == 0)
    return a;
  int temp;
  while (b) {
    temp = a % b;
    a = b;
    b = temp;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <gcd+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <gcd+0x64>
cmpl   $0x0,-0xc(%rbp)
jne    1134 <gcd+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <gcd+0x64>
jmp    1139 <gcd+0x39>
cmpl   $0x0,-0xc(%rbp)
je     115e <gcd+0x5e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <gcd+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
test   %edi,%edi
je     111e <gcd+0x1e>
mov    %edi,%eax
test   %edx,%edx
je     1120 <gcd+0x20>
nopl   0x0(%rax)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %1, %4 ]
%8 = phi i32 [ %7, %6 ], [ %0, %4 ]
%9 = srem i32 %8, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %4, %2
%12 = phi i32 [ %1, %2 ], [ %0, %4 ], [ %7, %6 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
size_t bootpart_size(const char *part_type) {
  if (strcmp(part_type, "GPT") == 0)
    return (64 * 1024);
  return (0);
}


x86 assembly (clang, -O0):
<bootpart_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1143 <bootpart_size+0x33>
movq   $0x10000,-0x8(%rbp)
jmp    114b <bootpart_size+0x3b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bootpart_size>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
shl    $0x10,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"GPT\00"
define i64 @bootpart_size(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 65536, i64* %2
br label %9
8: ; preds = %1
store i64 0, i64* %2
br label %9
9: ; preds = %8, %7
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"GPT\00"
define i64 @bootpart_size(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i64 65536, i64 0
ret i64 %4
}
/* Variables and functions */
int _rdeeprom(int);
int eeprom_rdword(int addr) {
  return (_rdeeprom(addr) | (_rdeeprom(addr + 1) << 8));
}


x86 assembly (clang, -O0):
<eeprom_rdword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_rdeeprom@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <_rdeeprom@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_rdword>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <_rdeeprom@plt>
mov    %eax,%ebp
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <_rdeeprom@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eeprom_rdword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_rdeeprom(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i32 @_rdeeprom(i32 %6)
%8 = shl i32 %7, 8
%9 = or i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @eeprom_rdword(i32 %0) {
%2 = tail call i32 @_rdeeprom(i32 %0)
%3 = add nsw i32 %0, 1
%4 = tail call i32 @_rdeeprom(i32 %3)
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
/* Variables and functions */
float calc_cpu_util_internal(float);
float calc_cpu_util(float elapsed_time) {
  return (calc_cpu_util_internal(elapsed_time));
}


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

x86 assembly (clang, -O2):
<calc_cpu_util>:
jmp    1030 <calc_cpu_util_internal@plt>

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

LLVM IR (-O2):
define float @calc_cpu_util(float %0) {
%2 = tail call float @calc_cpu_util_internal(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void __Panic(const char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(11);
}


x86 assembly (clang, -O0):
<__Panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xb,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<__Panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xb,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @__Panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 11)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @__Panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 11)
unreachable
}
/* Variables and functions */
int f();
int main() {
l:
l2:;
  int i = f();
  goto l;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
jmp    1124 <main+0x14>
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <f@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %4, %0
br label %4
4: ; preds = %3
%5 = call i32 (...) @f()
store i32 %5, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @f()
br label %1
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SetConstructPPForm(void *, struct constructHeader *, char *);
void EnvSetDefclassPPForm(void *theEnv, void *theClass, char *thePPForm) {
  SetConstructPPForm(theEnv, (struct constructHeader *)theClass, thePPForm);
}


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

x86 assembly (clang, -O2):
<EnvSetDefclassPPForm>:
jmp    1030 <SetConstructPPForm@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define void @EnvSetDefclassPPForm(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to %struct.constructHeader*
%10 = load i8*, i8** %6
%11 = call i32 @SetConstructPPForm(i8* %7, %struct.constructHeader* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define void @EnvSetDefclassPPForm(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %1 to %struct.constructHeader*
%5 = tail call i32 @SetConstructPPForm(i8* %0, %struct.constructHeader* %4, i8* %2)
ret void
}
char *macbackslash(char *arg) {
  *arg = '\\';
  arg[1] = 0;
  return (arg);
}


x86 assembly (clang, -O0):
<macbackslash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x5c,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<macbackslash>:
mov    %rdi,%rax
movw   $0x5c,(%rdi)
ret

LLVM IR (-O0):
define i8* @macbackslash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8 92, i8* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %5
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define i8* @macbackslash(i8* returned writeonly %0) {
store i8 92, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %2
ret i8* %0
}
const char *__malidrv_build_info(void) {
  return "mali: BUILD=RELEASE ARCH=arch_011_udd PLATFORM=default_7a TRACE=0 "
         "THREAD= GEOM=mali_gp_geometry_common CORES=MALI400 USING_MALI400=1 "
         "TARGET_CORE_REVISION=0x0101 TOPLEVEL_REPO_URL=Linux-r3p2-01rel3 "
         "REVISION=Linux-r3p2-01rel3 CHANGED_REVISION=Linux-r3p2-01rel3 "
         "REPO_URL=Linux-r3p2-01rel3 BUILD_DATE=Tue Aug 26 17:05:16 KST 2014 "
         "CHANGE_DATE=Linux-r3p2-01rel3 TARGET_TOOLCHAIN=arm-linux-gcc "
         "HOST_TOOLCHAIN=gcc TARGET_TOOLCHAIN_VERSION=gcc "
         "TARGET_SYSTEM=gcc-arm-linux HOST_SYSTEM=gcc-x86_64-linux CPPFLAGS= "
         "CUSTOMER=internal "
         "VARIANT=mali400-r1p1-gles11-gles20-linux-android-max_pp_split_count_"
         "4-ump-smp-rgb_is_xrgb-jellybean_mr2-gp_cache_alloc HOSTLIB=direct "
         "INSTRUMENTED=FALSE USING_MRI=FALSE MALI_TEST_API= UDD_OS=linux";
}


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

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

LLVM IR (-O0):
@.str = [717 x i8] c"mali: BUILD=RELEASE ARCH=arch_011_udd PLATFORM=default_7a TRACE=0 THREAD= GEOM=mali_gp_geometry_common CORES=MALI400 USING_MALI400=1 TARGET_CORE_REVISION=0x0101 TOPLEVEL_REPO_URL=Linux-r3p2-01rel3 REVISION=Linux-r3p2-01rel3 CHANGED_REVISION=Linux-r3p2-01rel3 REPO_URL=Linux-r3p2-01rel3 BUILD_DATE=Tue Aug 26 17:05:16 KST 2014 CHANGE_DATE=Linux-r3p2-01rel3 TARGET_TOOLCHAIN=arm-linux-gcc HOST_TOOLCHAIN=gcc TARGET_TOOLCHAIN_VERSION=gcc TARGET_SYSTEM=gcc-arm-linux HOST_SYSTEM=gcc-x86_64-linux CPPFLAGS= CUSTOMER=internal VARIANT=mali400-r1p1-gles11-gles20-linux-android-max_pp_split_count_4-ump-smp-rgb_is_xrgb-jellybean_mr2-gp_cache_alloc HOSTLIB=direct INSTRUMENTED=FALSE USING_MRI=FALSE MALI_TEST_API= UDD_OS=linux\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([717 x i8], [717 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [717 x i8] c"mali: BUILD=RELEASE ARCH=arch_011_udd PLATFORM=default_7a TRACE=0 THREAD= GEOM=mali_gp_geometry_common CORES=MALI400 USING_MALI400=1 TARGET_CORE_REVISION=0x0101 TOPLEVEL_REPO_URL=Linux-r3p2-01rel3 REVISION=Linux-r3p2-01rel3 CHANGED_REVISION=Linux-r3p2-01rel3 REPO_URL=Linux-r3p2-01rel3 BUILD_DATE=Tue Aug 26 17:05:16 KST 2014 CHANGE_DATE=Linux-r3p2-01rel3 TARGET_TOOLCHAIN=arm-linux-gcc HOST_TOOLCHAIN=gcc TARGET_TOOLCHAIN_VERSION=gcc TARGET_SYSTEM=gcc-arm-linux HOST_SYSTEM=gcc-x86_64-linux CPPFLAGS= CUSTOMER=internal VARIANT=mali400-r1p1-gles11-gles20-linux-android-max_pp_split_count_4-ump-smp-rgb_is_xrgb-jellybean_mr2-gp_cache_alloc HOSTLIB=direct INSTRUMENTED=FALSE USING_MRI=FALSE MALI_TEST_API= UDD_OS=linux\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([717 x i8], [717 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ steeringToCenter();
void steeringInit() {
  steeringToCenter();
  delay(1);
}


x86 assembly (clang, -O0):
<steeringInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <steeringToCenter@plt>
mov    $0x1,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<steeringInit>:
push   %rax
xor    %eax,%eax
call   1040 <steeringToCenter@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @steeringInit() {
%1 = call i32 (...) @steeringToCenter()
%2 = call i32 @delay(i32 1)
ret void
}

LLVM IR (-O2):
define void @steeringInit() {
%1 = tail call i32 (...) @steeringToCenter()
%2 = tail call i32 @delay(i32 1)
ret void
}
int f(int a, long long b, int c) { return a / 'a' + b / 'b' + c / 'c'; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x61,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x62,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x63,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edx,%ecx
mov    %rsi,%rax
movslq %edi,%rdx
imul   $0x151d07eb,%rdx,%rsi
mov    %rsi,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rsi
sar    $0x3,%esi
add    %edx,%esi
movabs $0x5397829cbc14e5e1,%rdx
82 97 53
imul   %rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
shr    $0x5,%rdx
add    %edx,%edi
add    %esi,%edi
movslq %ecx,%rax
imul   $0xffffffffa57eb503,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x6,%eax
add    %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 97
%9 = sext i32 %8 to i64
%10 = load i64, i64* %5
%11 = sdiv i64 %10, 98
%12 = add nsw i64 %9, %11
%13 = load i32, i32* %6
%14 = sdiv i32 %13, 99
%15 = sext i32 %14 to i64
%16 = add nsw i64 %12, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @f(i32 %0, i64 %1, i32 %2) {
%4 = sdiv i32 %0, 97
%5 = sdiv i64 %1, 98
%6 = sdiv i32 %2, 99
%7 = trunc i64 %5 to i32
%8 = add i32 %4, %7
%9 = add i32 %8, %6
ret i32 %9
}
adr0reg1_set(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (*((char *)10000000)) = r1; }


x86 assembly (clang, -O0):
<adr0reg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x6(%rbp),%cl
mov    $0x989680,%eax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0reg1_set>:
mov    %sil,0x989680
ret

LLVM IR (-O0):
define i32 @adr0reg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* %9
store i8 %16, i8* inttoptr (i64 10000000 to i8*)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @adr0reg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = trunc i32 %1 to i8
store i8 %7, i8* inttoptr (i64 10000000 to i8*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void aagfree(void *ptr) { free((char *)ptr); }


x86 assembly (clang, -O0):
<aagfree>:
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):
<aagfree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @aagfree(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 @aagfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int toascii(int c) { return (c & 0177); }


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

x86 assembly (clang, -O2):
<toascii>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
void p_GetCurrentDirectory(char *p) { getcwd(p, 250); }


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

x86 assembly (clang, -O2):
<p_GetCurrentDirectory>:
mov    $0xfa,%esi
jmp    1030 <getcwd@plt>

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

LLVM IR (-O2):
define void @p_GetCurrentDirectory(i8* %0) {
%2 = tail call i32 @getcwd(i8* %0, i32 250)
ret void
}
void function_1() {}


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

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

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

LLVM IR (-O2):
define void @function_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int /*<<< orphan*/);
void ft_putstr(const char *str) {
  while (*str)
    ft_putchar(*(str++));
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <ft_putstr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <ft_putchar@plt>
jmp    111c <ft_putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @ft_putchar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @ft_putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int valid_input(char *input_name) {
  FILE *input;
  input = fopen(input_name, "r");
  if (input != NULL) {
    fclose(input);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<valid_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <valid_input+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <valid_input+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_input>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <valid_input+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @valid_input(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @fclose(i32* %10)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @valid_input(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int tcsendbreak(int fd, int duration) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<tcsendbreak>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebe(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsendbreak>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @tcsendbreak(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @tcsendbreak(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f();
main() {
  if (f() != -2)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0xfffffffe,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0xfffffffe,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = icmp ne i32 %2, -2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, -2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}