xunge/DecIR huggingface dataset:
/* Type definitions */
struct widget {
  int dummy;
};
struct view {
  int dummy;
};

/* Variables and functions */
struct widget *createwidget(struct view *);
int /*<<< orphan*/ widget_select_init(struct widget *, char *, char *, char *);
void pool_create_select(struct view *view, char *id, char *in, char *value) {
  struct widget *widget = createwidget(view);
  widget_select_init(widget, id, in, value);
}


x86 assembly (clang, -O0):
<pool_create_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <createwidget@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <widget_select_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_create_select>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
call   1030 <createwidget@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <widget_select_init@plt>

LLVM IR (-O0):
%struct.view = type { i32 }
%struct.widget = type { i32 }
define void @pool_create_select(%struct.view* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.view*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.widget*
store %struct.view* %0, %struct.view** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load %struct.view*, %struct.view** %5
%11 = call %struct.widget* @createwidget(%struct.view* %10)
store %struct.widget* %11, %struct.widget** %9
%12 = load %struct.widget*, %struct.widget** %9
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 @widget_select_init(%struct.widget* %12, i8* %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
%struct.view = type { i32 }
%struct.widget = type { i32 }
define void @pool_create_select(%struct.view* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call %struct.widget* @createwidget(%struct.view* %0)
%6 = tail call i32 @widget_select_init(%struct.widget* %5, i8* %1, i8* %2, i8* %3)
ret void
}
/* Variables and functions */
int directory_p(char const *);
int fileutils___directory_p(const char *filename) {
  return (directory_p(filename));
}


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

x86 assembly (clang, -O2):
<fileutils___directory_p>:
jmp    1030 <directory_p@plt>

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

LLVM IR (-O2):
define i32 @fileutils___directory_p(i8* %0) {
%2 = tail call i32 @directory_p(i8* %0)
ret i32 %2
}
const char *str_stmt_label() { return "label"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"label\00"
define i8* @str_stmt_label() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"label\00"
define i8* @str_stmt_label() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void sub_reg64_reg64(int reg1, int reg2) {
  put8(0x48);
  put8(0x29);
  put8((reg2 << 3) | reg1 | 0xC0);
}


x86 assembly (clang, -O0):
<sub_reg64_reg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x29,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     -0x4(%rbp),%edi
or     $0xc0,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_reg64_reg64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x29,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @sub_reg64_reg64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 72)
%6 = call i32 @put8(i32 41)
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
%9 = load i32, i32* %3
%10 = or i32 %8, %9
%11 = or i32 %10, 192
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @sub_reg64_reg64(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 72)
%4 = tail call i32 @put8(i32 41)
%5 = shl i32 %1, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ABDAY_6;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abday_6() { return nl_langinfo(ABDAY_6); }


x86 assembly (clang, -O0):
<langinfo_abday_6>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abday_6>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABDAY_6 = global i32 0
define i8* @langinfo_abday_6() {
%1 = load i32, i32* @ABDAY_6
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABDAY_6 = global i32 0
define i8* @langinfo_abday_6() {
%1 = load i32, i32* @ABDAY_6
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
double RAND_MAX;
double rand();
long TestingMostlyDescending(long index, long total) {
  return total - index + rand() * 1.0 / RAND_MAX * 5 - 2.5;
}


x86 assembly (clang, -O0):
<TestingMostlyDescending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xeca(%rip),%xmm2
mulsd  %xmm2,%xmm0
mov    0x2e97(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xeab(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestingMostlyDescending>:
push   %rax
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ebc(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0xec8(%rip),%xmm0
addsd  (%rsp),%xmm0
addsd  0xec3(%rip),%xmm0
cvttsd2si %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i64 @TestingMostlyDescending(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to double
%9 = call double (...) @rand()
%10 = fmul double %9, 1.000000e+00
%11 = load double, double* @RAND_MAX
%12 = fdiv double %10, %11
%13 = call double @llvm.fmuladd.f64(double %12, double 5.000000e+00, double %8)
%14 = fsub double %13, 2.500000e+00
%15 = fptosi double %14 to i64
ret i64 %15
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i64 @TestingMostlyDescending(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = tail call double (...) @rand()
%6 = load double, double* @RAND_MAX
%7 = fdiv double %5, %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 5.000000e+00, double %4)
%9 = fadd double %8, -2.500000e+00
%10 = fptosi double %9 to i64
ret i64 %10
}
unsigned char shift_8_bit_feedback_register() {
  static unsigned char register_8 = 1;
  unsigned char new_bit;
  new_bit = (register_8 & 0x01) ^ ((register_8 & 0x04) >> 2) ^
            ((register_8 & 0x08) >> 3) ^ ((register_8 & 0x10) >> 4);
  register_8 = register_8 >> 1;
  register_8 = register_8 | (new_bit << 7);
  return (register_8);
}


x86 assembly (clang, -O0):
<shift_8_bit_feedback_register>:
push   %rbp
mov    %rsp,%rbp
movzbl 0x2f15(%rip),%eax
and    $0x1,%eax
movzbl 0x2f0b(%rip),%ecx
and    $0x4,%ecx
sar    $0x2,%ecx
xor    %ecx,%eax
movzbl 0x2efc(%rip),%ecx
and    $0x8,%ecx
sar    $0x3,%ecx
xor    %ecx,%eax
movzbl 0x2eed(%rip),%ecx
and    $0x10,%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl 0x2edb(%rip),%eax
sar    $0x1,%eax
mov    %al,0x2ed2(%rip)
movzbl 0x2ecb(%rip),%eax
movzbl -0x1(%rbp),%ecx
shl    $0x7,%ecx
or     %ecx,%eax
mov    %al,0x2ebc(%rip)
movzbl 0x2eb5(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_8_bit_feedback_register>:
mov    0x2f1a(%rip),%al
mov    %eax,%ecx
shr    $0x2,%cl
xor    %al,%cl
mov    %eax,%esi
shr    $0x3,%sil
mov    %eax,%edx
shr    $0x4,%dl
xor    %sil,%dl
xor    %cl,%dl
shl    $0x7,%dl
shr    %al
or     %dl,%al
mov    %al,0x2ef6(%rip)
ret

LLVM IR (-O0):
@shift_8_bit_feedback_register.register_8 = internal global i8 1
define zeroext i8 @shift_8_bit_feedback_register() {
%1 = alloca i8
%2 = load i8, i8* @shift_8_bit_feedback_register.register_8
%3 = zext i8 %2 to i32
%4 = and i32 %3, 1
%5 = load i8, i8* @shift_8_bit_feedback_register.register_8
%6 = zext i8 %5 to i32
%7 = and i32 %6, 4
%8 = ashr i32 %7, 2
%9 = xor i32 %4, %8
%10 = load i8, i8* @shift_8_bit_feedback_register.register_8
%11 = zext i8 %10 to i32
%12 = and i32 %11, 8
%13 = ashr i32 %12, 3
%14 = xor i32 %9, %13
%15 = load i8, i8* @shift_8_bit_feedback_register.register_8
%16 = zext i8 %15 to i32
%17 = and i32 %16, 16
%18 = ashr i32 %17, 4
%19 = xor i32 %14, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %1
%21 = load i8, i8* @shift_8_bit_feedback_register.register_8
%22 = zext i8 %21 to i32
%23 = ashr i32 %22, 1
%24 = trunc i32 %23 to i8
store i8 %24, i8* @shift_8_bit_feedback_register.register_8
%25 = load i8, i8* @shift_8_bit_feedback_register.register_8
%26 = zext i8 %25 to i32
%27 = load i8, i8* %1
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 7
%30 = or i32 %26, %29
%31 = trunc i32 %30 to i8
store i8 %31, i8* @shift_8_bit_feedback_register.register_8
%32 = load i8, i8* @shift_8_bit_feedback_register.register_8
ret i8 %32
}

LLVM IR (-O2):
@shift_8_bit_feedback_register.register_8 = internal unnamed_addr global i8 1
define zeroext i8 @shift_8_bit_feedback_register() {
%1 = load i8, i8* @shift_8_bit_feedback_register.register_8
%2 = lshr i8 %1, 2
%3 = xor i8 %2, %1
%4 = lshr i8 %1, 3
%5 = xor i8 %3, %4
%6 = lshr i8 %1, 4
%7 = xor i8 %5, %6
%8 = tail call i8 @llvm.fshl.i8(i8 %7, i8 %1, i8 7)
store i8 %8, i8* @shift_8_bit_feedback_register.register_8
ret i8 %8
}
int malloc_size_mask() { return 0x0FFFFFFF; }


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

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

LLVM IR (-O0):
define i32 @malloc_size_mask() {
ret i32 268435455
}

LLVM IR (-O2):
define i32 @malloc_size_mask() {
ret i32 268435455
}
int test_imm_9Fint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x9F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Fint64_highword_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, 32
%6 = and i64 %5, 159
%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_9Fint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 682899800064
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int chartoint(char ch) { return ch - '0'; }


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

x86 assembly (clang, -O2):
<chartoint>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @chartoint(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, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @chartoint(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__8__IO__makeOutput();
void CC2420TransmitP__CSN__makeOutput(void) {
  HplAtm128GeneralIOPinP__8__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @CC2420TransmitP__CSN__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__8__IO__makeOutput()
ret void
}
/* Type definitions */
struct node {
  int dummy;
};
struct freelist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mem_release_recursive(struct freelist *, struct node *,
                                         int /*<<< orphan*/);
void mem_release(struct freelist *fl, void *_p) {
  struct node *p = ((void *)(((intptr_t)(_p)) & (~0x1)));
  mem_release_recursive(fl, p, 0);
}


x86 assembly (clang, -O0):
<mem_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <mem_release_recursive@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_release>:
and    $0xfffffffffffffffe,%rsi
xor    %edx,%edx
jmp    1030 <mem_release_recursive@plt>

LLVM IR (-O0):
%struct.freelist = type { i32 }
%struct.node = type { i32 }
define void @mem_release(%struct.freelist* %0, i8* %1) {
%3 = alloca %struct.freelist*
%4 = alloca i8*
%5 = alloca %struct.node*
store %struct.freelist* %0, %struct.freelist** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = and i64 %7, -2
%9 = inttoptr i64 %8 to i8*
%10 = bitcast i8* %9 to %struct.node*
store %struct.node* %10, %struct.node** %5
%11 = load %struct.freelist*, %struct.freelist** %3
%12 = load %struct.node*, %struct.node** %5
%13 = call i32 @mem_release_recursive(%struct.freelist* %11, %struct.node* %12, i32 0)
ret void
}

LLVM IR (-O2):
%struct.freelist = type { i32 }
%struct.node = type { i32 }
define void @mem_release(%struct.freelist* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = and i64 %3, -2
%5 = inttoptr i64 %4 to %struct.node*
%6 = tail call i32 @mem_release_recursive(%struct.freelist* %0, %struct.node* %5, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_shuffle_pd(int /*<<< orphan*/, int /*<<< orphan*/, int);
__m128d __mm_shuffle_pd(__m128d A, __m128d B, int const I) {
  return _mm_shuffle_pd(A, B, 1);
}


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

x86 assembly (clang, -O2):
<__mm_shuffle_pd>:
mov    $0x1,%edx
jmp    1030 <_mm_shuffle_pd@plt>

LLVM IR (-O0):
define i32 @__mm_shuffle_pd(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* %4
%8 = load i32, i32* %5
%9 = call i32 @_mm_shuffle_pd(i32 %7, i32 %8, i32 1)
ret i32 %9
}

LLVM IR (-O2):
define i32 @__mm_shuffle_pd(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm_shuffle_pd(i32 %0, i32 %1, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int vfswrap_lock(int /*<<< orphan*/, int, int, int, int, int);
int main(void) {
  if (vfswrap_lock(0, 1, 2, 3, 4, 5) != 5)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1040 <vfswrap_lock@plt>
cmp    $0x5,%eax
je     1161 <main+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1040 <vfswrap_lock@plt>
cmp    $0x5,%eax
jne    114c <main+0x2c>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @vfswrap_lock(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5)
%2 = icmp eq i32 %1, 5
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
struct notifier_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pcwd_stop();
int pcwd_notify_sys(struct notifier_block *this, unsigned long code,
                    void *unused) {
  {
    if (code == 1UL) {
      pcwd_stop();
    } else if (code == 2UL) {
      pcwd_stop();
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<pcwd_notify_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    113b <pcwd_notify_sys+0x2b>
mov    $0x0,%al
call   1030 <pcwd_stop@plt>
jmp    1152 <pcwd_notify_sys+0x42>
cmpq   $0x2,-0x10(%rbp)
jne    114d <pcwd_notify_sys+0x3d>
mov    $0x0,%al
call   1030 <pcwd_stop@plt>
jmp    1152 <pcwd_notify_sys+0x42>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcwd_notify_sys>:
add    $0xffffffffffffffff,%rsi
cmp    $0x1,%rsi
ja     1126 <pcwd_notify_sys+0x16>
push   %rax
xor    %eax,%eax
call   1030 <pcwd_stop@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.notifier_block = type { i32 }
define i32 @pcwd_notify_sys(%struct.notifier_block* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
%4 = add i64 %1, -1
%5 = icmp ult i64 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @pcwd_stop()
br label %8
8: ; preds = %3, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorExit(char *, char *);
void Check_Compression(int argc, char **argv) {
  if (argc > 3) {
    if (argc == 4)
      return;
    PrintErrorExit(argv[0], "compression");
  }
  PrintErrorExit(argv[0], "compression : missing lzo or zlib");
}


x86 assembly (clang, -O0):
<Check_Compression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jle    114b <Check_Compression+0x3b>
cmpl   $0x4,-0x4(%rbp)
jne    1138 <Check_Compression+0x28>
jmp    115e <Check_Compression+0x4e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeba(%rip),%rsi
call   1030 <PrintErrorExit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <PrintErrorExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Check_Compression>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x4,%edi
jl     112c <Check_Compression+0x1c>
jne    111d <Check_Compression+0xd>
pop    %rbx
ret
mov    (%rbx),%rdi
lea    0xed9(%rip),%rsi
call   1030 <PrintErrorExit@plt>
mov    (%rbx),%rdi
lea    0xed6(%rip),%rsi
pop    %rbx
jmp    1030 <PrintErrorExit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"compression\00"
@.str.1 = [34 x i8] c"compression : missing lzo or zlib\00"
define void @Check_Compression(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 3
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %7
br label %21
11: ; preds = %7
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @PrintErrorExit(i8* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %11, %2
%17 = load i8**, i8*** %4
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @PrintErrorExit(i8* %19, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %16, %10
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"compression\00"
@.str.1 = [34 x i8] c"compression : missing lzo or zlib\00"
define void @Check_Compression(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 3
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = icmp eq i32 %0, 4
br i1 %5, label %12, label %6
6: ; preds = %4
%7 = load i8*, i8** %1
%8 = tail call i32 @PrintErrorExit(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %2
%10 = load i8*, i8** %1
%11 = tail call i32 @PrintErrorExit(i8* %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %4, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run_omp_for();
int /*<<< orphan*/ test_omp_results();
int main() {
  run_omp_for();
  test_omp_results();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <run_omp_for@plt>
mov    $0x0,%al
call   1040 <test_omp_results@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @run_omp_for()
%2 = call i32 (...) @test_omp_results()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_omp_for()
%2 = tail call i32 (...) @test_omp_results()
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write_at_be32(void *, int, int);
int /*<<< orphan*/ write_be32(void *, int);
void write_be64(void *dest, uint64_t val) {
  write_be32(dest, val >> 32);
  write_at_be32(dest, val >> 0, sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<write_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1040 <write_be32@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x0,%esi
mov    $0x4,%edx
call   1030 <write_at_be32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_be64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <write_be32@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write_at_be32@plt>

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

LLVM IR (-O2):
define void @write_be64(i8* %0, i32 %1) {
%3 = tail call i32 @write_be32(i8* %0, i32 poison)
%4 = tail call i32 @write_at_be32(i8* %0, i32 %1, i32 4)
ret void
}
unsigned callee_flat_u_abs(unsigned bla) { return bla + 1; }


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

x86 assembly (clang, -O2):
<callee_flat_u_abs>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @callee_flat_u_abs(i32 %0) {
%2 = add i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void pixie_sleep(unsigned milliseconds) { usleep(milliseconds * 1000); }


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

x86 assembly (clang, -O2):
<pixie_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @pixie_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @pixie_sleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  int a_1 = 23;
  int b_1 = 10;
  float f_1 = 10.77;
  char c1 = 'A' + 32;
  b_1 = 100;
  printf("Hello! I am Zahari. %0.2f\n\n", a_1 * b_1 * 10 - f_1);
  printf("Char: %c\n", c1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x17,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x412c51ec,-0x10(%rbp)
movb   $0x61,-0x11(%rbp)
movl   $0x64,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
imul   %eax,%ecx
add    %ecx,%ecx
mov    %ecx,%eax
lea    (%rax,%rax,4),%eax
cvtsi2ss %eax,%xmm0
movss  -0x10(%rbp),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
lea    0xe99(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"Hello! I am Zahari. %0.2f\0A\0A\00"
@.str.1 = [10 x i8] c"Char: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i8
store i32 0, i32* %1
store i32 23, i32* %2
store i32 10, i32* %3
store float 0x40258A3D80000000, float* %4
store i8 97, i8* %5
store i32 100, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = mul nsw i32 %8, 10
%10 = sitofp i32 %9 to float
%11 = load float, float* %4
%12 = fsub float %10, %11
%13 = fptosi float %12 to i8
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %13)
%15 = load i8, i8* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hello! I am Zahari. %0.2f\0A\0A\00"
@.str.1 = [10 x i8] c"Char: %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext poison)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext 97)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ japi_beep();
void j_beep() { japi_beep(); }


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

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

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

LLVM IR (-O2):
define void @j_beep() {
%1 = tail call i32 (...) @japi_beep()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void yyerror(char *s) { printf("%s\n", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void print_error_and_die() {
  perror("check_mutti");
  fprintf(stderr, "Error is fatal, bailing out.\n");
  exit(3);
}


x86 assembly (clang, -O0):
<print_error_and_die>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_error_and_die>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"check_mutti\00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"Error is fatal, bailing out.\0A\00"
define void @print_error_and_die() {
%1 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"check_mutti\00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"Error is fatal, bailing out.\0A\00"
define void @print_error_and_die() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 3)
unreachable
}
void rop3_31_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_31_0_0>:
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
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_31_0_0>:
or     (%rdi),%sil
and    %dl,%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_31_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_31_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SCOTCHFRANDOMPROC(int const *const);
void scotchfrandomproc(const int *const procnum) { SCOTCHFRANDOMPROC(procnum); }


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

x86 assembly (clang, -O2):
<scotchfrandomproc>:
jmp    1030 <SCOTCHFRANDOMPROC@plt>

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

LLVM IR (-O2):
define void @scotchfrandomproc(i32* %0) {
%2 = tail call i32 @SCOTCHFRANDOMPROC(i32* %0)
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int);
void wl_data_source_send_cancelled(struct wl_resource *resource_) {
  wl_resource_post_event(resource_, 2);
}


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

x86 assembly (clang, -O2):
<wl_data_source_send_cancelled>:
mov    $0x2,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_data_source_send_cancelled(%struct.wl_resource* %0) {
%2 = alloca %struct.wl_resource*
store %struct.wl_resource* %0, %struct.wl_resource** %2
%3 = load %struct.wl_resource*, %struct.wl_resource** %2
%4 = call i32 @wl_resource_post_event(%struct.wl_resource* %3, i32 2)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_data_source_send_cancelled(%struct.wl_resource* %0) {
%2 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 2)
ret void
}
int not_picked2() { return 2; }


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

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

LLVM IR (-O0):
define i32 @not_picked2() {
ret i32 2
}

LLVM IR (-O2):
define i32 @not_picked2() {
ret i32 2
}
void trickle_unlock() {}


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

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

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

LLVM IR (-O2):
define void @trickle_unlock() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int swap_symbols_for_standard_witness_set(int nvr, int dim) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(816, &nvr, &dim, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<swap_symbols_for_standard_witness_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x330,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_symbols_for_standard_witness_set>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x330,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @swap_symbols_for_standard_witness_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc4c(i32 816, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @swap_symbols_for_standard_witness_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 816, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ change_ps1(char *, char *);
void init_ps1() { change_ps1("irakr", "lenovo-S510P"); }


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

x86 assembly (clang, -O2):
<init_ps1>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <change_ps1@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"irakr\00"
@.str.1 = [13 x i8] c"lenovo-S510P\00"
define void @init_ps1() {
%1 = call i32 @change_ps1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"irakr\00"
@.str.1 = [13 x i8] c"lenovo-S510P\00"
define void @init_ps1() {
%1 = tail call i32 @change_ps1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int read(int, char *, int);
char readSerialPort(int fd) {
  int res = 0;
  char buf[20];
  if ((res = read(fd, buf, 1)) < 0)
    buf[0] = 0;
  return (buf[0]);
}


x86 assembly (clang, -O0):
<readSerialPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1143 <readSerialPort+0x33>
movb   $0x0,-0x20(%rbp)
movsbl -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSerialPort>:
sub    $0x18,%rsp
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     112c <readSerialPort+0x1c>
mov    (%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define signext i8 @readSerialPort(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [20 x i8]
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 1)
store i32 %7, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
store i8 0, i8* %10
br label %11
11: ; preds = %9, %1
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%13 = load i8, i8* %12
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @readSerialPort(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 1)
%5 = icmp slt i32 %4, 0
%6 = load i8, i8* %3
%7 = select i1 %5, i8 0, i8 %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int qemu_start_tracing() {
  int fd = open("/sys/qemu_trace/state", O_WRONLY);
  if (fd < 0)
    return fd;
  write(fd, "1\n", 2);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<qemu_start_tracing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1165 <qemu_start_tracing+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <qemu_start_tracing+0x58>
mov    -0x8(%rbp),%edi
lea    0xea7(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qemu_start_tracing>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1168 <qemu_start_tracing+0x38>
lea    0xec3(%rip),%rsi
mov    %ebx,%edi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/sys/qemu_trace/state\00"
@O_WRONLY = global i32 0
@.str.1 = [3 x i8] c"1\0A\00"
define i32 @qemu_start_tracing() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_WRONLY
%4 = call i32 @open(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %14
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @write(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
store i32 0, i32* %1
br label %14
14: ; preds = %9, %7
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"/sys/qemu_trace/state\00"
@O_WRONLY = global i32 0
@.str.1 = [3 x i8] c"1\0A\00"
define i32 @qemu_start_tracing() {
%1 = load i32, i32* @O_WRONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = tail call i32 @close(i32 %2)
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ 0, %4 ], [ %2, %0 ]
ret i32 %8
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char gender;
  printf("Please select your gender [M/F] ");
  gender = getchar();
  printf("You selected: %c", gender);
  getchar();
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%esi
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Please select your gender [M/F] \00"
@.str.1 = [17 x i8] c"You selected: %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call signext i8 (...) @getchar()
%9 = call signext i8 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Please select your gender [M/F] \00"
@.str.1 = [17 x i8] c"You selected: %c\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call signext i8 (...) @getchar()
%6 = tail call signext i8 (...) @getchar()
ret i32 0
}
/* Type definitions */
struct jvm_rect {
  int dummy;
};

/* Variables and functions */
int jvm_area(struct jvm_rect *);
int test(struct jvm_rect *p) { return jvm_area(p); }


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <jvm_area@plt>

LLVM IR (-O0):
%struct.jvm_rect = type { i32 }
define i32 @test(%struct.jvm_rect* %0) {
%2 = alloca %struct.jvm_rect*
store %struct.jvm_rect* %0, %struct.jvm_rect** %2
%3 = load %struct.jvm_rect*, %struct.jvm_rect** %2
%4 = call i32 @jvm_area(%struct.jvm_rect* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.jvm_rect = type { i32 }
define i32 @test(%struct.jvm_rect* %0) {
%2 = tail call i32 @jvm_area(%struct.jvm_rect* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void mystery(int n) {
  n += 5;
  n /= 10;
  printf("%s\n", "***********" + 10 - n % 10);
}


x86 assembly (clang, -O0):
<mystery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
xor    %eax,%eax
sub    %rcx,%rax
lea    0xeb8(%rip),%rsi
add    $0xa,%rsi
add    %rax,%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystery>:
add    $0x5,%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %eax,%ecx
movslq %ecx,%rax
lea    0xeb3(%rip),%rcx
lea    (%rax,%rcx,1),%rsi
add    $0xa,%rsi
lea    0xea0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"***********\00"
define void @mystery(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 5
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = srem i32 %7, 10
%9 = sext i32 %8 to i64
%10 = sub i64 0, %9
%11 = getelementptr inbounds i8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 10), i64 %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"***********\00"
define void @mystery(i32 %0) {
%2 = add nsw i32 %0, 5
%3 = sdiv i32 %2, 10
%4 = srem i32 %3, 10
%5 = sub nsw i32 0, %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 10), i64 %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}