xunge/DecIR huggingface dataset:
int dd_neq_dd_d(const double *a, double b) {
  return ((a[0] != b) || (a[1] != 0.0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_neq_dd_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x11(%rbp)
jne    1146 <dd_neq_dd_d+0x46>
jp     1146 <dd_neq_dd_d+0x46>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%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):
<dd_neq_dd_d>:
movsd  (%rdi),%xmm1
mov    $0x1,%eax
ucomisd %xmm0,%xmm1
jne    1111 <dd_neq_dd_d+0x11>
jnp    1112 <dd_neq_dd_d+0x12>
ret
xorpd  %xmm0,%xmm0
cmpneqsd 0x8(%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @dd_neq_dd_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 une double %7, %8
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fcmp une double %13, 0.000000e+00
br label %15
15: ; preds = %10, %2
%16 = phi i1 [ true, %2 ], [ %14, %10 ]
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
ret i32 %18
}

LLVM IR (-O2):
define i32 @dd_neq_dd_d(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp une double %3, %1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fcmp une double %7, 0.000000e+00
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ 1, %2 ], [ %9, %5 ]
ret i32 %11
}
/* Type definitions */
struct katcl_line {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sync_message_katcl(struct katcl_line *, int, char *, char *);
void usage(char *label, struct katcl_line *k) {
  sync_message_katcl(k, 2, label, "serial-device [port [serial-speed]]");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x2,%esi
lea    0xecc(%rip),%rcx
call   1030 <sync_message_katcl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rcx
mov    %rsi,%rdi
mov    $0x2,%esi
jmp    1030 <sync_message_katcl@plt>

LLVM IR (-O0):
%struct.katcl_line = type { i32 }
@.str = [36 x i8] c"serial-device [port [serial-speed]]\00"
define void @usage(i8* %0, %struct.katcl_line* %1) {
%3 = alloca i8*
%4 = alloca %struct.katcl_line*
store i8* %0, i8** %3
store %struct.katcl_line* %1, %struct.katcl_line** %4
%5 = load %struct.katcl_line*, %struct.katcl_line** %4
%6 = load i8*, i8** %3
%7 = call i32 @sync_message_katcl(%struct.katcl_line* %5, i32 2, i8* %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.katcl_line = type { i32 }
@.str = [36 x i8] c"serial-device [port [serial-speed]]\00"
define void @usage(i8* %0, %struct.katcl_line* %1) {
%3 = tail call i32 @sync_message_katcl(%struct.katcl_line* %1, i32 2, i8* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_CEuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xCE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CEuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xce,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CEuint64_midword_reg>:
test   $0xce0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CEuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 206
%6 = icmp ne i64 %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_CEuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13500416
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int M_PI;
int atan(int /*<<< orphan*/);
int /*<<< orphan*/ exp(double);
double y2lat_m(double y) {
  return (((2 * atan(exp((y / 6378137))) - M_PI / 2) * 180) / M_PI);
}


x86 assembly (clang, -O0):
<y2lat_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1030 <atan@plt>
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
imul   $0xb4,%eax,%eax
mov    0x2e73(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<y2lat_m>:
push   %rax
divsd  0xed7(%rip),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
call   1030 <atan@plt>
add    %eax,%eax
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
sub    %edx,%eax
imul   $0xb4,%eax,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @y2lat_m(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x415854A640000000
%5 = call i32 @exp(double %4)
%6 = call i32 @atan(i32 %5)
%7 = mul nsw i32 2, %6
%8 = load i32, i32* @M_PI
%9 = sdiv i32 %8, 2
%10 = sub nsw i32 %7, %9
%11 = mul nsw i32 %10, 180
%12 = load i32, i32* @M_PI
%13 = sdiv i32 %11, %12
%14 = sitofp i32 %13 to double
ret double %14
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @y2lat_m(double %0) {
%2 = fdiv double %0, 0x415854A640000000
%3 = tail call i32 @exp(double %2)
%4 = tail call i32 @atan(i32 %3)
%5 = shl nsw i32 %4, 1
%6 = load i32, i32* @M_PI
%7 = sdiv i32 %6, -2
%8 = add i32 %7, %5
%9 = mul nsw i32 %8, 180
%10 = sdiv i32 %9, %6
%11 = sitofp i32 %10 to double
ret double %11
}
void copia(void) {
  int i;
  extern char linea[], linea_max[];
  i = 0;
  while (1) {
    *(linea_max + i) = *(linea + i);
    if (*(linea_max + i) == '\0')
      break;
    i++;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2eda(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2eb4(%rip),%rax
mov    %dl,(%rax,%rcx,1)
movslq -0x4(%rbp),%rcx
mov    0x2ea6(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1144 <copia+0x44>
jmp    1152 <copia+0x52>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <copia+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
xor    %eax,%eax
mov    0x2ee7(%rip),%rsi
mov    0x2ec8(%rip),%rdx
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdx,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copia+0x10>
ret

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

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ %7, %1 ], [ 0, %0 ]
%3 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %2
store i8 %4, i8* %5
%6 = icmp eq i8 %4, 0
%7 = add nuw i64 %2, 1
br i1 %6, label %8, label %1
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ instance1(int /*<<< orphan*/);
int /*<<< orphan*/ instance2(int /*<<< orphan*/);
int /*<<< orphan*/ instance3(int /*<<< orphan*/);
int /*<<< orphan*/ instance4(int /*<<< orphan*/);
int /*<<< orphan*/ instance5(int /*<<< orphan*/);
int /*<<< orphan*/ instance6(int /*<<< orphan*/);
int /*<<< orphan*/ instance7(int /*<<< orphan*/);
int /*<<< orphan*/ instance8(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_0:
  instance1(0);
__CPROVER_ASYNC_1:
  instance2(0);
__CPROVER_ASYNC_2:
  instance3(0);
__CPROVER_ASYNC_3:
  instance4(0);
__CPROVER_ASYNC_4:
  instance5(0);
__CPROVER_ASYNC_5:
  instance6(0);
__CPROVER_ASYNC_6:
  instance7(0);
__CPROVER_ASYNC_7:
  instance8(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   10a0 <instance1@plt>
xor    %edi,%edi
call   1040 <instance2@plt>
xor    %edi,%edi
call   1080 <instance3@plt>
xor    %edi,%edi
call   1030 <instance4@plt>
xor    %edi,%edi
call   1090 <instance5@plt>
xor    %edi,%edi
call   1050 <instance6@plt>
xor    %edi,%edi
call   1070 <instance7@plt>
xor    %edi,%edi
call   1060 <instance8@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   10a0 <instance1@plt>
xor    %edi,%edi
call   1040 <instance2@plt>
xor    %edi,%edi
call   1080 <instance3@plt>
xor    %edi,%edi
call   1030 <instance4@plt>
xor    %edi,%edi
call   1090 <instance5@plt>
xor    %edi,%edi
call   1050 <instance6@plt>
xor    %edi,%edi
call   1070 <instance7@plt>
xor    %edi,%edi
call   1060 <instance8@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @instance1(i32 0)
br label %4
4: ; preds = %2
%5 = call i32 @instance2(i32 0)
br label %6
6: ; preds = %4
%7 = call i32 @instance3(i32 0)
br label %8
8: ; preds = %6
%9 = call i32 @instance4(i32 0)
br label %10
10: ; preds = %8
%11 = call i32 @instance5(i32 0)
br label %12
12: ; preds = %10
%13 = call i32 @instance6(i32 0)
br label %14
14: ; preds = %12
%15 = call i32 @instance7(i32 0)
br label %16
16: ; preds = %14
%17 = call i32 @instance8(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @instance1(i32 0)
%2 = tail call i32 @instance2(i32 0)
%3 = tail call i32 @instance3(i32 0)
%4 = tail call i32 @instance4(i32 0)
%5 = tail call i32 @instance5(i32 0)
%6 = tail call i32 @instance6(i32 0)
%7 = tail call i32 @instance7(i32 0)
%8 = tail call i32 @instance8(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ot(char *);
immed() { ot("LXI H,"); }


x86 assembly (clang, -O0):
<immed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ot@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"LXI H,\00"
define i32 @immed() {
%1 = alloca i32
%2 = call i32 @ot(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"LXI H,\00"
define i32 @immed() {
%1 = tail call i32 @ot(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ vwarn(char *, int /*<<< orphan*/);
void vdie(char *fmt, va_list ap) {
  vwarn(fmt, ap);
  exit(1);
}


x86 assembly (clang, -O0):
<vdie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vwarn@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<vdie>:
push   %rax
call   1030 <vwarn@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @vdie(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @vwarn(i8* %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @vdie(i8* %0, i32 %1) {
%3 = tail call i32 @vwarn(i8* %0, i32 %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_line(char *, int);
int main() {
  int length = 0;
  char line[1000];
  while ((length = get_line(line, 1000)) > 0) {
    reverse_line(line, length);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    118d <main+0x5d>
lea    -0x3f0(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <reverse_line@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
jmp    1149 <main+0x19>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    1186 <main+0x56>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <reverse_line@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = call i32 @reverse_line(i8* %2, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = call i32 @get_line(i8* %2, i32 1000)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
one(i) int i;
{ return i; }


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

x86 assembly (clang, -O2):
<one>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @one(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ Dfree(float *);
void dev_free_n(int na, float *a[]) {
  for (int i = 0; i < na; ++i)
    Dfree(a[i]);
}


x86 assembly (clang, -O0):
<dev_free_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <dev_free_n+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <Dfree@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <dev_free_n+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_free_n>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1142 <dev_free_n+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <Dfree@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <dev_free_n+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @dev_free_n(i32 %0, float** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds float*, float** %1, i64 %8
%10 = load float*, float** %9
%11 = tail call i32 @Dfree(float* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
void XcmsCIELabClipab() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIELabClipab() {
ret void
}
int l(int i) { return 2i; }


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

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

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

LLVM IR (-O2):
define i32 @l(i32 %0) {
ret i32 0
}
int hash(char *str, int len) {
  int i;
  for (i = 0; *str;)
    i = (i << 2) ^ *str++;
  i %= len;
  return (((i) < 0 ? -(i) : (i)));
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hash+0x41>
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <hash+0x12>
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1164 <hash+0x64>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    116a <hash+0x6a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <hash+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x2,%eax
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
jmp    1127 <hash+0x27>
xor    %eax,%eax
cltd
idiv   %esi
mov    %edx,%eax
neg    %eax
cmovs  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = shl i32 %7, 2
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %6 to i32
%12 = xor i32 %9, %11
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
%17 = srem i32 %16, %1
%18 = tail call i32 @llvm.abs.i32(i32 %17, i1 true)
ret i32 %18
}
int execute_clock_settime() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_clock_settime() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_clock_settime() {
ret i32 0
}
void __nmi_handler() {
  for (;;) {
    __asm__ volatile("nop");
  }
}


x86 assembly (clang, -O0):
<__nmi_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__nmi_handler+0x9>
nop
jmp    1109 <__nmi_handler+0x9>

x86 assembly (clang, -O2):
<__nmi_handler>:
nop
jmp    1100 <__nmi_handler>

LLVM IR (-O0):
define void @__nmi_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @__nmi_handler() {
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
void foo(void) { bar("Hello world"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define void @foo() {
%1 = call i32 @bar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define void @foo() {
%1 = tail call i32 @bar(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ write(int, char const *, size_t);
ssize_t writebuffer(int fdd, const void *buf, size_t remain) {
  ssize_t nwritten;
  const char *buffer;
  buffer = buf;
  while (remain > 0) {
    nwritten = write(fdd, buffer, remain);
    remain -= nwritten;
    buffer += nwritten;
  }
  return 0;
}


x86 assembly (clang, -O0):
<writebuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    116a <writebuffer+0x5a>
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    112b <writebuffer+0x1b>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writebuffer>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
je     1145 <writebuffer+0x35>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
add    %rax,%rbx
sub    %rax,%r14
jne    1130 <writebuffer+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @writebuffer(i32 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i8* [ %10, %5 ], [ %1, %3 ]
%7 = phi i64 [ %9, %5 ], [ %2, %3 ]
%8 = tail call i64 @write(i32 %0, i8* %6, i64 %7)
%9 = sub i64 %7, %8
%10 = getelementptr inbounds i8, i8* %6, i64 %8
%11 = icmp eq i64 %9, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void func() {
  char la[100] = "123";
  printf("%s\n", la);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x31,-0x70(%rbp)
movb   $0x32,-0x6f(%rbp)
movb   $0x33,-0x6e(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movw   $0x3231,(%rsp)
movb   $0x33,0x2(%rsp)
lea    0xeb2(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @func() {
%1 = alloca [100 x i8]
%2 = bitcast [100 x i8]* %1 to i8*
%3 = bitcast i8* %2 to [100 x i8]*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i32 0, i32 0
store i8 49, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i32 0, i32 1
store i8 50, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i32 0, i32 2
store i8 51, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @func() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i8 49, i8* %2
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
store i8 50, i8* %3
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 2
store i8 51, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
unsigned char *advanceToEmbeddingArea(unsigned char *ptr) {
  for (int i = 0; i < 4; i++) {
    while (*ptr != '\n') {
      ptr += sizeof(char);
    }
    ptr += sizeof(char);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<advanceToEmbeddingArea>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1159 <advanceToEmbeddingArea+0x59>
jmp    111e <advanceToEmbeddingArea+0x1e>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xa,%eax
je     113f <advanceToEmbeddingArea+0x3f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111e <advanceToEmbeddingArea+0x1e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <advanceToEmbeddingArea+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<advanceToEmbeddingArea>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0xa,(%rax)
lea    0x1(%rax),%rax
jne    1110 <advanceToEmbeddingArea+0x10>
nopl   0x0(%rax)
cmpb   $0xa,(%rax)
lea    0x1(%rax),%rax
jne    1120 <advanceToEmbeddingArea+0x20>
nopl   0x0(%rax)
cmpb   $0xa,(%rax)
lea    0x1(%rax),%rax
jne    1130 <advanceToEmbeddingArea+0x30>
nopl   0x0(%rax)
cmpb   $0xa,(%rax)
lea    0x1(%rax),%rax
jne    1140 <advanceToEmbeddingArea+0x40>
ret

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

LLVM IR (-O2):
define i8* @advanceToEmbeddingArea(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %6, %2 ], [ %0, %1 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 10
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2, %7
%8 = phi i8* [ %11, %7 ], [ %6, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
%11 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %10, label %12, label %7
12: ; preds = %7, %12
%13 = phi i8* [ %16, %12 ], [ %11, %7 ]
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 10
%16 = getelementptr inbounds i8, i8* %13, i64 1
br i1 %15, label %17, label %12
17: ; preds = %12, %17
%18 = phi i8* [ %21, %17 ], [ %16, %12 ]
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 10
%21 = getelementptr inbounds i8, i8* %18, i64 1
br i1 %20, label %22, label %17
22: ; preds = %17
ret i8* %21
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_pwm_set_clock(unsigned int);
int pwm_setclock(unsigned int divider) {
  bcm2835_pwm_set_clock(divider);
  return 0;
}


x86 assembly (clang, -O0):
<pwm_setclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bcm2835_pwm_set_clock@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pwm_setclock(i32 %0) {
%2 = tail call i32 @bcm2835_pwm_set_clock(i32 %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *okcash_fopen(char const *file_name, char const *mode) {
  return fopen(file_name, mode);
}


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

x86 assembly (clang, -O2):
<okcash_fopen>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @okcash_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
void changeCharacter(char *dest, const char *str, const char search,
                     const char replace) {
  while (*dest = *str) {
    if (*dest == search)
      *dest = replace;
    *dest++;
    *str++;
  }
}


x86 assembly (clang, -O0):
<changeCharacter>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1163 <changeCharacter+0x63>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <changeCharacter+0x46>
mov    -0x12(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1116 <changeCharacter+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeCharacter>:
mov    (%rsi),%r8b
mov    %r8b,(%rdi)
test   %r8b,%r8b
je     113d <changeCharacter+0x3d>
mov    $0x1,%eax
jmp    1132 <changeCharacter+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%r8d
mov    %r8b,(%rdi,%rax,1)
add    $0x1,%rax
test   %r8b,%r8b
je     113d <changeCharacter+0x3d>
cmp    %dl,%r8b
jne    1120 <changeCharacter+0x20>
mov    %cl,-0x1(%rdi,%rax,1)
jmp    1120 <changeCharacter+0x20>
ret

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

LLVM IR (-O2):
define void @changeCharacter(i8* nocapture writeonly %0, i8* nocapture %1, i8 signext %2, i8 signext %3) {
%5 = load i8, i8* %1
store i8 %5, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %4, %13
%8 = phi i8 [ %16, %13 ], [ %5, %4 ]
%9 = phi i8* [ %14, %13 ], [ %0, %4 ]
%10 = phi i8* [ %15, %13 ], [ %1, %4 ]
%11 = icmp eq i8 %8, %2
br i1 %11, label %12, label %13
12: ; preds = %7
store i8 %3, i8* %9
br label %13
13: ; preds = %12, %7
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %7
18: ; preds = %13, %4
ret void
}
void RTIsoFsOpen(void) {}


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

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

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

LLVM IR (-O2):
define void @RTIsoFsOpen() {
ret void
}
int eol_cb_func(const struct cmd_info *ci) { return 1; }


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

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

LLVM IR (-O0):
%struct.cmd_info = type opaque
define i32 @eol_cb_func(%struct.cmd_info* %0) {
%2 = alloca %struct.cmd_info*
store %struct.cmd_info* %0, %struct.cmd_info** %2
ret i32 1
}

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @eol_cb_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int no_existe_funcion(void *f) {
  if (f == NULL) {
    printf("No existe función\n");
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<no_existe_funcion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <no_existe_funcion+0x34>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <no_existe_funcion+0x40>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_existe_funcion>:
push   %rax
test   %rdi,%rdi
je     111f <no_existe_funcion+0xf>
mov    0x2ebb(%rip),%rax
jmp    1132 <no_existe_funcion+0x22>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"No existe funci\C3\B3n\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @no_existe_funcion(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* @EXIT_SUCCESS
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [19 x i8] c"No existe funci\C3\B3n\00"
define i32 @no_existe_funcion(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32* [ @EXIT_FAILURE, %3 ], [ @EXIT_SUCCESS, %1 ]
%7 = load i32, i32* %6
ret i32 %7
}
int call_dcbevent_notifiers(unsigned long val, void *v) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @call_dcbevent_notifiers(i64 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int port_access(unsigned short port) {
  static FILE *port_access_handle = NULL;
  if (port_access_handle ||
      (port_access_handle = fopen("/dev/io", "rw")) != NULL) {
    return (0);
  } else {
    return (-1);
  };
  return -1;
}


x86 assembly (clang, -O0):
<port_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
cmpq   $0x0,0x2f09(%rip)
jne    1151 <port_access+0x41>
lea    0xecc(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,0x2ee9(%rip)
cmp    $0x0,%rax
je     115d <port_access+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <port_access+0x54>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_access>:
push   %rax
xor    %eax,%eax
cmpq   $0x0,0x2f15(%rip)
je     111f <port_access+0xf>
pop    %rcx
ret
lea    0xeda(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,0x2ef7(%rip)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@port_access.port_access_handle = internal global i32* null
@.str = [8 x i8] c"/dev/io\00"
@.str.1 = [3 x i8] c"rw\00"
define i32 @port_access(i16 zeroext %0) {
%2 = alloca i32
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i32*, i32** @port_access.port_access_handle
%5 = icmp ne i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** @port_access.port_access_handle
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %11
10: ; preds = %6
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@port_access.port_access_handle = internal unnamed_addr global i32* null
@.str = [8 x i8] c"/dev/io\00"
@.str.1 = [3 x i8] c"rw\00"
define i32 @port_access(i16 zeroext %0) {
%2 = load i32*, i32** @port_access.port_access_handle
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** @port_access.port_access_handle
%6 = icmp eq i32* %5, null
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void func_b() {}


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

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

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

LLVM IR (-O2):
define void @func_b() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int n = 0;
  while (n++ < 3)
    ;
  printf("n is %d\n", n);
  printf("That's all this program does.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x3,%eax
jge    113f <main+0x2f>
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"n is %d\0A\00"
@.str.1 = [31 x i8] c"That's all this program does.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = icmp slt i32 %4, 3
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"n is %d\0A\00"
@str = [30 x i8] c"That's all this program does.\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
conv(ptr, max) char **ptr;
int max;
{
  int buf;
  *ptr -= 2;
  buf = atoi(*ptr);
  **ptr = 0;
  if (buf < 0 || buf > max)
    bad();
  return (buf);
}


x86 assembly (clang, -O0):
<conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0xfffffffffffffffe,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x10(%rbp)
jl     116e <conv+0x4e>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1175 <conv+0x55>
mov    $0x0,%al
call   1030 <bad@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    (%rdi),%rdi
add    $0xfffffffffffffffe,%rdi
mov    %rdi,(%rbx)
xor    %eax,%eax
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    (%rbx),%rax
movb   $0x0,(%rax)
test   %ebp,%ebp
js     114c <conv+0x2c>
cmp    %r14d,%ebp
jle    1153 <conv+0x33>
xor    %eax,%eax
call   1030 <bad@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @conv(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 -2
store i8* %4, i8** %0
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %4)
%6 = load i8*, i8** %0
store i8 0, i8* %6
%7 = icmp slt i32 %5, 0
%8 = icmp sgt i32 %5, %1
%9 = or i1 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bad()
br label %12
12: ; preds = %2, %10
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Data Dir");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello Data Dir\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}