xunge/DecIR huggingface dataset:
/* Variables and functions */
int PAPI_remove_events(int, int *, int);
void papif_remove_events__(int *EventSet, int *Events, int *number,
                           int *check) {
  *check = PAPI_remove_events(*EventSet, Events, *number);
}


x86 assembly (clang, -O0):
<papif_remove_events__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <PAPI_remove_events@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_remove_events__>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
call   1030 <PAPI_remove_events@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_remove_events__(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = call i32 @PAPI_remove_events(i32 %10, i32* %11, i32 %13)
%15 = load i32*, i32** %8
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @papif_remove_events__(i32* nocapture %0, i32* %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call i32 @PAPI_remove_events(i32 %5, i32* %1, i32 %6)
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_06(int Salt, int Parameter) {
  unsigned b = Salt * 0x4ABB534D + 0x3769;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_06>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x4abb534d,-0x4(%rbp),%eax
add    $0x3769,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_06>:
imul   $0x4abb534d,%edi,%edi
add    $0x3769,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_06(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 1253790541
%8 = add nsw i32 %7, 14185
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_06(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 1253790541
%4 = add nsw i32 %3, 14185
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
/* Type definitions */
struct ringbuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ringbuffer_delete(struct ringbuffer *);
void _release_rb(struct ringbuffer *rb) { ringbuffer_delete(rb); }


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

x86 assembly (clang, -O2):
<_release_rb>:
jmp    1030 <ringbuffer_delete@plt>

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

LLVM IR (-O2):
%struct.ringbuffer = type { i32 }
define void @_release_rb(%struct.ringbuffer* %0) {
%2 = tail call i32 @ringbuffer_delete(%struct.ringbuffer* %0)
ret void
}
void mbed_trace_buffer_sizes(int lineLength, int tmpLength) {}


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

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

LLVM IR (-O0):
define void @mbed_trace_buffer_sizes(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 @mbed_trace_buffer_sizes(i32 %0, i32 %1) {
ret void
}
unsigned kol_key_mode_get() { asm volatile("int $0x40" ::"a"(66), "b"(2)); }


x86 assembly (clang, -O0):
<kol_key_mode_get>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x42,%eax
mov    $0x2,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_key_mode_get>:
push   %rbx
mov    $0x42,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @kol_key_mode_get() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @kol_key_mode_get() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 66, i32 2)
ret i32 undef
}
unsigned long __max_impl_ulong(unsigned long a, unsigned long b) {
  return (a > b) ? a : b;
}


x86 assembly (clang, -O0):
<__max_impl_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <__max_impl_ulong+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <__max_impl_ulong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__max_impl_ulong>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @__max_impl_ulong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @__max_impl_ulong(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void g_object_new_valist() {}


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

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

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

LLVM IR (-O2):
define void @g_object_new_valist() {
ret void
}
int test_imm_3Euint32_mem(unsigned int *val) {
  return ((*val) & (0x3E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Euint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 62
%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_3Euint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 62
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int other();
int localfn() { return other(); }


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

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

LLVM IR (-O0):
define i32 @localfn() {
%1 = call i32 (...) @other()
ret i32 %1
}

LLVM IR (-O2):
define i32 @localfn() {
%1 = tail call i32 (...) @other()
ret i32 %1
}
char *strstr(const char *str, const char *find) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @strstr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
const uint8_t *skip_fixed64(const uint8_t *buffer, const uint8_t *buffer_end) {
  buffer += 8;
  if (buffer_end >= buffer)
    return buffer;
  return NULL;
}


x86 assembly (clang, -O0):
<skip_fixed64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1133 <skip_fixed64+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    113b <skip_fixed64+0x3b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_fixed64>:
lea    0x20(%rdi),%rcx
xor    %eax,%eax
cmp    %rsi,%rcx
cmovbe %rcx,%rax
ret

LLVM IR (-O0):
define i32* @skip_fixed64(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 = getelementptr inbounds i32, i32* %6, i64 8
store i32* %7, i32** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %4
%10 = icmp uge i32* %8, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32*, i32** %4
store i32* %12, i32** %3
br label %14
13: ; preds = %2
store i32* null, i32** %3
br label %14
14: ; preds = %13, %11
%15 = load i32*, i32** %3
ret i32* %15
}

LLVM IR (-O2):
define i32* @skip_fixed64(i32* readnone %0, i32* readnone %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 8
%4 = icmp ugt i32* %3, %1
%5 = select i1 %4, i32* null, i32* %3
ret i32* %5
}
float CubicEaseInOut(float p) {
  if (p < 0.5) {
    return 4 * p * p * p;
  } else {
    float f = ((2 * p) - 2);
    return 0.5 * f * f * f + 1;
  }
}


x86 assembly (clang, -O0):
<CubicEaseInOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1145 <CubicEaseInOut+0x45>
movss  0xee8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11a3 <CubicEaseInOut+0xa3>
movss  -0x8(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xeba(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe90(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe72(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CubicEaseInOut>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1125 <CubicEaseInOut+0x25>
movss  0xef3(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret
addss  %xmm0,%xmm0
addss  0xed3(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed3(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xec7(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @CubicEaseInOut(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 5.000000e-01
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load float, float* %3
%10 = fmul float 4.000000e+00, %9
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = load float, float* %3
%14 = fmul float %12, %13
store float %14, float* %2
br label %28
15: ; preds = %1
%16 = load float, float* %3
%17 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %16, float -2.000000e+00)
store float %17, float* %4
%18 = load float, float* %4
%19 = fpext float %18 to double
%20 = fmul double 5.000000e-01, %19
%21 = load float, float* %4
%22 = fpext float %21 to double
%23 = fmul double %20, %22
%24 = load float, float* %4
%25 = fpext float %24 to double
%26 = call double @llvm.fmuladd.f64(double %23, double %25, double 1.000000e+00)
%27 = fptrunc double %26 to float
store float %27, float* %2
br label %28
28: ; preds = %15, %8
%29 = load float, float* %2
ret float %29
}

LLVM IR (-O2):
define float @CubicEaseInOut(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fmul float %0, 4.000000e+00
%5 = fmul float %4, %0
%6 = fmul float %5, %0
br label %14
7: ; preds = %1
%8 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float -2.000000e+00)
%9 = fpext float %8 to double
%10 = fmul double %9, 5.000000e-01
%11 = fmul double %10, %9
%12 = tail call double @llvm.fmuladd.f64(double %11, double %9, double 1.000000e+00)
%13 = fptrunc double %12 to float
br label %14
14: ; preds = %7, %3
%15 = phi float [ %6, %3 ], [ %13, %7 ]
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ Towers();
int main() {
  int i;
  for (i = 0; i < 5; i++)
    Towers();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <Towers@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @Towers()
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Towers()
%2 = tail call i32 (...) @Towers()
%3 = tail call i32 (...) @Towers()
%4 = tail call i32 (...) @Towers()
%5 = tail call i32 (...) @Towers()
ret i32 0
}
void yy_2_InlineTextBlock(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_2_InlineTextBlock(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_lsr(int /*<<< orphan*/);
int /*<<< orphan*/ t16_data_imm5_op(int);
void t16_lsr_imm5() { arm_lsr(t16_data_imm5_op(1)); }


x86 assembly (clang, -O0):
<t16_lsr_imm5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <t16_data_imm5_op@plt>
mov    %eax,%edi
call   1030 <arm_lsr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_lsr_imm5>:
push   %rax
mov    $0x1,%edi
call   1040 <t16_data_imm5_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_lsr@plt>

LLVM IR (-O0):
define void @t16_lsr_imm5() {
%1 = call i32 @t16_data_imm5_op(i32 1)
%2 = call i32 @arm_lsr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_lsr_imm5() {
%1 = tail call i32 @t16_data_imm5_op(i32 1)
%2 = tail call i32 @arm_lsr(i32 %1)
ret void
}
void f() {
  void *data1, *data2;
  char a;
  int b;
  data1 = &a;
  data2 = data1;
  b = *(int *)(data2);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
lea    -0x11(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8* %3, i8** %1
%5 = load i8*, i8** %1
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menu() { printf("1.insertion\n2.deletion\n3.exit"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"1.insertion\0A2.deletion\0A3.exit\00"
define void @menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"1.insertion\0A2.deletion\0A3.exit\00"
define void @menu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pollfd {
  int fd;
  int events;
};

/* Variables and functions */
int POLLIN;
int POLLPRI;
scalar_t__ poll(struct pollfd *, int, int /*<<< orphan*/);
int serialHasChar(int fd) {
  struct pollfd fds;
  fds.fd = fd;
  fds.events = (POLLIN | POLLPRI);
  if (poll(&fds, 1, 0) > 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<serialHasChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    0x2ebf(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <poll@plt>
cmp    $0x0,%rax
jle    115c <serialHasChar+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <serialHasChar+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialHasChar>:
push   %rax
mov    %edi,(%rsp)
mov    0x2ec5(%rip),%rax
mov    0x2ece(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %ecx,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <poll@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
@POLLPRI = global i32 0
define i32 @serialHasChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.pollfd
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %4, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* @POLLIN
%8 = load i32, i32* @POLLPRI
%9 = or i32 %7, %8
%10 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %4, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i64 @poll(%struct.pollfd* %4, i32 1, i32 0)
%12 = icmp sgt i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
@POLLPRI = global i32 0
define i32 @serialHasChar(i32 %0) {
%2 = alloca %struct.pollfd
%3 = bitcast %struct.pollfd* %2 to i8*
%4 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = load i32, i32* @POLLIN
%6 = load i32, i32* @POLLPRI
%7 = or i32 %6, %5
%8 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i64 @poll(%struct.pollfd* %2, i32 1, i32 0)
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ t3100e_map_ram(int);
int /*<<< orphan*/ t3100e_video_options_set(int);
void t3100e_sys_out(uint16_t addr, uint8_t val, void *p) {
  switch (val & 0xE0) {
  case 0x00:;
    break;
  case 0x40:
    t3100e_map_ram(val & 0x1F);
    break;
  case 0x80:
    t3100e_video_options_set(val & 0x1F);
    break;
  default:;
    break;
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0xe0,%eax
mov    %eax,-0x14(%rbp)
je     116c <t3100e_sys_out+0x4c>
jmp    1148 <t3100e_sys_out+0x28>
mov    -0x14(%rbp),%eax
sub    $0x40,%eax
je     1171 <t3100e_sys_out+0x51>
jmp    1159 <t3100e_sys_out+0x39>
mov    -0x14(%rbp),%eax
sub    $0x80,%eax
je     1181 <t3100e_sys_out+0x61>
jmp    1191 <t3100e_sys_out+0x71>
jmp    1196 <t3100e_sys_out+0x76>
mov    -0x8(%rbp),%edi
and    $0x1f,%edi
call   1040 <t3100e_map_ram@plt>
jmp    1196 <t3100e_sys_out+0x76>
mov    -0x8(%rbp),%edi
and    $0x1f,%edi
call   1030 <t3100e_video_options_set@plt>
jmp    1196 <t3100e_sys_out+0x76>
jmp    1196 <t3100e_sys_out+0x76>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%eax
and    $0xe0,%al
cmp    $0x80,%al
je     1136 <t3100e_sys_out+0x16>
cmp    $0x40,%al
jne    1140 <t3100e_sys_out+0x20>
and    $0x1f,%esi
mov    %esi,%edi
jmp    1040 <t3100e_map_ram@plt>
and    $0x1f,%esi
mov    %esi,%edi
jmp    1030 <t3100e_video_options_set@plt>
ret

LLVM IR (-O0):
define void @t3100e_sys_out(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = and i32 %7, 224
switch i32 %8, label %18 [
i32 0, label %9
i32 64, label %10
i32 128, label %14
]
9: ; preds = %3
br label %19
10: ; preds = %3
%11 = load i32, i32* %5
%12 = and i32 %11, 31
%13 = call i32 @t3100e_map_ram(i32 %12)
br label %19
14: ; preds = %3
%15 = load i32, i32* %5
%16 = and i32 %15, 31
%17 = call i32 @t3100e_video_options_set(i32 %16)
br label %19
18: ; preds = %3
br label %19
19: ; preds = %18, %14, %10, %9
ret void
}

LLVM IR (-O2):
define void @t3100e_sys_out(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = trunc i32 %1 to i8
%5 = and i8 %4, -32
switch i8 %5, label %12 [
i8 -128, label %9
i8 64, label %6
]
6: ; preds = %3
%7 = and i32 %1, 31
%8 = tail call i32 @t3100e_map_ram(i32 %7)
br label %12
9: ; preds = %3
%10 = and i32 %1, 31
%11 = tail call i32 @t3100e_video_options_set(i32 %10)
br label %12
12: ; preds = %3, %9, %6
ret void
}
/* Variables and functions */
int getl(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  int displaylen = 80;
  char cline[1000];
  while ((len = getl(cline, 1000)) > 0) {
    if (len > displaylen)
      printf("%s", cline);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x50,-0xc(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <getl@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    117a <main+0x5a>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1175 <main+0x55>
lea    -0x400(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
jmp    1139 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <getl@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <getl@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getl(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getl(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(unsigned char *hash, int hash_length) {
  int i;
  for (i = 0; i < hash_length; i++) {
    printf("%02x", hash[i]);
  }
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <print+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <print+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzArbiter_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKUP(int);
void BrzArbiter_ackup(struct comp *comp, int port) {
  struct BrzArbiter_ *c = (struct BrzArbiter_ *)comp;
  SEND_ACKUP(port - 2);
}


x86 assembly (clang, -O0):
<BrzArbiter_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <SEND_ACKUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzArbiter_ackup>:
lea    -0x2(%rsi),%edi
jmp    1030 <SEND_ACKUP@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzArbiter_ = type { i32 }
define void @BrzArbiter_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzArbiter_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzArbiter_*
store %struct.BrzArbiter_* %7, %struct.BrzArbiter_** %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 2
%10 = call i32 @SEND_ACKUP(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzArbiter_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = add nsw i32 %1, -2
%4 = tail call i32 @SEND_ACKUP(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f(int);
int main() {
  int f1, f2, x;
  x = 1;
  f1 = f(x);
  x = 2;
  f2 = f(x);
  if (f1 != 1 || f2 != 2)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <f@plt>
mov    %eax,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <f@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1177 <main+0x47>
cmpl   $0x2,-0xc(%rbp)
je     117e <main+0x4e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <f@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1040 <f@plt>
cmp    $0x1,%ebx
jne    1158 <main+0x28>
cmp    $0x2,%eax
jne    1158 <main+0x28>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @f(i32 %5)
store i32 %6, i32* %2
store i32 2, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @f(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %11, %0
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @f(i32 2)
%3 = icmp ne i32 %1, 1
%4 = icmp ne i32 %2, 2
%5 = select i1 %3, i1 true, i1 %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = tail call i32 @exit(i32 0)
unreachable
}
int xmlUCSIsTagalog(int code) {
  return (((code >= 0x1700) && (code <= 0x171F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsTagalog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1700,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsTagalog+0x26>
cmpl   $0x171f,-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):
<xmlUCSIsTagalog>:
and    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x1700,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsTagalog(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 5888
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 5919
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 @xmlUCSIsTagalog(i32 %0) {
%2 = and i32 %0, -32
%3 = icmp eq i32 %2, 5888
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ a();
int f(int i) {
  a();
  a();
  a();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <a@plt>
mov    $0x0,%al
call   1030 <a@plt>
mov    $0x0,%al
call   1030 <a@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
call   1030 <a@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <a@plt>

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @a()
%5 = call i32 (...) @a()
%6 = call i32 (...) @a()
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 (...) @a()
%3 = tail call i32 (...) @a()
%4 = tail call i32 (...) @a()
ret i32 undef
}
/* Variables and functions */
int isThere(int, int /*<<< orphan*/, char, char);
int isBlock(int level, char x, char y) { return isThere(level, 0, x, y); }


x86 assembly (clang, -O0):
<isBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x5(%rbp),%al
xor    %esi,%esi
movsbl %al,%edx
movsbl -0x6(%rbp),%ecx
call   1030 <isThere@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBlock>:
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <isThere@plt>

LLVM IR (-O0):
define i32 @isBlock(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call i32 @isThere(i32 %7, i32 0, i8 signext %8, i8 signext %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @isBlock(i32 %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @isThere(i32 %0, i32 0, i8 signext %1, i8 signext %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_int(char);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  char c;
  int x;
  x = 999999999;
  c = x;
  print_string("Should get -1 due to overflow in char\n");
  print_int(c);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3b9ac9ff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
lea    0xec4(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x1(%rbp),%edi
call   1040 <print_int@plt>
lea    0xed4(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0xffffffff,%edi
call   1040 <print_int@plt>
lea    0xee7(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Should get -1 due to overflow in char\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i8
%2 = alloca i32
store i32 999999999, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = call i32 @print_string(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = load i8, i8* %1
%7 = call i32 @print_int(i8 signext %6)
%8 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Should get -1 due to overflow in char\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_int(i8 signext -1)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printf_Zoidberg() {
  printf(
      "\"Your input is bad and you should feel bad!\" -Dr. John E. Zoidberg\n");
}


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

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

LLVM IR (-O0):
@.str = [68 x i8] c"\22Your input is bad and you should feel bad!\22 -Dr. John E. Zoidberg\0A\00"
define void @printf_Zoidberg() {
%1 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [67 x i8] c"\22Your input is bad and you should feel bad!\22 -Dr. John E. Zoidberg\00"
define void @printf_Zoidberg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signum) { printf("Hello World!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halTimerStop(int, int);
void irqTimerStop(void) { halTimerStop(0x49032000, 0xFF); }


x86 assembly (clang, -O0):
<irqTimerStop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x49032000,%edi
mov    $0xff,%esi
call   1030 <halTimerStop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irqTimerStop>:
mov    $0x49032000,%edi
mov    $0xff,%esi
jmp    1030 <halTimerStop@plt>

LLVM IR (-O0):
define void @irqTimerStop() {
%1 = call i32 @halTimerStop(i32 1224941568, i32 255)
ret void
}

LLVM IR (-O2):
define void @irqTimerStop() {
%1 = tail call i32 @halTimerStop(i32 1224941568, i32 255)
ret void
}
void heapFree(void *userData, void *ptr) {
  do {
    (void)(1 ? (void)0 : ((void)(userData)));
  } while (0);
  free(ptr);
}


x86 assembly (clang, -O0):
<heapFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1125 <heapFree+0x15>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapFree>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @heapFree(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @heapFree(i8* nocapture readnone %0, i8* nocapture %1) {
tail call void @free(i8* %1)
ret void
}
float mid_inv_func(float f) {
  return (1 / (-f + 0.83333333333 + 5.0)) - (1.2 - 1.0);
}


x86 assembly (clang, -O0):
<mid_inv_func>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xef1(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xedd(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xec9(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xeb5(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mid_inv_func>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
subsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
movsd  0xef0(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @mid_inv_func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = fpext float %4 to double
%6 = fadd double %5, 0x3FEAAAAAAAAA3563
%7 = fadd double %6, 5.000000e+00
%8 = fdiv double 1.000000e+00, %7
%9 = fsub double %8, 0x3FC9999999999998
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @mid_inv_func(float %0) {
%2 = fneg float %0
%3 = fpext float %2 to double
%4 = fadd double %3, 0x3FEAAAAAAAAA3563
%5 = fadd double %4, 5.000000e+00
%6 = fdiv double 1.000000e+00, %5
%7 = fadd double %6, 0xBFC9999999999998
%8 = fptrunc double %7 to float
ret float %8
}
void delay(unsigned long aValue) {
  volatile unsigned long i = 0;
  volatile unsigned int j = 0;
  for (i = aValue; i > 0; i--) {
    for (j = 0; j < 100; j++)
      ;
  }
  return;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    $0x0,%rax
jbe    1169 <delay+0x69>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x64,%eax
jae    1153 <delay+0x53>
jmp    1145 <delay+0x45>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <delay+0x34>
jmp    1158 <delay+0x58>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <delay+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movq   $0x0,-0x8(%rsp)
movl   $0x0,-0xc(%rsp)
mov    %rdi,-0x8(%rsp)
jmp    1126 <delay+0x26>
nopl   0x0(%rax,%rax,1)
addq   $0xffffffffffffffff,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
je     1150 <delay+0x50>
movl   $0x0,-0xc(%rsp)
mov    -0xc(%rsp),%eax
cmp    $0x63,%eax
ja     1120 <delay+0x20>
nop
addl   $0x1,-0xc(%rsp)
mov    -0xc(%rsp),%eax
cmp    $0x64,%eax
jb     1140 <delay+0x40>
jmp    1120 <delay+0x20>
ret

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

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = bitcast i64* %2 to i8*
store volatile i64 0, i64* %2
%5 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
store volatile i64 %0, i64* %2
%6 = load volatile i64, i64* %2
%7 = icmp eq i64 %6, 0
br i1 %7, label %21, label %8
8: ; preds = %1, %16
store volatile i32 0, i32* %3
%9 = load volatile i32, i32* %3
%10 = icmp ult i32 %9, 100
br i1 %10, label %11, label %16
11: ; preds = %8, %11
%12 = load volatile i32, i32* %3
%13 = add i32 %12, 1
store volatile i32 %13, i32* %3
%14 = load volatile i32, i32* %3
%15 = icmp ult i32 %14, 100
br i1 %15, label %11, label %16
16: ; preds = %11, %8
%17 = load volatile i64, i64* %2
%18 = add i64 %17, -1
store volatile i64 %18, i64* %2
%19 = load volatile i64, i64* %2
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %8
21: ; preds = %16, %1
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  errno = 0;
  printf("errno: %d\n", errno);
  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)
mov    0x2eb3(%rip),%rax
movl   $0x0,(%rax)
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@errno = global i32 0
@.str = [11 x i8] c"errno: %d\0A\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
store i32 0, i32* @errno
%6 = load i32, i32* @errno
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [11 x i8] c"errno: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
store i32 0, i32* @errno
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
int od_count_overlapping4x4(int bsize) {
  int non_overlapped_count_4x4;
  non_overlapped_count_4x4 = 1 << bsize;
  return 2 * non_overlapped_count_4x4 - 1;
}


x86 assembly (clang, -O0):
<od_count_overlapping4x4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<od_count_overlapping4x4>:
mov    %edi,%ecx
mov    $0x2,%eax
shl    %cl,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @od_count_overlapping4x4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 1, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 2, %6
%8 = sub nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @od_count_overlapping4x4(i32 %0) {
%2 = shl i32 2, %0
%3 = add nsw i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void hsa_ndv_rd_init(const char *fname) {
  fatal("HsaNdv"
        ": This build excluded HSA Endeavour support because expat was not "
        "installed.\n");
}


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

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

LLVM IR (-O0):
@.str = [84 x i8] c"HsaNdv: This build excluded HSA Endeavour support because expat was not installed.\0A\00"
define void @hsa_ndv_rd_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [84 x i8] c"HsaNdv: This build excluded HSA Endeavour support because expat was not installed.\0A\00"
define void @hsa_ndv_rd_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int compare(const void *i1, uint32_t i2) {
  return ((uint32_t)(uintptr_t)i1) == i2;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i64, i64* %4
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = icmp eq i64 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}