xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x85() {
  Assert_real((isdigit(133) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              670, ("isdigit should be 0 for 0x85"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x85>:
push   %rbp
mov    %rsp,%rbp
mov    $0x85,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x29e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x85>:
push   %rax
mov    $0x85,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x29e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x85\00"
define void @t_isdigit_0x85() {
%1 = call i64 @isdigit(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x85\00"
define void @t_isdigit_0x85() {
%1 = tail call i64 @isdigit(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct IridiumContext {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IR_early_init_Object(struct IridiumContext *);
int /*<<< orphan*/ IR_init_Float(struct IridiumContext *);
int /*<<< orphan*/ IR_init_Object(struct IridiumContext *);
void setup(struct IridiumContext *context) {
  IR_early_init_Object(context);
  IR_init_Object(context);
  IR_init_Float(context);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <IR_early_init_Object@plt>
mov    -0x8(%rbp),%rdi
call   1030 <IR_init_Object@plt>
mov    -0x8(%rbp),%rdi
call   1050 <IR_init_Float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <IR_early_init_Object@plt>
mov    %rbx,%rdi
call   1030 <IR_init_Object@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <IR_init_Float@plt>

LLVM IR (-O0):
%struct.IridiumContext = type { i32 }
define void @setup(%struct.IridiumContext* %0) {
%2 = alloca %struct.IridiumContext*
store %struct.IridiumContext* %0, %struct.IridiumContext** %2
%3 = load %struct.IridiumContext*, %struct.IridiumContext** %2
%4 = call i32 @IR_early_init_Object(%struct.IridiumContext* %3)
%5 = load %struct.IridiumContext*, %struct.IridiumContext** %2
%6 = call i32 @IR_init_Object(%struct.IridiumContext* %5)
%7 = load %struct.IridiumContext*, %struct.IridiumContext** %2
%8 = call i32 @IR_init_Float(%struct.IridiumContext* %7)
ret void
}

LLVM IR (-O2):
%struct.IridiumContext = type { i32 }
define void @setup(%struct.IridiumContext* %0) {
%2 = tail call i32 @IR_early_init_Object(%struct.IridiumContext* %0)
%3 = tail call i32 @IR_init_Object(%struct.IridiumContext* %0)
%4 = tail call i32 @IR_init_Float(%struct.IridiumContext* %0)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int cmd_exit(int ac, char *av[]) {
  int code;
  if (ac == 1) {
    code = 0;
  } else if (ac == 2) {
    code = atoi(av[1]);
  } else {
    printf("Usage: exit [code]\n");
    return 1;
  }
  exit(code);
  return 0;
}


x86 assembly (clang, -O0):
<cmd_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1155 <cmd_exit+0x25>
movl   $0x0,-0x14(%rbp)
jmp    1190 <cmd_exit+0x60>
cmpl   $0x2,-0x4(%rbp)
jne    1174 <cmd_exit+0x44>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    118b <cmd_exit+0x5b>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    1190 <cmd_exit+0x60>
mov    -0x14(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<cmd_exit>:
push   %rax
cmp    $0x1,%edi
je     114e <cmd_exit+0x1e>
cmp    $0x2,%edi
je     1155 <cmd_exit+0x25>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@str = [19 x i8] c"Usage: exit [code]\00"
define i32 @cmd_exit(i32 %0, i8** nocapture %1) {
switch i32 %0, label %7 [
i32 1, label %9
i32 2, label %3
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 1
9: ; preds = %2, %3
%10 = phi i32 [ %6, %3 ], [ 0, %2 ]
%11 = tail call i32 @exit(i32 %10)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_rsb(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_regi_op();
void arm_rsb_regi() { arm_arith_rsb(arm_data_regi_op()); }


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

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

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

LLVM IR (-O2):
define void @arm_rsb_regi() {
%1 = tail call i32 (...) @arm_data_regi_op()
%2 = tail call i32 @arm_arith_rsb(i32 %1)
ret void
}
int roi_get_stream_response_size(char *buff) {
  if (buff[0] != 19) {
    return 0;
  }
  return ((unsigned char *)buff)[1];
}


x86 assembly (clang, -O0):
<roi_get_stream_response_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x13,%eax
je     1124 <roi_get_stream_response_size+0x24>
movl   $0x0,-0x4(%rbp)
jmp    112f <roi_get_stream_response_size+0x2f>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_get_stream_response_size>:
xor    %eax,%eax
cmpb   $0x13,(%rdi)
jne    110b <roi_get_stream_response_size+0xb>
movzbl 0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @roi_get_stream_response_size(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 19
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
void nrf_raal_uninit(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_raal_uninit() {
ret void
}
double absval(double n) { return n < 0.0 ? -n : n; }


x86 assembly (clang, -O0):
<absval>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <absval+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <absval+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absval>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @absval(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @absval(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
void razmeni1(int *a, int *b) {
  int c;
  c = *a;
  *a = *b;
  *b = c;
}


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

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

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

LLVM IR (-O2):
define void @razmeni1(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void do_not_prune_float_Bad() {
  int a[5];
  float f = 0.5;
  if (f > 0.0 && f < 1.0) {
    a[10] = 0;
  }
}


x86 assembly (clang, -O0):
<do_not_prune_float_Bad>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1149 <do_not_prune_float_Bad+0x49>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1149 <do_not_prune_float_Bad+0x49>
movl   $0x0,0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_not_prune_float_Bad() {
%1 = alloca [5 x i32]
%2 = alloca float
store float 5.000000e-01, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fcmp olt double %8, 1.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 10
store i32 0, i32* %11
br label %12
12: ; preds = %10, %6, %0
ret void
}

LLVM IR (-O2):
define void @do_not_prune_float_Bad() {
ret void
}
/* Variables and functions */
unsigned int __builtin_addg6s(unsigned int, unsigned int);
unsigned int bcd_arith(unsigned int a, unsigned int b) {
  return __builtin_addg6s(a, b);
}


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

x86 assembly (clang, -O2):
<bcd_arith>:
jmp    1030 <__builtin_addg6s@plt>

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

LLVM IR (-O2):
define i32 @bcd_arith(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_addg6s(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double utime() {
  double gettime;
  struct timeval now;
  gettimeofday(&now, 0);
  gettime = 1000000 * now.tv_sec + now.tv_usec;
  gettime /= 1000000;
  return gettime;
}


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define double @utime() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 1000000, %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
store double %10, double* %1
%11 = load double, double* %1
%12 = fdiv double %11, 1.000000e+06
store double %12, double* %1
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @utime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.000000e+06
ret double %11
}
void msDelay(int time) {
  volatile unsigned int i, j;
  for (i = 0; i < 20000; i++)
    for (j = 0; j < time; j++)
      ;
}


x86 assembly (clang, -O0):
<msDelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x4e20,%eax
jae    1155 <msDelay+0x55>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1142 <msDelay+0x42>
jmp    1134 <msDelay+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <msDelay+0x23>
jmp    1147 <msDelay+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <msDelay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<msDelay>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x4e1f,%eax
jbe    1130 <msDelay+0x30>
ret
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x4e20,%eax
jae    1113 <msDelay+0x13>
movl   $0x0,-0x8(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x8(%rsp),%eax
cmp    %edi,%eax
jae    1120 <msDelay+0x20>
addl   $0x1,-0x8(%rsp)
jmp    1140 <msDelay+0x40>

LLVM IR (-O0):
define void @msDelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %5
5: ; preds = %18, %1
%6 = load volatile i32, i32* %3
%7 = icmp ult i32 %6, 20000
br i1 %7, label %8, label %21
8: ; preds = %5
store volatile i32 0, i32* %4
br label %9
9: ; preds = %14, %8
%10 = load volatile i32, i32* %4
%11 = load i32, i32* %2
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
br label %14
14: ; preds = %13
%15 = load volatile i32, i32* %4
%16 = add i32 %15, 1
store volatile i32 %16, i32* %4
br label %9
17: ; preds = %9
br label %18
18: ; preds = %17
%19 = load volatile i32, i32* %3
%20 = add i32 %19, 1
store volatile i32 %20, i32* %3
br label %5
21: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @msDelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %2
%6 = load volatile i32, i32* %2
%7 = icmp ult i32 %6, 20000
br i1 %7, label %8, label %21
8: ; preds = %1, %16
store volatile i32 0, i32* %3
%9 = load volatile i32, i32* %3
%10 = icmp ult i32 %9, %0
br i1 %10, label %11, label %16
11: ; preds = %8, %11
%12 = load volatile i32, i32* %3
%13 = add i32 %12, 1
store volatile i32 %13, i32* %3
%14 = load volatile i32, i32* %3
%15 = icmp ult i32 %14, %0
br i1 %15, label %11, label %16
16: ; preds = %11, %8
%17 = load volatile i32, i32* %2
%18 = add i32 %17, 1
store volatile i32 %18, i32* %2
%19 = load volatile i32, i32* %2
%20 = icmp ult i32 %19, 20000
br i1 %20, label %8, label %21
21: ; preds = %16, %1
ret void
}
void fc133(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  goto a;
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
a:;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc133(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %20
11: ; No predecessors!
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %11, %1
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc133(i32 %0) {
ret void
}
/* Variables and functions */
char *hello();
int /*<<< orphan*/ printf(char *, char *, char *);
char *world();
int main(void) { (void)printf("%s, %s\n", hello(), world()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <hello@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <world@plt>
mov    -0x8(%rbp),%rsi
mov    %rax,%rdx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <hello@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <world@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s, %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @hello()
%2 = tail call i8* (...) @world()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 0
}
int qd_leq_qd_d(const double *a, double b) {
  return (a[0] < b || (a[0] == b && a[1] <= 0.0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<qd_leq_qd_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
ja     115f <qd_leq_qd_d+0x5f>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x12(%rbp)
jne    1159 <qd_leq_qd_d+0x59>
jp     1159 <qd_leq_qd_d+0x59>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd 0x8(%rax),%xmm0
setae  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_leq_qd_d>:
movsd  (%rdi),%xmm1
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     1125 <qd_leq_qd_d+0x25>
ucomisd %xmm0,%xmm1
jne    1126 <qd_leq_qd_d+0x26>
jp     1126 <qd_leq_qd_d+0x26>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd 0x8(%rdi),%xmm0
setae  %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @qd_leq_qd_d(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double, double* %4
%9 = fcmp olt double %7, %8
br i1 %9, label %23, label %10
10: ; preds = %2
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double, double* %4
%15 = fcmp oeq double %13, %14
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fcmp ole double %19, 0.000000e+00
br label %21
21: ; preds = %16, %10
%22 = phi i1 [ false, %10 ], [ %20, %16 ]
br label %23
23: ; preds = %21, %2
%24 = phi i1 [ true, %2 ], [ %22, %21 ]
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 1, i32 0
ret i32 %26
}

LLVM IR (-O2):
define i32 @qd_leq_qd_d(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp olt double %3, %1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = fcmp oeq double %3, %1
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fcmp ole double %9, 0.000000e+00
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %7, %2
%13 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
float M_PI;
int radian_to_servo(float radian_angle) {
  int result = (int)(radian_angle * (0x1ff / 150 * 180) / M_PI);
  return result;
}


x86 assembly (clang, -O0):
<radian_to_servo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divss  (%rax),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<radian_to_servo>:
mulss  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divss  (%rax),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define i32 @radian_to_servo(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 5.400000e+02
%6 = load float, float* @M_PI
%7 = fdiv float %5, %6
%8 = fptosi float %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define i32 @radian_to_servo(float %0) {
%2 = fmul float %0, 5.400000e+02
%3 = load float, float* @M_PI
%4 = fdiv float %2, %3
%5 = fptosi float %4 to i32
ret i32 %5
}
unsigned int bit_scan_forward(unsigned long long mask) {
  return __builtin_ffsll(mask) - 1;
}


x86 assembly (clang, -O0):
<bit_scan_forward>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
bsf    %rdx,%rax
add    $0x1,%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %rcx,%rax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_scan_forward>:
bsf    %rdi,%rcx
cmp    $0x1,%rdi
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bit_scan_forward(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = add i64 %4, 1
%6 = icmp eq i64 %3, 0
%7 = select i1 %6, i64 0, i64 %5
%8 = trunc i64 %7 to i32
%9 = sub nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @bit_scan_forward(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = icmp eq i64 %0, 0
%4 = trunc i64 %2 to i32
%5 = select i1 %3, i32 -1, i32 %4
ret i32 %5
}
void api_putc(char c) {
  if (c == '\n')
    api_putc('\r');
  __asm__ __volatile__("int $0x40" ::"a"(63), "b"(1), "c"(c));
}


x86 assembly (clang, -O0):
<api_putc>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1133 <api_putc+0x23>
mov    $0xd,%edi
call   1030 <api_putc@plt>
mov    -0x9(%rbp),%cl
mov    $0x3f,%eax
mov    $0x1,%ebx
int    $0x40
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<api_putc>:
push   %rbx
cmp    $0xa,%dil
jne    1115 <api_putc+0x15>
mov    $0x3f,%eax
mov    $0x1,%ebx
mov    $0xd,%cl
int    $0x40
mov    $0x3f,%eax
mov    $0x1,%ebx
mov    %edi,%ecx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define void @api_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
%8 = load i8, i8* %2
ret void
}

LLVM IR (-O2):
define void @api_putc(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %4
3: ; preds = %1
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 63, i32 1, i8 13)
br label %4
4: ; preds = %3, %1
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 63, i32 1, i8 %0)
ret void
}
unsigned int blz_hash4(const unsigned char *data) {
  unsigned int val = data[0];
  val = (val * 317) + data[1];
  val = (val * 317) + data[2];
  val = (val * 317) + data[3];
  return (val & ((1024 * 1024) / sizeof(const unsigned char *) - 1));
}


x86 assembly (clang, -O0):
<blz_hash4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
imul   $0x13d,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
imul   $0x13d,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
imul   $0x13d,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1ffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blz_hash4>:
movzbl (%rdi),%eax
imul   $0x13d,%eax,%eax
movzbl 0x1(%rdi),%ecx
add    %eax,%ecx
imul   $0x13d,%ecx,%eax
movzbl 0x2(%rdi),%ecx
add    %eax,%ecx
imul   $0x13d,%ecx,%ecx
movzbl 0x3(%rdi),%eax
add    %ecx,%eax
and    $0x1ffff,%eax
ret

LLVM IR (-O0):
define i32 @blz_hash4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = mul i32 %8, 317
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add i32 %9, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = mul i32 %15, 317
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = add i32 %16, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = mul i32 %22, 317
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = add i32 %23, %27
store i32 %28, i32* %3
%29 = load i32, i32* %3
%30 = zext i32 %29 to i64
%31 = and i64 %30, 131071
%32 = trunc i64 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @blz_hash4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = mul nuw nsw i32 %3, 317
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = add nuw nsw i32 %4, %7
%9 = mul nuw nsw i32 %8, 317
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add nuw nsw i32 %9, %12
%14 = mul i32 %13, 317
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = add i32 %14, %17
%19 = and i32 %18, 131071
ret i32 %19
}
/* Variables and functions */
float equationStep1(float, float, float);
float xyz2Step1(float x, float y, float z) {
  return equationStep1(x, y, z) - equationStep1(0, 0, 0);
}


x86 assembly (clang, -O0):
<xyz2Step1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <equationStep1@plt>
movss  %xmm0,-0x10(%rbp)
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <equationStep1@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz2Step1>:
push   %rax
call   1030 <equationStep1@plt>
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <equationStep1@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xyz2Step1(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @equationStep1(float %7, float %8, float %9)
%11 = call float @equationStep1(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%12 = fsub float %10, %11
ret float %12
}

LLVM IR (-O2):
define float @xyz2Step1(float %0, float %1, float %2) {
%4 = tail call float @equationStep1(float %0, float %1, float %2)
%5 = tail call float @equationStep1(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%6 = fsub float %4, %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strstr(char *, char *);
int pls_get_field(char *buffer, char *value) {
  char *ptr_begin;
  char *ptr_end;
  ptr_begin = strstr(buffer, "=") + 1;
  ptr_end = strstr(buffer, "\n");
  strncpy(value, ptr_begin, (int)(ptr_end - ptr_begin));
  return 0;
}


x86 assembly (clang, -O0):
<pls_get_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strstr@plt>
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pls_get_field>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x3d,%esi
call   1040 <strchr@plt>
lea    0x1(%rax),%r15
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
sub    %r15d,%eax
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @pls_get_field(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @strstr(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %5
%10 = load i8*, i8** %3
%11 = call i8* @strstr(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %11, i8** %6
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
%20 = call i32 @strncpy(i8* %12, i8* %13, i32 %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @pls_get_field(i8* %0, i8* %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 61)
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 10)
%6 = ptrtoint i8* %5 to i64
%7 = ptrtoint i8* %4 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = tail call i32 @strncpy(i8* %1, i8* %4, i32 %9)
ret i32 0
}
void vpage_fini(struct mm *mm, struct vpage *page) {}


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

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

LLVM IR (-O0):
%struct.mm = type opaque
%struct.vpage = type opaque
define void @vpage_fini(%struct.mm* %0, %struct.vpage* %1) {
%3 = alloca %struct.mm*
%4 = alloca %struct.vpage*
store %struct.mm* %0, %struct.mm** %3
store %struct.vpage* %1, %struct.vpage** %4
ret void
}

LLVM IR (-O2):
%struct.mm = type opaque
%struct.vpage = type opaque
define void @vpage_fini(%struct.mm* nocapture %0, %struct.vpage* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msg(int, char **);
int /*<<< orphan*/ printf(char *);
int main(int ac, char **av) {
  printf("main here\n");
  msg(ac, av);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <msg@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [10 x i8] c"main here\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @msg(i32 %0, i8** %1)
ret i32 0
}
float multf(float v1, float v2) { return v1 * v2; }


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

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

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

LLVM IR (-O2):
define float @multf(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
int cmpl(const void *x, const void *y) {
  long tmp = *(long *)x - *(long *)y;
  if (tmp > 0)
    return 1;
  if (tmp)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmpl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jle    1135 <cmpl+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1153 <cmpl+0x53>
cmpq   $0x0,-0x20(%rbp)
je     114c <cmpl+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <cmpl+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpl>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setne  %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmpl(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = icmp sgt i64 %7, 0
%9 = icmp ne i64 %7, 0
%10 = sext i1 %9 to i32
%11 = select i1 %8, i32 1, i32 %10
ret i32 %11
}
void TMTimerSetRelative(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerSetRelative() {
ret void
}
int lc(int c) { return (c >= 'A' && c <= 'Z') ? c - ('A' - 'a') : c; }


x86 assembly (clang, -O0):
<lc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <lc+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <lc+0x29>
mov    -0x4(%rbp),%eax
sub    $0xffffffe0,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <lc+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lc>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, -32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @lc(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void XkbOpenDisplay() {}


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

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

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

LLVM IR (-O2):
define void @XkbOpenDisplay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ set_profiling(int /*<<< orphan*/);
int /*<<< orphan*/ to_boolean(int /*<<< orphan*/);
void primitive_profiling_impl(void) { set_profiling(to_boolean(dpop())); }


x86 assembly (clang, -O0):
<primitive_profiling_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dpop@plt>
mov    %eax,%edi
call   1050 <to_boolean@plt>
mov    %eax,%edi
call   1030 <set_profiling@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_profiling_impl>:
push   %rax
xor    %eax,%eax
call   1040 <dpop@plt>
mov    %eax,%edi
call   1050 <to_boolean@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <set_profiling@plt>

LLVM IR (-O0):
define void @primitive_profiling_impl() {
%1 = call i32 (...) @dpop()
%2 = call i32 @to_boolean(i32 %1)
%3 = call i32 @set_profiling(i32 %2)
ret void
}

LLVM IR (-O2):
define void @primitive_profiling_impl() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @to_boolean(i32 %1)
%3 = tail call i32 @set_profiling(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_CC_RSTN_OUTPUT() { set_io_bit(-6, 5); }


x86 assembly (clang, -O0):
<TOSH_MAKE_CC_RSTN_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffa,%edi
mov    $0x5,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_CC_RSTN_OUTPUT>:
mov    $0xfffffffa,%edi
mov    $0x5,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_CC_RSTN_OUTPUT() {
%1 = call i32 @set_io_bit(i32 -6, i32 5)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_CC_RSTN_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 -6, i32 5)
ret void
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ recvmsg(int, struct msghdr *, int);
ssize_t safe_recvmsg(int fd, struct msghdr *msg, int flags) {
  ssize_t r;
  for (;;) {
    r = recvmsg(fd, msg, flags);
    if (r >= 0 || errno != EINTR)
      break;
  }
  return r;
}


x86 assembly (clang, -O0):
<safe_recvmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <recvmsg@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    115a <safe_recvmsg+0x4a>
mov    0x2e99(%rip),%rax
mov    (%rax),%rax
mov    0x2e87(%rip),%rcx
cmp    (%rcx),%rax
je     115f <safe_recvmsg+0x4f>
jmp    1164 <safe_recvmsg+0x54>
jmp    1122 <safe_recvmsg+0x12>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_recvmsg>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <recvmsg@plt>
test   %rax,%rax
jns    114b <safe_recvmsg+0x3b>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <safe_recvmsg+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.msghdr = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define i64 @safe_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load %struct.msghdr*, %struct.msghdr** %5
%11 = load i32, i32* %6
%12 = call i64 @recvmsg(i32 %9, %struct.msghdr* %10, i32 %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = icmp sge i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %8
%16 = load i64, i64* @errno
%17 = load i64, i64* @EINTR
%18 = icmp ne i64 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15, %8
br label %21
20: ; preds = %15
br label %8
21: ; preds = %19
%22 = load i64, i64* %7
ret i64 %22
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define i64 @safe_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i64 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %7
ret i64 %5
}
void printResult(_Bool comparison, int n1, int n2) {
  if (comparison) {
    printf("%d and %d are amicable numbers\n", n1, n2);
  } else {
    printf("%d and %d aren't amicable numbers\n", n1, n2);
  }
}


x86 assembly (clang, -O0):
<printResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
testb  $0x1,-0x1(%rbp)
je     1149 <printResult+0x39>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115d <printResult+0x4d>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResult>:
lea    0xee9(%rip),%rcx
lea    0xf02(%rip),%rax
test   %edi,%edi
cmovne %rcx,%rax
mov    %rax,%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"%d and %d are amicable numbers\0A\00"
@.str.1 = [35 x i8] c"%d and %d aren't amicable numbers\0A\00"
define void @printResult(i1 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = zext i1 %0 to i8
store i8 %7, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8, i8* %4
%9 = trunc i8 %8 to i1
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
br label %18
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16)
br label %18
18: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"%d and %d are amicable numbers\0A\00"
@.str.1 = [35 x i8] c"%d and %d aren't amicable numbers\0A\00"
define void @printResult(i1 zeroext %0, i32 %1, i32 %2) {
%4 = select i1 %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %4, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_read_interrupt_capture(int);
void io_reset_interrupts() {
  io_read_interrupt_capture(0);
  io_read_interrupt_capture(1);
}


x86 assembly (clang, -O0):
<io_reset_interrupts>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <io_read_interrupt_capture@plt>
mov    $0x1,%edi
call   1030 <io_read_interrupt_capture@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_reset_interrupts>:
push   %rax
xor    %edi,%edi
call   1030 <io_read_interrupt_capture@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <io_read_interrupt_capture@plt>

LLVM IR (-O0):
define void @io_reset_interrupts() {
%1 = call i32 @io_read_interrupt_capture(i32 0)
%2 = call i32 @io_read_interrupt_capture(i32 1)
ret void
}

LLVM IR (-O2):
define void @io_reset_interrupts() {
%1 = tail call i32 @io_read_interrupt_capture(i32 0)
%2 = tail call i32 @io_read_interrupt_capture(i32 1)
ret void
}