xunge/DecIR huggingface dataset:
/* Variables and functions */
float pow(float, double);
float fun(float x) { return pow(x, -1.0 / 3.0) + x / 10; }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movss  -0x4(%rbp),%xmm1
movss  0xec4(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
movss  %xmm0,0x4(%rsp)
movsd  0xee1(%rip),%xmm1
call   1030 <pow@plt>
movss  0x4(%rsp),%xmm1
divss  0xed6(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fun(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @pow(float %3, double 0xBFD5555555555555)
%5 = load float, float* %2
%6 = fdiv float %5, 1.000000e+01
%7 = fadd float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @fun(float %0) {
%2 = tail call float @pow(float %0, double 0xBFD5555555555555)
%3 = fdiv float %0, 1.000000e+01
%4 = fadd float %3, %2
ret float %4
}
void spd_set_drb(void) {
  unsigned end_of_memory;
  unsigned char device;
  end_of_memory = 0;
  device = 0x50;
  while (device <= 0x53) {
    unsigned side1_bits, side2_bits;
    int byte, byte2;
    side1_bits = side2_bits = -1;
    if (side1_bits < 8) {
      end_of_memory += (1 << side1_bits);
    }
    device += 1;
  }
}


x86 assembly (clang, -O0):
<spd_set_drb>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x50,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x53,%eax
jg     1153 <spd_set_drb+0x53>
movl   $0xffffffff,-0x10(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jae    1144 <spd_set_drb+0x44>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movzbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x5(%rbp)
jmp    110f <spd_set_drb+0xf>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @spd_set_drb() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i8 80, i8* %2
br label %7
7: ; preds = %19, %0
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 83
br i1 %10, label %11, label %24
11: ; preds = %7
store i32 -1, i32* %4
store i32 -1, i32* %3
%12 = load i32, i32* %3
%13 = icmp ult i32 %12, 8
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %3
%16 = shl i32 1, %15
%17 = load i32, i32* %1
%18 = add i32 %17, %16
store i32 %18, i32* %1
br label %19
19: ; preds = %14, %11
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = add nsw i32 %21, 1
%23 = trunc i32 %22 to i8
store i8 %23, i8* %2
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @spd_set_drb() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t f() {
  uint64_t i, sum = 0, sum_of_squares = 0;
  for (i = 0; i < 101; i++) {
    sum += i;
    sum_of_squares += i * i;
  }
  uint64_t squared_sum = sum * sum;
  return squared_sum - sum_of_squares;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x65,-0x4(%rbp)
jge    1147 <f+0x47>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1119 <f+0x19>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %1
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 101
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %1
%13 = load i32, i32* %1
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
br label %17
17: ; preds = %8
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %5
20: ; preds = %5
%21 = load i32, i32* %2
%22 = load i32, i32* %2
%23 = mul nsw i32 %21, %22
store i32 %23, i32* %4
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = sub nsw i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @f() {
ret i32 25164150
}
/* Variables and functions */
int /*<<< orphan*/ ex1();
int /*<<< orphan*/ ex2();
int /*<<< orphan*/ ex3();
int /*<<< orphan*/ ex4();
int /*<<< orphan*/ ex5();
int /*<<< orphan*/ ex6();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  srand(time(NULL));
  print("LISTA DE EXERCICIOS DE FDA - 01");
  ex1();
  ex2();
  ex3();
  ex4();
  ex5();
  ex6();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xe33(%rip),%rdi
call   1060 <print@plt>
mov    $0x0,%al
call   1040 <ex1@plt>
mov    $0x0,%al
call   10c0 <ex2@plt>
mov    $0x0,%al
call   1050 <ex3@plt>
mov    $0x0,%al
call   10b0 <ex4@plt>
mov    $0x0,%al
call   1030 <ex5@plt>
mov    $0x0,%al
call   1090 <ex6@plt>
mov    $0x0,%al
call   1080 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xe4a(%rip),%rdi
call   1060 <print@plt>
xor    %eax,%eax
call   1040 <ex1@plt>
xor    %eax,%eax
call   10c0 <ex2@plt>
xor    %eax,%eax
call   1050 <ex3@plt>
xor    %eax,%eax
call   10b0 <ex4@plt>
xor    %eax,%eax
call   1030 <ex5@plt>
xor    %eax,%eax
call   1090 <ex6@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"LISTA DE EXERCICIOS DE FDA - 01\00"
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 @time(i32* null)
%7 = call i32 @srand(i32 %6)
%8 = call i32 @print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @ex1()
%10 = call i32 (...) @ex2()
%11 = call i32 (...) @ex3()
%12 = call i32 (...) @ex4()
%13 = call i32 (...) @ex5()
%14 = call i32 (...) @ex6()
%15 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"LISTA DE EXERCICIOS DE FDA - 01\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 @print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @ex1()
%7 = tail call i32 (...) @ex2()
%8 = tail call i32 (...) @ex3()
%9 = tail call i32 (...) @ex4()
%10 = tail call i32 (...) @ex5()
%11 = tail call i32 (...) @ex6()
%12 = tail call i32 (...) @getchar()
ret i32 0
}
void INT1_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @INT1_intr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pulseRatio(int, float);
void set_speed(float speed) {
  pulseRatio(17, speed);
  pulseRatio(10, speed);
}


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

x86 assembly (clang, -O2):
<set_speed>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x11,%edi
call   1030 <pulseRatio@plt>
mov    $0xa,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <pulseRatio@plt>

LLVM IR (-O0):
define void @set_speed(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @pulseRatio(i32 17, float %3)
%5 = load float, float* %2
%6 = call i32 @pulseRatio(i32 10, float %5)
ret void
}

LLVM IR (-O2):
define void @set_speed(float %0) {
%2 = tail call i32 @pulseRatio(i32 17, float %0)
%3 = tail call i32 @pulseRatio(i32 10, float %0)
ret void
}
int main() {
  struct base {
    int basic;
  };
  struct derived {
    struct base common;
    char extra;
  };
  volatile struct base b;
  volatile struct base *bp;
  bp = (struct base *)&b;
  bp->basic = 10;
  ((struct derived volatile *)bp)->extra = 'x';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x78,0x4(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0xa,-0x4(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.base = type { i32 }
%struct.derived = type { %struct.base, i8 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.base
%3 = alloca %struct.base*
store i32 0, i32* %1
store %struct.base* %2, %struct.base** %3
%4 = load %struct.base*, %struct.base** %3
%5 = getelementptr inbounds %struct.base, %struct.base* %4, i32 0, i32 0
store volatile i32 10, i32* %5
%6 = load %struct.base*, %struct.base** %3
%7 = bitcast %struct.base* %6 to %struct.derived*
%8 = getelementptr inbounds %struct.derived, %struct.derived* %7, i32 0, i32 1
store volatile i8 120, i8* %8
ret i32 0
}

LLVM IR (-O2):
%struct.base = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 10, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_MGW_fname(char *, char *, char *);
void set_MGW_statusfname(char *fname, char *NXTaddr) {
  set_MGW_fname(fname, "status", NXTaddr);
}


x86 assembly (clang, -O0):
<set_MGW_statusfname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <set_MGW_fname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_MGW_statusfname>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <set_MGW_fname@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"status\00"
define void @set_MGW_statusfname(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 @set_MGW_fname(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"status\00"
define void @set_MGW_statusfname(i8* %0, i8* %1) {
%3 = tail call i32 @set_MGW_fname(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int *get_current_hof(int *);
int *get_current_iof(int *);
int /*<<< orphan*/ get_egress_if(int *);
int /*<<< orphan*/ get_ingress_if(int *);
uint16_t get_fwd_if(uint8_t *buf) {
  uint8_t *iof = get_current_iof(buf);
  uint8_t *hof = get_current_hof(buf);
  if (*iof & 0x01)
    return get_ingress_if(hof);
  return get_egress_if(hof);
}


x86 assembly (clang, -O0):
<get_fwd_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <get_current_iof@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <get_current_hof@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1189 <get_fwd_if+0x49>
mov    -0x20(%rbp),%rdi
call   1040 <get_ingress_if@plt>
mov    %eax,-0x4(%rbp)
jmp    1195 <get_fwd_if+0x55>
mov    -0x20(%rbp),%rdi
call   1030 <get_egress_if@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fwd_if>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <get_current_iof@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <get_current_hof@plt>
testb  $0x1,(%r14)
jne    116c <get_fwd_if+0x2c>
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <get_egress_if@plt>
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <get_ingress_if@plt>

LLVM IR (-O0):
define i32 @get_fwd_if(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32* @get_current_iof(i32* %6)
store i32* %7, i32** %4
%8 = load i32*, i32** %3
%9 = call i32* @get_current_hof(i32* %8)
store i32* %9, i32** %5
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = and i32 %11, 1
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i32*, i32** %5
%16 = call i32 @get_ingress_if(i32* %15)
store i32 %16, i32* %2
br label %20
17: ; preds = %1
%18 = load i32*, i32** %5
%19 = call i32 @get_egress_if(i32* %18)
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_fwd_if(i32* %0) {
%2 = tail call i32* @get_current_iof(i32* %0)
%3 = tail call i32* @get_current_hof(i32* %0)
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @get_ingress_if(i32* %3)
br label %11
9: ; preds = %1
%10 = tail call i32 @get_egress_if(i32* %3)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
int *foo6(int **a, int ***b) { return __sync_lock_test_and_set(a, b); }


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

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

LLVM IR (-O0):
define i32* @foo6(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 = bitcast i32** %5 to i64*
%7 = load i32***, i32**** %4
%8 = bitcast i32*** %7 to i32*
%9 = ptrtoint i32* %8 to i64
%10 = atomicrmw xchg i64* %6, i64 %9 seq_cst
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
define i32* @foo6(i32** nocapture %0, i32*** %1) {
%3 = bitcast i32** %0 to i64*
%4 = ptrtoint i32*** %1 to i64
%5 = atomicrmw xchg i64* %3, i64 %4 seq_cst
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
void printarray(int a[], int n) {}


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

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

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

LLVM IR (-O2):
define void @printarray(i32* nocapture %0, i32 %1) {
ret void
}
void X509_NAME_hash(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_hash() {
ret void
}
void skip_to_semi(cfile) struct parse *cfile;
{ skip_to_rbrace(cfile, 0); }


x86 assembly (clang, -O0):
<skip_to_semi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <skip_to_rbrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_to_semi>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <skip_to_rbrace@plt>

LLVM IR (-O0):
%struct.parse = type opaque
define void @skip_to_semi(%struct.parse* %0) {
%2 = alloca %struct.parse*
store %struct.parse* %0, %struct.parse** %2
%3 = load %struct.parse*, %struct.parse** %2
%4 = call i32 (%struct.parse*, i32, ...) bitcast (i32 (...)* @skip_to_rbrace to i32 (%struct.parse*, i32, ...)*)(%struct.parse* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.parse = type opaque
define void @skip_to_semi(%struct.parse* %0) {
%2 = tail call i32 (%struct.parse*, i32, ...) bitcast (i32 (...)* @skip_to_rbrace to i32 (%struct.parse*, i32, ...)*)(%struct.parse* %0, i32 0)
ret void
}
void bigint_mul(unsigned char *r, const unsigned char *x, unsigned long xlen,
                const unsigned char *y, unsigned long ylen) {}


x86 assembly (clang, -O0):
<bigint_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bigint_mul(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
ret void
}

LLVM IR (-O2):
define void @bigint_mul(i8* nocapture %0, i8* nocapture %1, i64 %2, i8* nocapture %3, i64 %4) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ optval;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int errno;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket_init(int fd) {
  int optval = 1;
  int err = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
  if (err == -1)
    return errno;
  return 0;
}


x86 assembly (clang, -O0):
<socket_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1164 <socket_init+0x54>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <socket_init+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_init>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
jne    114d <socket_init+0x3d>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@errno = global i32 0
define i32 @socket_init(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_REUSEADDR
%9 = call i32 @setsockopt(i32 %6, i32 %7, i32 %8, i32* %4, i32 4)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* @errno
store i32 %13, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@errno = global i32 0
define i32 @socket_init(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
%7 = icmp eq i32 %6, -1
%8 = load i32, i32* @errno
%9 = select i1 %7, i32 %8, i32 0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rand();
int rnd(int min, int max) {
  assert(min < max);
  if (max != min) {
    return rand() % (max - min) + min;
  } else {
    return max;
  }
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1168 <rnd+0x48>
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x4(%rbp)
jmp    116e <rnd+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
xor    %edi,%edi
cmp    %r14d,%esi
setg   %dil
call   1030 <assert@plt>
mov    %ebp,%ebx
sub    %r14d,%ebx
je     114d <rnd+0x2d>
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%ebp
add    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rnd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %1, %0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = tail call i32 (...) @rand()
%9 = sub nsw i32 %1, %0
%10 = srem i32 %8, %9
%11 = add nsw i32 %10, %0
br label %12
12: ; preds = %2, %7
%13 = phi i32 [ %11, %7 ], [ %1, %2 ]
ret i32 %13
}
int fs_iso9660_probe(int fd, long long offs) { return -1; }


x86 assembly (clang, -O0):
<fs_iso9660_probe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fs_iso9660_probe(i32 %0, i64 %1) {
ret i32 -1
}
int test_imm_E4uint16_reg(unsigned short val) {
  return ((val) & (0xE4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E4uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xe4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E4uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 228
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Open Source SW Project\n");
  printf("First GitHub Training\n");
  printf("commit training\n");
  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>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xef1(%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 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Open Source SW Project\0A\00"
@.str.1 = [23 x i8] c"First GitHub Training\0A\00"
@.str.2 = [17 x i8] c"commit training\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Open Source SW Project\00"
@str.3 = [22 x i8] c"First GitHub Training\00"
@str.4 = [16 x i8] c"commit training\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ Com_CharIsOneOfCharset(char, char *);
char *Com_SkipCharset(char *s, char *sep) {
  char *p = s;
  while (p) {
    if (Com_CharIsOneOfCharset(*p, sep))
      p++;
    else
      break;
  }
  return p;
}


x86 assembly (clang, -O0):
<Com_SkipCharset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116a <Com_SkipCharset+0x5a>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <Com_CharIsOneOfCharset@plt>
cmp    $0x0,%rax
je     1160 <Com_SkipCharset+0x50>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1165 <Com_SkipCharset+0x55>
jmp    116a <Com_SkipCharset+0x5a>
jmp    1128 <Com_SkipCharset+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_SkipCharset>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1147 <Com_SkipCharset+0x37>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
mov    %r14,%rsi
call   1030 <Com_CharIsOneOfCharset@plt>
test   %rax,%rax
jne    1130 <Com_SkipCharset+0x20>
jmp    1149 <Com_SkipCharset+0x39>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @Com_SkipCharset(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = load i8, i8* %5
%7 = tail call i64 @Com_CharIsOneOfCharset(i8 signext %6, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %8, label %10, label %4
10: ; preds = %4, %2
%11 = phi i8* [ null, %2 ], [ %5, %4 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  printf("%lu\n", time(NULL));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
struct waitq_link *waitq_link_create_protected(struct waitq_link *uwql) {
  return uwql;
}


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

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

LLVM IR (-O0):
%struct.waitq_link = type opaque
define %struct.waitq_link* @waitq_link_create_protected(%struct.waitq_link* %0) {
%2 = alloca %struct.waitq_link*
store %struct.waitq_link* %0, %struct.waitq_link** %2
%3 = load %struct.waitq_link*, %struct.waitq_link** %2
ret %struct.waitq_link* %3
}

LLVM IR (-O2):
%struct.waitq_link = type opaque
define %struct.waitq_link* @waitq_link_create_protected(%struct.waitq_link* readnone returned %0) {
ret %struct.waitq_link* %0
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _xymodem_send_file(struct terminal *, int, char *);
int cmd_xmodem_send(struct terminal *tm, int argc, char **argv) {
  if (argc != 2)
    return -1;
  _xymodem_send_file(tm, 128, argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<cmd_xmodem_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2,-0x14(%rbp)
je     1139 <cmd_xmodem_send+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <cmd_xmodem_send+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x80,%esi
call   1030 <_xymodem_send_file@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_xmodem_send>:
mov    $0xffffffff,%eax
cmp    $0x2,%esi
jne    112f <cmd_xmodem_send+0x1f>
push   %rax
mov    0x8(%rdx),%rdx
mov    $0x80,%esi
call   1030 <_xymodem_send_file@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
%struct.terminal = type { i32 }
define i32 @cmd_xmodem_send(%struct.terminal* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.terminal*
%6 = alloca i32
%7 = alloca i8**
store %struct.terminal* %0, %struct.terminal** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 -1, i32* %4
br label %17
11: ; preds = %3
%12 = load %struct.terminal*, %struct.terminal** %5
%13 = load i8**, i8*** %7
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @_xymodem_send_file(%struct.terminal* %12, i32 128, i8* %15)
store i32 0, i32* %4
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
define i32 @cmd_xmodem_send(%struct.terminal* %0, i32 %1, i8** nocapture %2) {
%4 = icmp eq i32 %1, 2
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = getelementptr inbounds i8*, i8** %2, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @_xymodem_send_file(%struct.terminal* %0, i32 128, i8* %7)
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ 0, %5 ], [ -1, %3 ]
ret i32 %10
}
void xt_core_do_nothing() {}


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

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

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

LLVM IR (-O2):
define void @xt_core_do_nothing() {
ret void
}
void rop3_156_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_156_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_156_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
not    %cl
and    %dl,%cl
xor    %sil,%cl
mov    %edx,%eax
not    %al
or     %cl,%al
and    %sil,%al
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_156_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = or i32 %31, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = xor i32 %42, -1
%44 = and i32 %40, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %44, %47
%49 = or i32 %38, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_156_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %5, %2
%7 = xor i8 %6, %1
%8 = xor i8 %2, -1
%9 = or i8 %7, %8
%10 = and i8 %9, %1
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
store i8 %14, i8* %0
ret void
}
int mik_isdigit(int c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<mik_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <mik_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mik_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @mik_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mik_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int do_174() { return 174; }


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

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

LLVM IR (-O0):
define i32 @do_174() {
ret i32 174
}

LLVM IR (-O2):
define i32 @do_174() {
ret i32 174
}
int promotion(signed char sc, signed short ss, unsigned char uc,
              unsigned short us) {
  int r = (int)sc + (int)ss + (int)uc + (int)us;
  return r;
}


x86 assembly (clang, -O0):
<promotion>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %dl,%cl
mov    %si,%dx
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %ax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
movzbl -0x5(%rbp),%ecx
add    %ecx,%eax
movzwl -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<promotion>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @promotion(i8 signext %0, i16 signext %1, i8 zeroext %2, i16 zeroext %3) {
%5 = alloca i8
%6 = alloca i16
%7 = alloca i8
%8 = alloca i16
%9 = alloca i32
store i8 %0, i8* %5
store i16 %1, i16* %6
store i8 %2, i8* %7
store i16 %3, i16* %8
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = load i16, i16* %6
%13 = sext i16 %12 to i32
%14 = add nsw i32 %11, %13
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = add nsw i32 %14, %16
%18 = load i16, i16* %8
%19 = zext i16 %18 to i32
%20 = add nsw i32 %17, %19
store i32 %20, i32* %9
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
define i32 @promotion(i8 signext %0, i16 signext %1, i8 zeroext %2, i16 zeroext %3) {
%5 = sext i8 %0 to i32
%6 = sext i16 %1 to i32
%7 = add nsw i32 %6, %5
%8 = zext i8 %2 to i32
%9 = add nsw i32 %7, %8
%10 = zext i16 %3 to i32
%11 = add nsw i32 %9, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void test34_TestMod_test__E() {
  printf("Im in test!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<test34_TestMod_test__E>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<test34_TestMod_test__E>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Im in test!\0A\00"
define void @test34_TestMod_test__E() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [12 x i8] c"Im in test!\00"
define void @test34_TestMod_test__E() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct tiff {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ tiffWriteField(int /*<<< orphan*/ *, struct tiff *,
                                  unsigned short, int, int, unsigned long *);
void tiffWriteLongField(FILE *fp, struct tiff *t, unsigned short tag,
                        unsigned long l) {
  tiffWriteField(fp, t, tag, 4, 1, &l);
}


x86 assembly (clang, -O0):
<tiffWriteLongField>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%ecx
mov    $0x1,%r8d
lea    -0x20(%rbp),%r9
movzwl -0x12(%rbp),%edx
call   1030 <tiffWriteField@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiffWriteLongField>:
push   %rax
mov    %rcx,(%rsp)
mov    %rsp,%r9
mov    $0x4,%ecx
mov    $0x1,%r8d
call   1030 <tiffWriteField@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tiff = type { i32 }
define void @tiffWriteLongField(i32* %0, %struct.tiff* %1, i16 zeroext %2, i64 %3) {
%5 = alloca i32*
%6 = alloca %struct.tiff*
%7 = alloca i16
%8 = alloca i64
store i32* %0, i32** %5
store %struct.tiff* %1, %struct.tiff** %6
store i16 %2, i16* %7
store i64 %3, i64* %8
%9 = load i32*, i32** %5
%10 = load %struct.tiff*, %struct.tiff** %6
%11 = load i16, i16* %7
%12 = call i32 @tiffWriteField(i32* %9, %struct.tiff* %10, i16 zeroext %11, i32 4, i32 1, i64* %8)
ret void
}

LLVM IR (-O2):
%struct.tiff = type { i32 }
define void @tiffWriteLongField(i32* %0, %struct.tiff* %1, i16 zeroext %2, i64 %3) {
%5 = alloca i64
store i64 %3, i64* %5
%6 = call i32 @tiffWriteField(i32* %0, %struct.tiff* %1, i16 zeroext %2, i32 4, i32 1, i64* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_thread_join() {
  printf("NOT IMPLEMENTED:"
         "pa_thread_join"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_thread_join\0A\00"
define i32 @pa_thread_join() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_thread_join\00"
define i32 @pa_thread_join() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
const char *db_create_jesrcs_table_sql(void) {
  static const char *query = "CREATE TABLE jesrcs ("
                             "    name           VARCHAR(10)     NOT NULL,"
                             "    description    VARCHAR(100)    NOT NULL,"
                             "  CONSTRAINT jesrcs_pk"
                             "    PRIMARY KEY (name)"
                             ");";
  return query;
}


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

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

LLVM IR (-O0):
@db_create_jesrcs_table_sql.query = internal global i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i32 0, i32 0)
@.str = [156 x i8] c"CREATE TABLE jesrcs ( name VARCHAR(10) NOT NULL, description VARCHAR(100) NOT NULL, CONSTRAINT jesrcs_pk PRIMARY KEY (name));\00"
define i8* @db_create_jesrcs_table_sql() {
%1 = load i8*, i8** @db_create_jesrcs_table_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [156 x i8] c"CREATE TABLE jesrcs ( name VARCHAR(10) NOT NULL, description VARCHAR(100) NOT NULL, CONSTRAINT jesrcs_pk PRIMARY KEY (name));\00"
define i8* @db_create_jesrcs_table_sql() {
ret i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ kputb(char *, int);
void count_kputc(int c, int *count, char *buffer, unsigned *bcount) {
  (*count)++;
  if (*bcount == (80)) {
    kputb(buffer, (80));
    (*bcount) = 0;
  }
  buffer[(*bcount)++] = (char)c;
}


x86 assembly (clang, -O0):
<count_kputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
cmpl   $0x50,(%rax)
jne    1157 <count_kputc+0x47>
mov    -0x18(%rbp),%rdi
mov    $0x50,%esi
call   1030 <kputb@plt>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_kputc>:
push   %rbp
push   %r14
push   %rbx
addl   $0x1,(%rsi)
mov    %rcx,%rbp
mov    %rdx,%rbx
mov    %edi,%r14d
mov    (%rcx),%eax
cmp    $0x50,%eax
jne    1136 <count_kputc+0x26>
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <kputb@plt>
xor    %eax,%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x0(%rbp)
mov    %eax,%eax
mov    %r14b,(%rbx,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @count_kputc(i32 %0, i32* nocapture %1, i8* %2, i32* nocapture %3) {
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 80
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @kputb(i8* %2, i32 80)
br label %11
11: ; preds = %9, %4
%12 = phi i32 [ 0, %9 ], [ %7, %4 ]
%13 = trunc i32 %0 to i8
%14 = add i32 %12, 1
store i32 %14, i32* %3
%15 = zext i32 %12 to i64
%16 = getelementptr inbounds i8, i8* %2, i64 %15
store i8 %13, i8* %16
ret void
}
void PrintJNSimpleCompareFunction1(void *theEnv, const char *logicalName,
                                   void *theValue) {}


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

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

LLVM IR (-O0):
define void @PrintJNSimpleCompareFunction1(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @PrintJNSimpleCompareFunction1(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fdi_main();
int main(void) {
  fdi_main();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fdi_main()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fdi_main()
ret i32 0
}