xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int x = 1, y = 13, z;
  if (x > y) {
    printf("x>y");
  } else if (x < y) {
    printf("x<y");
  } else if (x == y) {
    printf("x=y");
  }
  printf("\n estoi debajo de los if/elseif");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xd,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114a <main+0x3a>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
jmp    1189 <main+0x79>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <main+0x57>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1184 <main+0x74>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    117f <main+0x6f>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    1184 <main+0x74>
jmp    1189 <main+0x79>
lea    0xe7c(%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>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"x>y\00"
@.str.1 = [4 x i8] c"x<y\00"
@.str.2 = [4 x i8] c"x=y\00"
@.str.3 = [32 x i8] c"\0A estoi debajo de los if/elseif\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 13, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %24
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %23
16: ; preds = %10
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
br label %23
23: ; preds = %22, %14
br label %24
24: ; preds = %23, %8
%25 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"x<y\00"
@.str.3 = [32 x i8] c"\0A estoi debajo de los if/elseif\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
long a(char c) { return c - 1; }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
movslq %edi,%rax
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @a(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 1
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @a(i8 signext %0) {
%2 = sext i8 %0 to i64
%3 = add nsw i64 %2, -1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ __automaton_fail();
int isMethaneLevelCritical();
int isPumpRunning();
void __utac_acc__Specification1_spec__1(void) {
  int tmp;
  int tmp___0;
  {
    { tmp = isMethaneLevelCritical(); }
    if (tmp) {
      { tmp___0 = isPumpRunning(); }
      if (tmp___0) {
        { __automaton_fail(); }
      } else {
      }
    } else {
    }
    return;
  }
}


x86 assembly (clang, -O0):
<__utac_acc__Specification1_spec__1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <isMethaneLevelCritical@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1176 <__utac_acc__Specification1_spec__1+0x46>
mov    $0x0,%al
call   1030 <isPumpRunning@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116c <__utac_acc__Specification1_spec__1+0x3c>
mov    $0x0,%al
call   1050 <__automaton_fail@plt>
jmp    1171 <__utac_acc__Specification1_spec__1+0x41>
jmp    1171 <__utac_acc__Specification1_spec__1+0x41>
jmp    117b <__utac_acc__Specification1_spec__1+0x4b>
jmp    117b <__utac_acc__Specification1_spec__1+0x4b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__utac_acc__Specification1_spec__1>:
push   %rax
xor    %eax,%eax
call   1040 <isMethaneLevelCritical@plt>
test   %eax,%eax
je     114f <__utac_acc__Specification1_spec__1+0x1f>
xor    %eax,%eax
call   1030 <isPumpRunning@plt>
test   %eax,%eax
je     114f <__utac_acc__Specification1_spec__1+0x1f>
xor    %eax,%eax
pop    %rcx
jmp    1050 <__automaton_fail@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @__utac_acc__Specification1_spec__1() {
%1 = tail call i32 (...) @isMethaneLevelCritical()
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 (...) @isPumpRunning()
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (...) @__automaton_fail()
br label %8
8: ; preds = %0, %6, %3
ret void
}
/* Type definitions */
struct tl880_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tl880_write_regbits(struct tl880_dev *, int, int, int, int);
void tl880_enable_bvdo(struct tl880_dev *tl880dev) {
  tl880_write_regbits(tl880dev, 0x10000, 1, 1, 1);
}


x86 assembly (clang, -O0):
<tl880_enable_bvdo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x10000,%esi
mov    $0x1,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <tl880_write_regbits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl880_enable_bvdo>:
mov    $0x10000,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <tl880_write_regbits@plt>

LLVM IR (-O0):
%struct.tl880_dev = type { i32 }
define void @tl880_enable_bvdo(%struct.tl880_dev* %0) {
%2 = alloca %struct.tl880_dev*
store %struct.tl880_dev* %0, %struct.tl880_dev** %2
%3 = load %struct.tl880_dev*, %struct.tl880_dev** %2
%4 = call i32 @tl880_write_regbits(%struct.tl880_dev* %3, i32 65536, i32 1, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
%struct.tl880_dev = type { i32 }
define void @tl880_enable_bvdo(%struct.tl880_dev* %0) {
%2 = tail call i32 @tl880_write_regbits(%struct.tl880_dev* %0, i32 65536, i32 1, i32 1, i32 1)
ret void
}
int test_imm_52int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x52 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_52int64_midword_mem>:
testb  $0x52,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_52int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5373952
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float lerp_float(const float a, const float b, const float t) {
  return (1.0f - t) * a + t * b;
}


x86 assembly (clang, -O0):
<lerp_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xee5(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp_float>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp_float(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* %6
%8 = fsub float 1.000000e+00, %7
%9 = load float, float* %4
%10 = load float, float* %6
%11 = load float, float* %5
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %8, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @lerp_float(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %4, float %0, float %5)
ret float %6
}
int stdimpl_strcpy(char *out, const char *in) {
  int length = 0;
  while (*out++ = *in++)
    length++;
  return length;
}


x86 assembly (clang, -O0):
<stdimpl_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114b <stdimpl_strcpy+0x4b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <stdimpl_strcpy+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdimpl_strcpy>:
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     1122 <stdimpl_strcpy+0x22>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
mov    %cl,0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <stdimpl_strcpy+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stdimpl_strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ 0, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = add nuw nsw i32 %6, 1
%12 = load i8, i8* %10
store i8 %12, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ rand();
void populate_key(uint8_t *key, size_t len) {
  size_t i;
  for (i = 0; i < len; i++) {
    key[i] = rand();
  }
}


x86 assembly (clang, -O0):
<populate_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115b <populate_key+0x4b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <populate_key+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<populate_key>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1144 <populate_key+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <populate_key+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @populate_key(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %15, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32*, i32** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32 %11, i32* %14
br label %15
15: ; preds = %10
%16 = load i64, i64* %5
%17 = add i64 %16, 1
store i64 %17, i64* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @populate_key(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = tail call i32 (...) @rand()
%7 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %6, i32* %7
%8 = add nuw i64 %5, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
void SPI_1_ScbModeStop(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_1_ScbModeStop() {
ret void
}
int fun_coverage_if_noelse(int x) {
  if (x == 5) {
    return 8;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fun_coverage_if_noelse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    111d <fun_coverage_if_noelse+0x1d>
movl   $0x8,-0x4(%rbp)
jmp    1124 <fun_coverage_if_noelse+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_coverage_if_noelse>:
xor    %eax,%eax
cmp    $0x5,%edi
sete   %al
shl    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @fun_coverage_if_noelse(i32 %0) {
%2 = icmp eq i32 %0, 5
%3 = select i1 %2, i32 8, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
float Subtraction(float a, float b) {
  printf("\nResult of Subtracting %.2f and %.2f is %.2f.", a, b, a - b);
  return a - b;
}


x86 assembly (clang, -O0):
<Subtraction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Subtraction>:
push   %rax
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
movss  %xmm2,0x4(%rsp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [46 x i8] c"\0AResult of Subtracting %.2f and %.2f is %.2f.\00"
define float @Subtraction(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 = load float, float* %3
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), float %5, float %6, float %9)
%11 = load float, float* %3
%12 = load float, float* %4
%13 = fsub float %11, %12
ret float %13
}

LLVM IR (-O2):
@.str = [46 x i8] c"\0AResult of Subtracting %.2f and %.2f is %.2f.\00"
define float @Subtraction(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), float %0, float %1, float %3)
ret float %3
}
/* Type definitions */
struct user_regs_struct {
  long rip;
};

/* Variables and functions */
long ptrace_ip(struct user_regs_struct *regs) { return regs->rip; }


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

x86 assembly (clang, -O2):
<ptrace_ip>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.user_regs_struct = type { i64 }
define i64 @ptrace_ip(%struct.user_regs_struct* %0) {
%2 = alloca %struct.user_regs_struct*
store %struct.user_regs_struct* %0, %struct.user_regs_struct** %2
%3 = load %struct.user_regs_struct*, %struct.user_regs_struct** %2
%4 = getelementptr inbounds %struct.user_regs_struct, %struct.user_regs_struct* %3, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i64 }
define i64 @ptrace_ip(%struct.user_regs_struct* nocapture %0) {
%2 = getelementptr inbounds %struct.user_regs_struct, %struct.user_regs_struct* %0, i64 0, i32 0
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
void open_measurements(FILE **file, char **path) {
  *file = fopen(*path, "r");
  if (*file == 0) {
    printf("ERROR: Could not open file\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<open_measurements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1185 <open_measurements+0x55>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_measurements>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%rdi
lea    0xec2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     114d <open_measurements+0x1d>
pop    %rbx
ret
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [28 x i8] c"ERROR: Could not open file\0A\00"
@EXIT_FAILURE = global i32 0
define void @open_measurements(i32** %0, i8** %1) {
%3 = alloca i32**
%4 = alloca i8**
store i32** %0, i32*** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i32**, i32*** %3
store i32* %7, i32** %8
%9 = load i32**, i32*** %3
%10 = load i32*, i32** %9
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@EXIT_FAILURE = global i32 0
@str = [27 x i8] c"ERROR: Could not open file\00"
define void @open_measurements(i32** nocapture writeonly %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %4, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
long long gccbugs_lldiv(long long a, long long b) { return a / b; }


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

x86 assembly (clang, -O2):
<gccbugs_lldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <gccbugs_lldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
define i64 @gccbugs_lldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float float32(uint32_t i) {
  i <<= 8;
  return *(float *)&i;
}


x86 assembly (clang, -O0):
<float32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float32>:
shl    $0x8,%edi
movd   %edi,%xmm0
ret

LLVM IR (-O0):
define float @float32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
store i32 %4, i32* %2
%5 = bitcast i32* %2 to float*
%6 = load float, float* %5
ret float %6
}

LLVM IR (-O2):
define float @float32(i32 %0) {
%2 = shl i32 %0, 8
%3 = bitcast i32 %2 to float
ret float %3
}
/* Variables and functions */
scalar_t__ rational_compare(long double *, long double *);
int /*<<< orphan*/ rational_sub(long double *, long double *, long double *);
int small_enough(long double *min, long double *max, long double *delta) {
  long double tmp;
  rational_sub(max, min, &tmp);
  if (rational_compare(&tmp, delta) > 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<small_enough>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <rational_sub@plt>
mov    -0x20(%rbp),%rsi
lea    -0x30(%rbp),%rdi
call   1040 <rational_compare@plt>
cmp    $0x0,%rax
jle    1168 <small_enough+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116f <small_enough+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_enough>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %rdi,%rax
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1030 <rational_sub@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <rational_compare@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
mov    %ecx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @small_enough(x86_fp80* %0, x86_fp80* %1, x86_fp80* %2) {
%4 = alloca i32
%5 = alloca x86_fp80*
%6 = alloca x86_fp80*
%7 = alloca x86_fp80*
%8 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %5
store x86_fp80* %1, x86_fp80** %6
store x86_fp80* %2, x86_fp80** %7
%9 = load x86_fp80*, x86_fp80** %6
%10 = load x86_fp80*, x86_fp80** %5
%11 = call i32 @rational_sub(x86_fp80* %9, x86_fp80* %10, x86_fp80* %8)
%12 = load x86_fp80*, x86_fp80** %7
%13 = call i64 @rational_compare(x86_fp80* %8, x86_fp80* %12)
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 0, i32* %4
br label %17
16: ; preds = %3
store i32 1, i32* %4
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @small_enough(x86_fp80* %0, x86_fp80* %1, x86_fp80* %2) {
%4 = alloca x86_fp80
%5 = bitcast x86_fp80* %4 to i8*
%6 = call i32 @rational_sub(x86_fp80* %1, x86_fp80* %0, x86_fp80* %4)
%7 = call i64 @rational_compare(x86_fp80* %4, x86_fp80* %2)
%8 = icmp slt i64 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ft_memcpy(char *, char const *, size_t);
char *malloc(size_t);
char *ft_strndup(const char *s, size_t n) {
  char *str;
  str = malloc(n + 1);
  if (str) {
    ft_memcpy(str, s, n);
    str[n] = 0;
  }
  return (str);
}


x86 assembly (clang, -O0):
<ft_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1169 <ft_strndup+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <ft_memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114f <ft_strndup+0x2f>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <ft_memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @ft_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @ft_memcpy(i8* %4, i8* %0, i64 %1)
%8 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %8
br label %9
9: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
char const *vp_file_read(char *);
const char *vp_pipe_read(char *args) { return vp_file_read(args); }


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

x86 assembly (clang, -O2):
<vp_pipe_read>:
jmp    1030 <vp_file_read@plt>

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

LLVM IR (-O2):
define i8* @vp_pipe_read(i8* %0) {
%2 = tail call i8* @vp_file_read(i8* %0)
ret i8* %2
}
void ajMemStat(const char *title) {
  (void)title;
  return;
}


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

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

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

LLVM IR (-O2):
define void @ajMemStat(i8* nocapture %0) {
ret void
}
/* Variables and functions */
double ThirdP(double);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double Number, Cube;
  printf("Input number to be cubed\n");
  scanf("%lf", &Number);
  getchar();
  Cube = ThirdP(Number);
  printf("The number cubed is: %lf\n", Cube);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsd  -0x10(%rbp),%xmm0
call   1060 <ThirdP@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
movsd  (%rsp),%xmm0
call   1070 <ThirdP@plt>
lea    0xe80(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Input number to be cubed\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [26 x i8] c"The number cubed is: %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = call i32 (...) @getchar()
%7 = load double, double* %2
%8 = call double @ThirdP(double %7)
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [26 x i8] c"The number cubed is: %lf\0A\00"
@str = [25 x i8] c"Input number to be cubed\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = call i32 (...) @getchar()
%6 = load double, double* %1
%7 = call double @ThirdP(double %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t align_offset(int64_t offset, int n) {
  offset = (offset + n - 1) & ~(n - 1);
  return offset;
}


x86 assembly (clang, -O0):
<align_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_offset>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
neg    %esi
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @align_offset(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 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = xor i32 %10, -1
%12 = and i32 %8, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @align_offset(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %4, %5
ret i32 %6
}
void s3c_i2c5_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_i2c5_setname(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int add(int, int);
int main(int argc, char *argv[]) { return add(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 1, i32 2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ done();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void fail() {
  (void)kill(0, SIGTERM);
  done();
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1040 <kill@plt>
mov    $0x0,%al
call   1030 <done@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <done@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @fail() {
%1 = load i32, i32* @SIGTERM
%2 = call i32 @kill(i32 0, i32 %1)
%3 = call i32 (...) @done()
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @fail() {
%1 = load i32, i32* @SIGTERM
%2 = tail call i32 @kill(i32 0, i32 %1)
%3 = tail call i32 (...) @done()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_SPHL();
void do0xF9() { _I8080_SPHL(); }


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

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

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

LLVM IR (-O2):
define void @do0xF9() {
%1 = tail call i32 (...) @_I8080_SPHL()
ret void
}
void _vMagWrite(unsigned char *pszTrack2, unsigned char *pszTrack3) {}


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

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

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

LLVM IR (-O2):
define void @_vMagWrite(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int test_imm_39int8_mem(signed char *val) {
  return ((*val) & (-0x39 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_39int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffc7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_39int8_mem>:
testb  $0xc7,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_39int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -57
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int fchown(int fd, uid_t owner, gid_t group) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fchown>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fchown(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
void bne() {
  asm volatile("popq %%rbx\n\t"
               "popq %%rax\n\t"
               "test %%rax, %%rax\n\t"
               "jnz _skipbne\n\t"
               "jmp *%%rbx\n\t"
               "_skipbne:\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<bne>:
push   %rbp
mov    %rsp,%rbp
pop    %rbx
pop    %rax
test   %rax,%rax
jne    1111 <_skipbne>
jmp    *%rbx

x86 assembly (clang, -O2):
<bne>:
pop    %rbx
pop    %rax
test   %rax,%rax
jne    1109 <_skipbne>
jmp    *%rbx

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

LLVM IR (-O2):
define void @bne() {
tail call void asm sideeffect "popq %rbx\0A\09popq %rax\0A\09test %rax, %rax\0A\09jnz _skipbne\0A\09jmp *%rbx\0A\09_skipbne:\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ VIM_HIF_GetReg8(int);
unsigned long VIM_MARB_GetThumbbufEndAddr(void) {
  unsigned long Temp = 0;
  Temp = (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x00F)));
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x00E))) << 8;
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x00D))) << 16;
  return Temp;
}


x86 assembly (clang, -O0):
<VIM_MARB_GetThumbbufEndAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x240f,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,-0x8(%rbp)
mov    $0x240e,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x240d,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_MARB_GetThumbbufEndAddr>:
push   %r14
push   %rbx
push   %rax
mov    $0x240f,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%r14
mov    $0x240e,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%rbx
shl    $0x8,%rbx
or     %r14,%rbx
mov    $0x240d,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @VIM_MARB_GetThumbbufEndAddr() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i64 @VIM_HIF_GetReg8(i32 9231)
store i64 %2, i64* %1
%3 = call i64 @VIM_HIF_GetReg8(i32 9230)
%4 = shl i64 %3, 8
%5 = load i64, i64* %1
%6 = or i64 %5, %4
store i64 %6, i64* %1
%7 = call i64 @VIM_HIF_GetReg8(i32 9229)
%8 = shl i64 %7, 16
%9 = load i64, i64* %1
%10 = or i64 %9, %8
store i64 %10, i64* %1
%11 = load i64, i64* %1
ret i64 %11
}

LLVM IR (-O2):
define i64 @VIM_MARB_GetThumbbufEndAddr() {
%1 = tail call i64 @VIM_HIF_GetReg8(i32 9231)
%2 = tail call i64 @VIM_HIF_GetReg8(i32 9230)
%3 = shl i64 %2, 8
%4 = or i64 %3, %1
%5 = tail call i64 @VIM_HIF_GetReg8(i32 9229)
%6 = shl i64 %5, 16
%7 = or i64 %4, %6
ret i64 %7
}
int e_bukva(char c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<e_bukva>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <e_bukva+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <e_bukva+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <e_bukva+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_bukva>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @e_bukva(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @e_bukva(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ uart_send_byte(int);
void outbyte(int c) { uart_send_byte(c); }


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

x86 assembly (clang, -O2):
<outbyte>:
jmp    1030 <uart_send_byte@plt>

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

LLVM IR (-O2):
define void @outbyte(i32 %0) {
%2 = tail call i32 @uart_send_byte(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void termination_hdlr(int signum) { printf("Quiting\n"); }


x86 assembly (clang, -O0):
<termination_hdlr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Quiting\0A\00"
define void @termination_hdlr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"Quiting\00"
define void @termination_hdlr(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int find_device_by_ifaddrs();
int find_device_by_ioctl();
int find_device_by_sysfs();
int find_device(void) {
  int rc;
  rc = find_device_by_ifaddrs();
  if (rc >= 0)
    goto out;
  rc = find_device_by_sysfs();
  if (rc >= 0)
    goto out;
  rc = find_device_by_ioctl();
out:
  return rc;
}


x86 assembly (clang, -O0):
<find_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <find_device_by_ifaddrs@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1151 <find_device+0x21>
jmp    1174 <find_device+0x44>
mov    $0x0,%al
call   1030 <find_device_by_sysfs@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     116a <find_device+0x3a>
jmp    1174 <find_device+0x44>
mov    $0x0,%al
call   1040 <find_device_by_ioctl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_device>:
push   %rax
xor    %eax,%eax
call   1050 <find_device_by_ifaddrs@plt>
test   %eax,%eax
jns    1147 <find_device+0x17>
xor    %eax,%eax
call   1030 <find_device_by_sysfs@plt>
test   %eax,%eax
js     1149 <find_device+0x19>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <find_device_by_ioctl@plt>

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

LLVM IR (-O2):
define i32 @find_device() {
%1 = tail call i32 (...) @find_device_by_ifaddrs()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 (...) @find_device_by_sysfs()
%5 = icmp sgt i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (...) @find_device_by_ioctl()
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32 [ %1, %0 ], [ %4, %3 ], [ %7, %6 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ ft_putwchar_fd(int /*<<< orphan*/, int);
void ft_putwstr_fd(wchar_t const *str, int fd) {
  while (*str)
    ft_putwchar_fd(*str++, fd);
}


x86 assembly (clang, -O0):
<ft_putwstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114e <ft_putwstr_fd+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <ft_putwchar_fd@plt>
jmp    111f <ft_putwstr_fd+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putwstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1143 <ft_putwstr_fd+0x33>
mov    %esi,%ebp
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%esi
call   1030 <ft_putwchar_fd@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <ft_putwstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putwstr_fd(i64* nocapture %0, i32 %1) {
%3 = load i64, i64* %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = trunc i64 %6 to i32
%10 = tail call i32 @ft_putwchar_fd(i32 %9, i32 %1)
%11 = load i64, i64* %8
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
void I2CMasterStop(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0xA4)))) |= (0x00000002u);
}


x86 assembly (clang, -O0):
<I2CMasterStop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa4,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterStop>:
add    $0xa4,%edi
orl    $0x2,(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterStop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 164
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @I2CMasterStop(i32 %0) {
%2 = add i32 %0, 164
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 2
store volatile i32 %6, i32* %4
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
unsigned get_level_info(uint64_t topology, unsigned level) {
  return (topology >> (56 - level * 8)) & 0xff;
}


x86 assembly (clang, -O0):
<get_level_info>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x3,%edx
mov    $0x38,%ecx
sub    %edx,%ecx
sar    %cl,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_level_info>:
shl    $0x3,%sil
mov    $0x38,%cl
sub    %sil,%cl
sar    %cl,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @get_level_info(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 = mul i32 %6, 8
%8 = sub i32 56, %7
%9 = ashr i32 %5, %8
%10 = and i32 %9, 255
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_level_info(i32 %0, i32 %1) {
%3 = mul i32 %1, -8
%4 = add i32 %3, 56
%5 = ashr i32 %0, %4
%6 = and i32 %5, 255
ret i32 %6
}