xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ push_bytearray(char *, int);
void push_char(char value) { push_bytearray((char *)&value, 1); }


x86 assembly (clang, -O0):
<push_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <push_bytearray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_char>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <push_bytearray@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @push_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @push_bytearray(i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @push_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @push_bytearray(i8* %2, i32 1)
ret void
}
int test_allEvenBits(int x) {
  int i;
  for (i = 0; i < 32; i += 2)
    if ((x & (1 << i)) == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<test_allEvenBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1151 <test_allEvenBits+0x51>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    113e <test_allEvenBits+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1158 <test_allEvenBits+0x58>
jmp    1143 <test_allEvenBits+0x43>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test_allEvenBits+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_allEvenBits>:
not    %edi
xor    %eax,%eax
test   $0x55555555,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @test_allEvenBits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = and i32 %9, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 0, i32* %2
br label %20
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 2
store i32 %18, i32* %4
br label %5
19: ; preds = %5
store i32 1, i32* %2
br label %20
20: ; preds = %19, %14
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @test_allEvenBits(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = icmp eq i32 %2, 1431655765
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int execve(const char *filename, char *const argv[], char *const envp[]) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "execve");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
lea    0xee1(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"execve\00"
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8**
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @assert(i32 0)
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"execve\00"
define i32 @execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @assert(i32 0)
ret i32 undef
}
int fun629() { return 629; }


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

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

LLVM IR (-O0):
define i32 @fun629() {
ret i32 629
}

LLVM IR (-O2):
define i32 @fun629() {
ret i32 629
}
float __cabsf(float _Complex z) { return __hypotf(__real__ z, __imag__ z); }


x86 assembly (clang, -O0):
<__cabsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <__hypotf@plt>
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cabsf>:
push   %rax
cvtss2sd %xmm0,%xmm2
shufps $0x55,%xmm0,%xmm0
cvtss2sd %xmm0,%xmm1
movaps %xmm2,%xmm0
mov    $0x2,%al
call   1030 <__hypotf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @__cabsf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %3
%4 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = call i32 (double, double, ...) bitcast (i32 (...)* @__hypotf to i32 (double, double, ...)*)(double %6, double %9)
%11 = sitofp i32 %10 to float
ret float %11
}

LLVM IR (-O2):
define float @__cabsf(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 0
%3 = fpext float %2 to double
%4 = extractelement <2 x float> %0, i64 1
%5 = fpext float %4 to double
%6 = tail call i32 (double, double, ...) bitcast (i32 (...)* @__hypotf to i32 (double, double, ...)*)(double %3, double %5)
%7 = sitofp i32 %6 to float
ret float %7
}
int CheckINCHIKey(const char *szINCHIKey) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void write_to_file(const char *filename, char *text) {
  FILE *f = fopen(filename, "wb");
  fputs(text, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<write_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define void @write_to_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = call i32 @fputs(i8* %8, i32* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define void @write_to_file(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fputs(i8* %1, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
void ar5312_plat_mem_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @ar5312_plat_mem_setup() {
ret void
}
void av_hmac_calc() {}


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

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

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

LLVM IR (-O2):
define void @av_hmac_calc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  while (1)
    printf("XXX\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c"XXX\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@str = [4 x i8] c"XXX\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int tommy_hashlin_count(void *);
int count_hash_table(void *ht) { return tommy_hashlin_count(ht); }


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

x86 assembly (clang, -O2):
<count_hash_table>:
jmp    1030 <tommy_hashlin_count@plt>

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

LLVM IR (-O2):
define i32 @count_hash_table(i8* %0) {
%2 = tail call i32 @tommy_hashlin_count(i8* %0)
ret i32 %2
}
void ff_hevc_put_hevc_pel_pixels24_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels24_10_avx2() {
ret void
}
void outer_flush_range(unsigned long start, unsigned long end) {}


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

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

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

LLVM IR (-O2):
define void @outer_flush_range(i64 %0, i64 %1) {
ret void
}
void randLIB_seed_random(void) {}


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

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

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

LLVM IR (-O2):
define void @randLIB_seed_random() {
ret void
}
void gtk_separator_tool_item_set_draw() {}


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

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

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

LLVM IR (-O2):
define void @gtk_separator_tool_item_set_draw() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void exit_error(char *message) {
  fprintf(stderr, "ERROR: %s\n", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<exit_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @exit_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @exit_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ bundle_raw_get_sdnv_off(int /*<<< orphan*/ const *, int);
scalar_t__ sdnv_decode(int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int bundle_raw_get_lifetime(const uint8_t *bundle_raw, uint64_t *lifetime) {
  unsigned off = 0;
  off++;
  off += bundle_raw_get_sdnv_off(bundle_raw + off, 12);
  off += sdnv_decode(bundle_raw + off, lifetime);
  return 0;
}


x86 assembly (clang, -O0):
<bundle_raw_get_lifetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    $0xc,%esi
call   1040 <bundle_raw_get_sdnv_off@plt>
mov    %rax,%rcx
mov    -0x14(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sdnv_decode@plt>
mov    %rax,%rcx
mov    -0x14(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bundle_raw_get_lifetime>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x4,%rdi
mov    $0xc,%esi
call   1040 <bundle_raw_get_sdnv_off@plt>
add    $0x1,%eax
lea    (%rbx,%rax,4),%rdi
mov    %r14,%rsi
call   1030 <sdnv_decode@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @bundle_raw_get_lifetime(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i32, i32* %5
%7 = add i32 %6, 1
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i64 @bundle_raw_get_sdnv_off(i32* %11, i32 12)
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = add nsw i64 %14, %12
%16 = trunc i64 %15 to i32
store i32 %16, i32* %5
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32*, i32** %4
%22 = call i64 @sdnv_decode(i32* %20, i32* %21)
%23 = load i32, i32* %5
%24 = zext i32 %23 to i64
%25 = add nsw i64 %24, %22
%26 = trunc i64 %25 to i32
store i32 %26, i32* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @bundle_raw_get_lifetime(i32* %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = tail call i64 @bundle_raw_get_sdnv_off(i32* %3, i32 12)
%5 = add i64 %4, 1
%6 = and i64 %5, 4294967295
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i64 @sdnv_decode(i32* %7, i32* %1)
ret i32 0
}
int test_imm_28int64_highword_reg(long long val) {
  return ((val >> 32) & (0x28 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_28int64_highword_reg>:
movabs $0x2800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_28int64_highword_reg(i64 %0) {
%2 = and i64 %0, 171798691840
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int xmlUCSIsMiscellaneousTechnical(int code) {
  return (((code >= 0x2300) && (code <= 0x23FF)));
}


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

LLVM IR (-O0):
define i32 @xmlUCSIsMiscellaneousTechnical(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 8960
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 9215
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 @xmlUCSIsMiscellaneousTechnical(i32 %0) {
%2 = and i32 %0, -256
%3 = icmp eq i32 %2, 8960
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void oh_no(void) {
  char **s = NULL;
  *s = "BOOM";
}


x86 assembly (clang, -O0):
<oh_no>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xee9(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [5 x i8] c"BOOM\00"
define void @oh_no() {
%1 = alloca i8**
store i8** null, i8*** %1
%2 = load i8**, i8*** %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
ret void
}

LLVM IR (-O2):
int clist_destroy(struct clist *list) {
  (void)list;
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.clist = type opaque
define i32 @clist_destroy(%struct.clist* nocapture readnone %0) {
ret i32 1
}
unsigned char *write_be32(unsigned char *buf, int a) {
  buf[0] = (a >> 24) & 0xff;
  buf[1] = (a >> 16) & 0xff;
  buf[2] = (a >> 8) & 0xff;
  buf[3] = (a >> 0) & 0xff;
  return &buf[4];
}


x86 assembly (clang, -O0):
<write_be32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_be32>:
bswap  %esi
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @write_be32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %4
%24 = ashr i32 %23, 0
%25 = and i32 %24, 255
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %26, i8* %28
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 4
ret i8* %30
}

LLVM IR (-O2):
define i8* @write_be32(i8* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %13
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ errx(int, char *);
int /*<<< orphan*/ gcsummary(int, char *);
int main(int argc, char **argv) {
  int LotNr;
  char *subname;
  if (argc < 3)
    errx(1, "Usage: ./gcsummary lotnr subname");
  LotNr = atoi(argv[1]);
  subname = argv[2];
  gcsummary(LotNr, subname);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1161 <main+0x31>
mov    $0x1,%edi
lea    0xea4(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <gcsummary@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     114a <main+0x1a>
lea    0xec0(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
mov    0x10(%rbx),%rsi
mov    %eax,%edi
call   1050 <gcsummary@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: ./gcsummary lotnr subname\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
store i8* %19, i8** %7
%20 = load i32, i32* %6
%21 = load i8*, i8** %7
%22 = call i32 @gcsummary(i32 %20, i8* %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: ./gcsummary lotnr subname\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @gcsummary(i32 %9, i8* %11)
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
char *get_env(char *var_name) {
  char *val;
  if ((val = getenv(var_name)) != NULL)
    return val;
  val = "\0";
  return val;
}


x86 assembly (clang, -O0):
<get_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1140 <get_env+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <get_env+0x43>
lea    0xeb9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_env>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] zeroinitializer
define i8* @get_env(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @getenv(i8* %5)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %4
store i8* %9, i8** %2
br label %12
10: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %4
%11 = load i8*, i8** %4
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %8
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [2 x i8] zeroinitializer
define i8* @get_env(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
void foo_2_2_1_2_2_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_2_1_1_1_2() {
ret void
}
/* Type definitions */
struct server_list {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_sort(struct genlist *,
                                int (*)(void const *, void const *));
void server_list_sort(struct server_list *tthis,
                      int (*compar)(const struct server *const *,
                                    const struct server *const *)) {
  genlist_sort(((struct genlist *)(tthis)),
               (int (*)(const void *, const void *))compar);
}


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

x86 assembly (clang, -O2):
<server_list_sort>:
jmp    1030 <genlist_sort@plt>

LLVM IR (-O0):
%struct.server_list = type { i32 }
%struct.server = type opaque
%struct.genlist = type { i32 }
define void @server_list_sort(%struct.server_list* %0, i32 (%struct.server**, %struct.server**)* %1) {
%3 = alloca %struct.server_list*
%4 = alloca i32 (%struct.server**, %struct.server**)*
store %struct.server_list* %0, %struct.server_list** %3
store i32 (%struct.server**, %struct.server**)* %1, i32 (%struct.server**, %struct.server**)** %4
%5 = load %struct.server_list*, %struct.server_list** %3
%6 = bitcast %struct.server_list* %5 to %struct.genlist*
%7 = load i32 (%struct.server**, %struct.server**)*, i32 (%struct.server**, %struct.server**)** %4
%8 = bitcast i32 (%struct.server**, %struct.server**)* %7 to i32 (i8*, i8*)*
%9 = call i32 @genlist_sort(%struct.genlist* %6, i32 (i8*, i8*)* %8)
ret void
}

LLVM IR (-O2):
%struct.server_list = type { i32 }
%struct.server = type opaque
%struct.genlist = type { i32 }
define void @server_list_sort(%struct.server_list* %0, i32 (%struct.server**, %struct.server**)* %1) {
%3 = bitcast %struct.server_list* %0 to %struct.genlist*
%4 = bitcast i32 (%struct.server**, %struct.server**)* %1 to i32 (i8*, i8*)*
%5 = tail call i32 @genlist_sort(%struct.genlist* %3, i32 (i8*, i8*)* %4)
ret void
}
int otoi(str)
unsigned char str[];
{
  int result;
  (void)sscanf((char *)str, "%o", &result);
  return (result);
}


x86 assembly (clang, -O0):
<otoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%o\00"
define i32 @otoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%o\00"
define i32 @otoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
float _cosf(float);
float cosf(float angle) { return _cosf(angle); }


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

x86 assembly (clang, -O2):
<cosf>:
jmp    1030 <_cosf@plt>

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

LLVM IR (-O2):
define float @cosf(float %0) {
%2 = tail call float @_cosf(float %0)
ret float %2
}
/* Variables and functions */
int length(int *);
int *nextBlock(int *p) { return (p + length(p) / 4); }


x86 assembly (clang, -O0):
<nextBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <length@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextBlock>:
push   %rbx
mov    %rdi,%rbx
call   1030 <length@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
movslq %ecx,%rax
lea    (%rbx,%rax,4),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @nextBlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @length(i32* %4)
%6 = sdiv i32 %5, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %3, i64 %7
ret i32* %8
}

LLVM IR (-O2):
define i32* @nextBlock(i32* %0) {
%2 = tail call i32 @length(i32* %0)
%3 = sdiv i32 %2, 4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
ret i32* %5
}
signed int light_bbox(void *obj, struct anon$0 *min, struct anon$0 *max) {
  return 0;
}


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

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

LLVM IR (-O0):
%"struct.anon$0" = type opaque
define i32 @light_bbox(i8* %0, %"struct.anon$0"* %1, %"struct.anon$0"* %2) {
%4 = alloca i8*
%5 = alloca %"struct.anon$0"*
%6 = alloca %"struct.anon$0"*
store i8* %0, i8** %4
store %"struct.anon$0"* %1, %"struct.anon$0"** %5
store %"struct.anon$0"* %2, %"struct.anon$0"** %6
ret i32 0
}

LLVM IR (-O2):
%"struct.anon$0" = type opaque
define i32 @light_bbox(i8* nocapture readnone %0, %"struct.anon$0"* nocapture readnone %1, %"struct.anon$0"* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int check_S(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int do_validate_grammar(FILE *src) {
  int ret;
  rewind(src);
  while (1) {
    ret = check_S(src);
    if (ret == 0) {
      return 0;
    } else if (ret == -1) {
      return 1;
    }
  }
}


x86 assembly (clang, -O0):
<do_validate_grammar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1040 <check_S@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1157 <do_validate_grammar+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1177 <do_validate_grammar+0x57>
cmpl   $0xffffffff,-0x14(%rbp)
jne    116d <do_validate_grammar+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1177 <do_validate_grammar+0x57>
jmp    1172 <do_validate_grammar+0x52>
jmp    1135 <do_validate_grammar+0x15>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_validate_grammar>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rewind@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <check_S@plt>
cmp    $0xffffffff,%eax
je     1143 <do_validate_grammar+0x23>
test   %eax,%eax
jne    1130 <do_validate_grammar+0x10>
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @do_validate_grammar(i32* %0) {
%2 = tail call i32 @rewind(i32* %0)
br label %3
3: ; preds = %3, %1
%4 = tail call i32 @check_S(i32* %0)
switch i32 %4, label %3 [
i32 0, label %5
i32 -1, label %6
]
5: ; preds = %3
br label %6
6: ; preds = %3, %5
%7 = phi i32 [ %4, %5 ], [ 1, %3 ]
ret i32 %7
}
/* Type definitions */
struct event_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void beat2000(struct event_loop *loop, int id, void *data) {
  printf("heartbeat every 2s\n");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.event_loop = type { i32 }
@.str = [20 x i8] c"heartbeat every 2s\0A\00"
define void @beat2000(%struct.event_loop* %0, i32 %1, i8* %2) {
%4 = alloca %struct.event_loop*
%5 = alloca i32
%6 = alloca i8*
store %struct.event_loop* %0, %struct.event_loop** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.event_loop = type { i32 }
@str = [19 x i8] c"heartbeat every 2s\00"
define void @beat2000(%struct.event_loop* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bailout_plan(int sig) {
  fprintf(stderr, "watchdog timer expired, exiting..\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<bailout_plan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bailout_plan>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"watchdog timer expired, exiting..\0A\00"
@EXIT_FAILURE = global i32 0
define void @bailout_plan(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"watchdog timer expired, exiting..\0A\00"
@EXIT_FAILURE = global i32 0
define void @bailout_plan(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ erase();
int /*<<< orphan*/ refresh();
void curses_stop(void) {
  erase();
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<curses_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <erase@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<curses_stop>:
push   %rax
xor    %eax,%eax
call   1030 <erase@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <endwin@plt>

LLVM IR (-O0):
define void @curses_stop() {
%1 = call i32 (...) @erase()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @curses_stop() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  char side_a[] = "Side A";
  char dont[] = {'W', 'O', 'W', '!'};
  char side_b[] = "Side B";
  puts(dont);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xebc(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xeb6(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    0xeae(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0xf(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x21574f57,0x4(%rsp)
21
lea    0x4(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.side_a = [7 x i8] c"Side A\00"
@__const.main.dont = [4 x i8] c"WOW!"
@__const.main.side_b = [7 x i8] c"Side B\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [4 x i8]
%4 = alloca [7 x i8]
store i32 0, i32* %1
%5 = bitcast [7 x i8]* %2 to i8*
%6 = bitcast [4 x i8]* %3 to i8*
%7 = bitcast [7 x i8]* %4 to i8*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 559370071, i32* %1
%3 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test0();
int /*<<< orphan*/ test1();
int main(int argc, char **argv) {
  test0();
  test1();
  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    $0x0,%al
call   1040 <test0@plt>
mov    $0x0,%al
call   1030 <test1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test0()
%4 = tail call i32 (...) @test1()
ret i32 0
}
void kinetis_disable_debug() {}


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

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

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

LLVM IR (-O2):
define void @kinetis_disable_debug() {
ret void
}
/* Variables and functions */
unsigned int TMP_MAX;
unsigned int scalanative_libc_tmp_max() { return TMP_MAX; }


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

x86 assembly (clang, -O2):
<scalanative_libc_tmp_max>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@TMP_MAX = global i32 0
define i32 @scalanative_libc_tmp_max() {
%1 = load i32, i32* @TMP_MAX
ret i32 %1
}

LLVM IR (-O2):
@TMP_MAX = global i32 0
define i32 @scalanative_libc_tmp_max() {
%1 = load i32, i32* @TMP_MAX
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
int func_19(int *p_20, unsigned p_21, int *p_22) {
  unsigned short l_334 = 0xBC54L;
  step_hash(137);
  return l_334;
}


x86 assembly (clang, -O0):
<func_19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movw   $0xbc54,-0x1a(%rbp)
mov    $0x89,%edi
call   1030 <step_hash@plt>
movzwl -0x1a(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_19>:
push   %rax
mov    $0x89,%edi
call   1030 <step_hash@plt>
mov    $0xbc54,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func_19(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i16
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i16 -17324, i16* %7
%8 = call i32 @step_hash(i32 137)
%9 = load i16, i16* %7
%10 = zext i16 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @func_19(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
%4 = tail call i32 @step_hash(i32 137)
ret i32 48212
}
int Binary_Search(int *a, int n, int key) {
  int low, high, mid;
  low = 1;
  high = n;
  while (low <= high) {
    mid = (low + high) / 2;
    if (key <= a[mid])
      high = mid - 1;
    else if (key > a[mid])
      low = mid + 1;
    else
      return mid;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Binary_Search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     1191 <Binary_Search+0x91>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jg     115a <Binary_Search+0x5a>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    118c <Binary_Search+0x8c>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    117c <Binary_Search+0x7c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1187 <Binary_Search+0x87>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1198 <Binary_Search+0x98>
jmp    118c <Binary_Search+0x8c>
jmp    111b <Binary_Search+0x1b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Binary_Search(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 1, i32* %8
%11 = load i32, i32* %6
store i32 %11, i32* %9
br label %12
12: ; preds = %45, %3
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %46
16: ; preds = %12
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = add nsw i32 %17, %18
%20 = sdiv i32 %19, 2
store i32 %20, i32* %10
%21 = load i32, i32* %7
%22 = load i32*, i32** %5
%23 = load i32, i32* %10
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = icmp sle i32 %21, %26
br i1 %27, label %28, label %31
28: ; preds = %16
%29 = load i32, i32* %10
%30 = sub nsw i32 %29, 1
store i32 %30, i32* %9
br label %45
31: ; preds = %16
%32 = load i32, i32* %7
%33 = load i32*, i32** %5
%34 = load i32, i32* %10
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %33, i64 %35
%37 = load i32, i32* %36
%38 = icmp sgt i32 %32, %37
br i1 %38, label %39, label %42
39: ; preds = %31
%40 = load i32, i32* %10
%41 = add nsw i32 %40, 1
store i32 %41, i32* %8
br label %44
42: ; preds = %31
%43 = load i32, i32* %10
store i32 %43, i32* %4
br label %47
44: ; preds = %39
br label %45
45: ; preds = %44, %28
br label %12
46: ; preds = %12
store i32 0, i32* %4
br label %47
47: ; preds = %46, %42
%48 = load i32, i32* %4
ret i32 %48
}

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


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_1_Box_16_C() {
ret void
}
void adis16201_remove_trigger(struct iio_dev *indio_dev) {}


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define void @adis16201_remove_trigger(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret void
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @adis16201_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}