xunge/DecIR huggingface dataset:
char serial_getchar(void) {
  char c;
  while (((((*(volatile unsigned *)((((0x03ff0000) + 0xD000)) + 0x08))) &
           (1 << 5))) == 0)
    ;
  c = (*(volatile unsigned *)((((0x03ff0000) + 0xD000)) + 0x10));
  while ((((*(volatile unsigned *)((((0x03ff0000) + 0xD000)) + 0x08))) &
          (1 << 6)) == 0)
    ;
  (*(unsigned *)((((0x03ff0000) + 0xD000)) + 0x0C) = (unsigned)(c));
  return c;
}


x86 assembly (clang, -O0):
<serial_getchar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ffd008,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    111c <serial_getchar+0x1c>
jmp    1104 <serial_getchar+0x4>
mov    $0x3ffd010,%eax
mov    (%rax),%eax
mov    %al,-0x1(%rbp)
mov    $0x3ffd008,%eax
mov    (%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
jne    113e <serial_getchar+0x3e>
jmp    1126 <serial_getchar+0x26>
movsbl -0x1(%rbp),%ecx
mov    $0x3ffd00c,%eax
mov    %ecx,(%rax)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_getchar>:
testl  $0x20,0x3ffd008
je     1100 <serial_getchar>
mov    0x3ffd010,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
testl  $0x40,0x3ffd008
je     1120 <serial_getchar+0x20>
movsbl %al,%eax
mov    %eax,0x3ffd00c
ret

LLVM IR (-O0):
define signext i8 @serial_getchar() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load volatile i32, i32* inttoptr (i64 67096592 to i32*)
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
br label %10
10: ; preds = %14, %7
%11 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%12 = and i32 %11, 64
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
store i32 %17, i32* inttoptr (i64 67096588 to i32*)
%18 = load i8, i8* %1
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @serial_getchar() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 67096592 to i32*)
br label %7
7: ; preds = %7, %5
%8 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%9 = and i32 %8, 64
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
%12 = trunc i32 %6 to i8
%13 = shl i32 %6, 24
%14 = ashr exact i32 %13, 24
store i32 %14, i32* inttoptr (i64 67096588 to i32*)
ret i8 %12
}
int fun1180() { return 1180; }


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

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

LLVM IR (-O0):
define i32 @fun1180() {
ret i32 1180
}

LLVM IR (-O2):
define i32 @fun1180() {
ret i32 1180
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void tft_blit(uint16_t *bits, uint32_t width, uint32_t height, uint32_t x,
              uint32_t y) {
  (void)bits;
  (void)width;
  (void)height;
  (void)x;
  (void)y;
}


x86 assembly (clang, -O0):
<tft_blit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @tft_blit(i32* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enableInt();
char getchar();
int /*<<< orphan*/ initInterrupts();
int /*<<< orphan*/ loadIntVectors();
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ serialInit();
int /*<<< orphan*/ serialInit2();
int /*<<< orphan*/ timer0Start();
int app_main() {
  char ch;
  serialInit();
  serialInit2();
  puts("\r\nTimer Interrupt Demo Program \r\n");
  loadIntVectors();
  initInterrupts();
  enableInt();
  timer0Start();
  while (1) {
    ch = getchar();
    putchar(ch);
  }
  return 0;
}


x86 assembly (clang, -O0):
<app_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1080 <serialInit@plt>
mov    $0x0,%al
call   10b0 <serialInit2@plt>
lea    0xe53(%rip),%rdi
call   1050 <puts@plt>
mov    $0x0,%al
call   1040 <loadIntVectors@plt>
mov    $0x0,%al
call   10a0 <initInterrupts@plt>
mov    $0x0,%al
call   1060 <enableInt@plt>
mov    $0x0,%al
call   1070 <timer0Start@plt>
mov    $0x0,%al
call   1090 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
jmp    11ce <app_main+0x3e>

x86 assembly (clang, -O2):
<app_main>:
push   %rax
xor    %eax,%eax
call   1080 <serialInit@plt>
xor    %eax,%eax
call   10b0 <serialInit2@plt>
lea    0xe5a(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1040 <loadIntVectors@plt>
xor    %eax,%eax
call   10a0 <initInterrupts@plt>
xor    %eax,%eax
call   1060 <enableInt@plt>
xor    %eax,%eax
call   1070 <timer0Start@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    11d0 <app_main+0x40>

LLVM IR (-O0):
@.str = [34 x i8] c"\0D\0ATimer Interrupt Demo Program \0D\0A\00"
define i32 @app_main() {
%1 = alloca i8
%2 = call i32 (...) @serialInit()
%3 = call i32 (...) @serialInit2()
%4 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @loadIntVectors()
%6 = call i32 (...) @initInterrupts()
%7 = call i32 (...) @enableInt()
%8 = call i32 (...) @timer0Start()
br label %9
9: ; preds = %0, %9
%10 = call signext i8 (...) @getchar()
store i8 %10, i8* %1
%11 = load i8, i8* %1
%12 = call i32 @putchar(i8 signext %11)
br label %9
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0D\0ATimer Interrupt Demo Program \0D\0A\00"
define i32 @app_main() {
%1 = tail call i32 (...) @serialInit()
%2 = tail call i32 (...) @serialInit2()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @loadIntVectors()
%5 = tail call i32 (...) @initInterrupts()
%6 = tail call i32 (...) @enableInt()
%7 = tail call i32 (...) @timer0Start()
br label %8
8: ; preds = %8, %0
%9 = tail call signext i8 (...) @getchar()
%10 = tail call i32 @putchar(i8 signext %9)
br label %8
}
void ktsan_irq_save(void) {}


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

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

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

LLVM IR (-O2):
define void @ktsan_irq_save() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UI_PopMenu();
void UI_CinematicsMenu_BackEvent(void *ptr, int event) {
  if (event != 3) {
    return;
  }
  UI_PopMenu();
}


x86 assembly (clang, -O0):
<UI_CinematicsMenu_BackEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
je     112e <UI_CinematicsMenu_BackEvent+0x1e>
jmp    1135 <UI_CinematicsMenu_BackEvent+0x25>
mov    $0x0,%al
call   1030 <UI_PopMenu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_CinematicsMenu_BackEvent>:
cmp    $0x3,%esi
jne    111c <UI_CinematicsMenu_BackEvent+0xc>
xor    %eax,%eax
jmp    1030 <UI_PopMenu@plt>
ret

LLVM IR (-O0):
define void @UI_CinematicsMenu_BackEvent(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 = icmp ne i32 %5, 3
br i1 %6, label %7, label %8
7: ; preds = %2
br label %10
8: ; preds = %2
%9 = call i32 (...) @UI_PopMenu()
br label %10
10: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @UI_CinematicsMenu_BackEvent(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @UI_PopMenu()
br label %6
6: ; preds = %2, %4
ret void
}
void *cast_test_int() {
  int *x = (int *)malloc(sizeof(int));
  *x = 23;
  return x;
}


x86 assembly (clang, -O0):
<cast_test_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x17,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_test_int>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x17,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @cast_test_int() {
%1 = alloca i32*
%2 = call i8* @malloc(i64 4)
%3 = bitcast i8* %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 23, i32* %4
%5 = load i32*, i32** %1
%6 = bitcast i32* %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @cast_test_int() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%2 = bitcast i8* %1 to i32*
store i32 23, i32* %2
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ ir_remote_init_32k_mode();
void init_custom_trigger(void) { ir_remote_init_32k_mode(); }


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

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

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

LLVM IR (-O2):
define void @init_custom_trigger() {
%1 = tail call i32 (...) @ir_remote_init_32k_mode()
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double logb(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<logb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @logb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @logb(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_shuffle_epi32(int /*<<< orphan*/, int);
__m128i __attribute__((no, unused)) test(__m128i s1) {
  return _mm_shuffle_epi32(s1, 0xec);
}


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

x86 assembly (clang, -O2):
<test>:
mov    $0xec,%esi
jmp    1030 <_mm_shuffle_epi32@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = tail call i32 @_mm_shuffle_epi32(i32 %0, i32 236)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(int);
int url_is_scheme_char(int c) {
  return !(!isalpha(c) && ('+' != c) && ('-' != c) && ('.' != c));
}


x86 assembly (clang, -O0):
<url_is_scheme_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1167 <url_is_scheme_char+0x57>
xor    %eax,%eax
mov    $0x2b,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
je     1167 <url_is_scheme_char+0x57>
xor    %eax,%eax
mov    $0x2d,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
je     1167 <url_is_scheme_char+0x57>
mov    $0x2e,%eax
cmp    -0x4(%rbp),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_is_scheme_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1125 <url_is_scheme_char+0x15>
pop    %rbx
ret
cmp    $0x2b,%ebx
je     1123 <url_is_scheme_char+0x13>
cmp    $0x2d,%ebx
je     1123 <url_is_scheme_char+0x13>
xor    %eax,%eax
cmp    $0x2e,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @url_is_scheme_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isalpha(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 43, %7
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp ne i32 45, %10
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp ne i32 46, %13
br label %15
15: ; preds = %12, %9, %6, %1
%16 = phi i1 [ false, %9 ], [ false, %6 ], [ false, %1 ], [ %14, %12 ]
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @url_is_scheme_char(i32 %0) {
%2 = tail call i32 @isalpha(i32 %0)
%3 = freeze i32 %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i32 %0, label %6 [
i32 45, label %9
i32 43, label %9
]
6: ; preds = %5
%7 = icmp eq i32 %0, 46
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ]
ret i32 %10
}
int func(int *a) {
  int i, sum = 0;
#pragma acc data present(a [0:10])
  {
#pragma acc parallel loop reduction(+ : sum)
    for (i = 0; i < 10; i++) {
      sum += a[i];
    }
  }
  return sum;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    113f <func+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <func+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
movdqu 0x8(%rdi),%xmm0
movdqu 0x18(%rdi),%xmm1
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
add    0x4(%rdi),%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @func(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = bitcast i32* %5 to <8 x i32>*
%7 = load <8 x i32>, <8 x i32>* %6
%8 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %7)
%9 = add nsw i32 %8, %4
%10 = add nsw i32 %9, %2
ret i32 %10
}
int fun512() { return 512; }


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

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

LLVM IR (-O0):
define i32 @fun512() {
ret i32 512
}

LLVM IR (-O2):
define i32 @fun512() {
ret i32 512
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void signal_handler(int x) {
  printf("\n\nCaught signal %d, exiting...\n", x);
  cleanup();
  exit(x);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0A\0ACaught signal %d, exiting...\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @cleanup()
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0A\0ACaught signal %d, exiting...\0A\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @cleanup()
%4 = tail call i32 @exit(i32 %0)
unreachable
}
int main() {
  int a = -5;
  int *aa = &a;
  int *const *aaa = &aa;
  int **intarray[] = {aaa};
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xfffffffb,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
%4 = alloca [1 x i32**]
store i32 -5, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
%5 = getelementptr inbounds [1 x i32**], [1 x i32**]* %4, i64 0, i64 0
%6 = load i32**, i32*** %3
store i32** %6, i32*** %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct tms {
  int /*<<< orphan*/ tms_stime;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t get_tms_stime(struct tms *ptms) { return ptms->tms_stime; }


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

x86 assembly (clang, -O2):
<get_tms_stime>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @get_tms_stime(%struct.tms* nocapture %0) {
%2 = getelementptr inbounds %struct.tms, %struct.tms* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int random();
int vocableCount();
int randomVocableIndex() {
  int randomInt = random() % vocableCount();
  return ++randomInt;
}


x86 assembly (clang, -O0):
<randomVocableIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <vocableCount@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomVocableIndex>:
push   %rbx
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <vocableCount@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randomVocableIndex() {
%1 = alloca i32
%2 = call i32 (...) @random()
%3 = call i32 (...) @vocableCount()
%4 = srem i32 %2, %3
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @randomVocableIndex() {
%1 = tail call i32 (...) @random()
%2 = tail call i32 (...) @vocableCount()
%3 = srem i32 %1, %2
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/, int, size_t);
size_t vmbuf_capacity(struct vmbuf *);
int /*<<< orphan*/ vmbuf_mem(struct vmbuf *);
int /*<<< orphan*/ vmbuf_resize_if_less(struct vmbuf *, size_t);
void vmbuf_memset(struct vmbuf *vmbuf, int c, size_t n) {
  if (vmbuf_capacity(vmbuf) < n)
    vmbuf_resize_if_less(vmbuf, n);
  memset(vmbuf_mem(vmbuf), c, n);
}


x86 assembly (clang, -O0):
<vmbuf_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vmbuf_capacity@plt>
cmp    -0x18(%rbp),%rax
jae    1173 <vmbuf_memset+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <vmbuf_resize_if_less@plt>
mov    -0x8(%rbp),%rdi
call   1040 <vmbuf_mem@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1060 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmbuf_memset>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
call   1030 <vmbuf_capacity@plt>
cmp    %rbx,%rax
jae    1162 <vmbuf_memset+0x22>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1050 <vmbuf_resize_if_less@plt>
mov    %rbp,%rdi
call   1040 <vmbuf_mem@plt>
mov    %eax,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <memset@plt>

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define void @vmbuf_memset(%struct.vmbuf* %0, i32 %1, i64 %2) {
%4 = alloca %struct.vmbuf*
%5 = alloca i32
%6 = alloca i64
store %struct.vmbuf* %0, %struct.vmbuf** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load %struct.vmbuf*, %struct.vmbuf** %4
%8 = call i64 @vmbuf_capacity(%struct.vmbuf* %7)
%9 = load i64, i64* %6
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load %struct.vmbuf*, %struct.vmbuf** %4
%13 = load i64, i64* %6
%14 = call i32 @vmbuf_resize_if_less(%struct.vmbuf* %12, i64 %13)
br label %15
15: ; preds = %11, %3
%16 = load %struct.vmbuf*, %struct.vmbuf** %4
%17 = call i32 @vmbuf_mem(%struct.vmbuf* %16)
%18 = load i32, i32* %5
%19 = load i64, i64* %6
%20 = call i32 @memset(i32 %17, i32 %18, i64 %19)
ret void
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define void @vmbuf_memset(%struct.vmbuf* %0, i32 %1, i64 %2) {
%4 = tail call i64 @vmbuf_capacity(%struct.vmbuf* %0)
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @vmbuf_resize_if_less(%struct.vmbuf* %0, i64 %2)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @vmbuf_mem(%struct.vmbuf* %0)
%10 = tail call i32 @memset(i32 %9, i32 %1, i64 %2)
ret void
}
/* Type definitions */
struct track_info {
  int dummy;
};

/* Variables and functions */
int track_info_matches_full(struct track_info const *, char const *,
                            unsigned int, int /*<<< orphan*/, int);
int track_info_matches(const struct track_info *ti, const char *text,
                       unsigned int flags) {
  return track_info_matches_full(ti, text, flags, 0, 1);
}


x86 assembly (clang, -O0):
<track_info_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <track_info_matches_full@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<track_info_matches>:
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <track_info_matches_full@plt>

LLVM IR (-O0):
%struct.track_info = type { i32 }
define i32 @track_info_matches(%struct.track_info* %0, i8* %1, i32 %2) {
%4 = alloca %struct.track_info*
%5 = alloca i8*
%6 = alloca i32
store %struct.track_info* %0, %struct.track_info** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.track_info*, %struct.track_info** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @track_info_matches_full(%struct.track_info* %7, i8* %8, i32 %9, i32 0, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.track_info = type { i32 }
define i32 @track_info_matches(%struct.track_info* %0, i8* %1, i32 %2) {
%4 = tail call i32 @track_info_matches_full(%struct.track_info* %0, i8* %1, i32 %2, i32 0, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ init();
int main(void) {
  init();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
ret i32 0
}
int do_065() { return 65; }


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

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

LLVM IR (-O0):
define i32 @do_065() {
ret i32 65
}

LLVM IR (-O2):
define i32 @do_065() {
ret i32 65
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_208() {
  Assert_real((isqrt(208) == 14),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1045, ("Integer square root of 208 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_208>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd0,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x415,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_208>:
push   %rax
mov    $0xd0,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x415,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 208 should be 14\00"
define void @t_sqrt_208() {
%1 = call i32 @isqrt(i32 208)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1045, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 208 should be 14\00"
define void @t_sqrt_208() {
%1 = tail call i32 @isqrt(i32 208)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1045, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void fun(void) { puts("1337\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"1337\0A\00"
define void @fun() {
%1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"1337\0A\00"
define void @fun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
char *put_stringn(char *, char *const, char *const, char *const);
char *put_uint_r(unsigned int, unsigned int const, char const, char *const);
char *put_uint(unsigned v, const unsigned w, const char wc, char *const p,
               char *const e) {
  char buf[16];
  char *const se = buf + (sizeof(buf) / sizeof((buf)[0]));
  char *sp = put_uint_r(v, w, wc, se);
  return put_stringn(sp, se, p, e);
}


x86 assembly (clang, -O0):
<put_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
lea    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x9(%rbp),%al
mov    -0x38(%rbp),%rcx
movsbl %al,%edx
call   1040 <put_uint_r@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <put_stringn@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_uint>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %r8,%r14
mov    %rcx,%rbx
lea    0x10(%rsp),%r15
mov    %r15,%rcx
call   1040 <put_uint_r@plt>
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <put_stringn@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @put_uint(i32 %0, i32 %1, i8 signext %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [16 x i8]
%12 = alloca i8*
%13 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%15 = getelementptr inbounds i8, i8* %14, i64 16
store i8* %15, i8** %12
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i8, i8* %8
%19 = load i8*, i8** %12
%20 = call i8* @put_uint_r(i32 %16, i32 %17, i8 signext %18, i8* %19)
store i8* %20, i8** %13
%21 = load i8*, i8** %13
%22 = load i8*, i8** %12
%23 = load i8*, i8** %9
%24 = load i8*, i8** %10
%25 = call i8* @put_stringn(i8* %21, i8* %22, i8* %23, i8* %24)
ret i8* %25
}

LLVM IR (-O2):
define i8* @put_uint(i32 %0, i32 %1, i8 signext %2, i8* %3, i8* %4) {
%6 = alloca [16 x i8]
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 16
%9 = call i8* @put_uint_r(i32 %0, i32 %1, i8 signext %2, i8* %8)
%10 = call i8* @put_stringn(i8* %9, i8* %8, i8* %3, i8* %4)
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ daemonize();
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  daemonize();
  while (1)
    sleep(1);
}


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   1030 <daemonize@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <daemonize@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

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 (...) @daemonize()
br label %7
7: ; preds = %2, %7
%8 = call i32 @sleep(i32 1)
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @daemonize()
br label %4
4: ; preds = %2, %4
%5 = tail call i32 @sleep(i32 1)
br label %4
}
/* Variables and functions */
int blob_count(int, int, int **);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int grid[5][5] = {
      {1, 1, 0, 0, 0}, {0, 1, 1, 0, 0}, {0, 0, 1, 1, 1},
      {1, 0, 0, 0, 1}, {0, 1, 0, 1, 1},
  };
  printf("Blob count: %d\n", blob_count(1, 1, grid));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rdx
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <blob_count@plt>
mov    %eax,%esi
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
mov    0xf36(%rip),%eax
mov    %eax,0x60(%rsp)
movaps 0xf1b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeff(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeab(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8f(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <blob_count@plt>
lea    0xed6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.grid = [5 x [5 x i32]] [[5 x i32] [i32 1, i32 1, i32 0, i32 0, i32 0], [5 x i32] [i32 0, i32 1, i32 1, i32 0, i32 0], [5 x i32] [i32 0, i32 0, i32 1, i32 1, i32 1], [5 x i32] [i32 1, i32 0, i32 0, i32 0, i32 1], [5 x i32] [i32 0, i32 1, i32 0, i32 1, i32 1]]
@.str = [16 x i8] c"Blob count: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i32]]
store i32 0, i32* %1
%3 = bitcast [5 x [5 x i32]]* %2 to i8*
%4 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%5 = bitcast [5 x i32]* %4 to i32**
%6 = call i32 @blob_count(i32 1, i32 1, i32** %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.grid = [5 x [5 x i32]] [[5 x i32] [i32 1, i32 1, i32 0, i32 0, i32 0], [5 x i32] [i32 0, i32 1, i32 1, i32 0, i32 0], [5 x i32] [i32 0, i32 0, i32 1, i32 1, i32 1], [5 x i32] [i32 1, i32 0, i32 0, i32 0, i32 1], [5 x i32] [i32 0, i32 1, i32 0, i32 1, i32 1]]
@.str = [16 x i8] c"Blob count: %d\0A\00"
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = bitcast [5 x [5 x i32]]* %1 to i8*
%3 = bitcast [5 x [5 x i32]]* %1 to i32**
%4 = call i32 @blob_count(i32 1, i32 1, i32** %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int main(void) {
  int var = 0;
  if (1)
    ++var;
  if (1) {
    ++var;
  }
  if (1)
    ++var;
  else
    --var;
  if (1) {
    ++var;
  } else if (2) {
    ++var;
  } else {
    --var;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "munpack version %s\n", "1.6");
  fprintf(stderr, "usage: munpack [-f] [-q] [-t] [-C directory] [files...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed9(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
lea    0xedc(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"munpack version %s\0A\00"
@.str.1 = [4 x i8] c"1.6\00"
@.str.2 = [57 x i8] c"usage: munpack [-f] [-q] [-t] [-C directory] [files...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"munpack version %s\0A\00"
@.str.1 = [4 x i8] c"1.6\00"
@.str.2 = [57 x i8] c"usage: munpack [-f] [-q] [-t] [-C directory] [files...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int cuadrado(int n) { return n * n; }


x86 assembly (clang, -O0):
<cuadrado>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cuadrado>:
mov    %edi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @cuadrado(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @cuadrado(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
a() { return 3; }


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

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

LLVM IR (-O0):
define i32 @a() {
ret i32 3
}

LLVM IR (-O2):
define i32 @a() {
ret i32 3
}
void swap(int a, int b) {
  int t = a;
  a = b;
  b = t;
}


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

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

LLVM IR (-O0):
define void @swap(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
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @swap(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i430fx_write(int /*<<< orphan*/, int, int,
                                int /*<<< orphan*/ *);
void i430fx_pci_reset(void) {
  i430fx_write(0, 0x59, 0x00, NULL);
  i430fx_write(0, 0x72, 0x02, NULL);
}


x86 assembly (clang, -O0):
<i430fx_pci_reset>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x59,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %edx,%edi
call   1030 <i430fx_write@plt>
xor    %edi,%edi
mov    $0x72,%esi
mov    $0x2,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <i430fx_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i430fx_pci_reset>:
push   %rax
xor    %edi,%edi
mov    $0x59,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <i430fx_write@plt>
xor    %edi,%edi
mov    $0x72,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
pop    %rax
jmp    1030 <i430fx_write@plt>

LLVM IR (-O0):
define void @i430fx_pci_reset() {
%1 = call i32 @i430fx_write(i32 0, i32 89, i32 0, i32* null)
%2 = call i32 @i430fx_write(i32 0, i32 114, i32 2, i32* null)
ret void
}

LLVM IR (-O2):
define void @i430fx_pci_reset() {
%1 = tail call i32 @i430fx_write(i32 0, i32 89, i32 0, i32* null)
%2 = tail call i32 @i430fx_write(i32 0, i32 114, i32 2, i32* null)
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t PQCLEAN_KYBER512_CLEAN_csubq(int16_t a) {
  a -= 3329;
  a += (a >> 15) & 3329;
  return a;
}


x86 assembly (clang, -O0):
<PQCLEAN_KYBER512_CLEAN_csubq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xd01,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xf,%eax
and    $0xd01,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PQCLEAN_KYBER512_CLEAN_csubq>:
lea    -0xd01(%rdi),%eax
shr    $0xf,%eax
and    $0xd01,%eax
add    %edi,%eax
add    $0xfffff2ff,%eax
ret

LLVM IR (-O0):
define i32 @PQCLEAN_KYBER512_CLEAN_csubq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 3329
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 15
%7 = and i32 %6, 3329
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
store i32 %9, i32* %2
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @PQCLEAN_KYBER512_CLEAN_csubq(i32 %0) {
%2 = add nsw i32 %0, -3329
%3 = lshr i32 %2, 15
%4 = and i32 %3, 3329
%5 = add nsw i32 %4, %2
ret i32 %5
}
void foo(int *dimensions, double **params, int hh) {
  if (params[hh])
    ;
  else if (dimensions[hh] > 0)
    params[hh][0] = 1.0f;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1127 <foo+0x27>
jmp    1156 <foo+0x56>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    1151 <foo+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1156 <foo+0x56>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32* %0, double** %1, i32 %2) {
%4 = alloca i32*
%5 = alloca double**
%6 = alloca i32
store i32* %0, i32** %4
store double** %1, double*** %5
store i32 %2, i32* %6
%7 = load double**, double*** %5
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double*, double** %7, i64 %9
%11 = load double*, double** %10
%12 = icmp ne double* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
br label %29
14: ; preds = %3
%15 = load i32*, i32** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %14
%22 = load double**, double*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double*, double** %22, i64 %24
%26 = load double*, double** %25
%27 = getelementptr inbounds double, double* %26, i64 0
store double 1.000000e+00, double* %27
br label %28
28: ; preds = %21, %14
br label %29
29: ; preds = %28, %13
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0, double** nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds double*, double** %1, i64 %4
%6 = load double*, double** %5
%7 = icmp eq double* %6, null
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = getelementptr inbounds i32, i32* %0, i64 %4
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, 1
tail call void @llvm.assume(i1 %11)
br label %12
12: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void rev(char str[100], int n) {
  printf("%c", str[n]);
  if (n > 0) {
    n = n - 1;
    rev(str, n);
  }
}


x86 assembly (clang, -O0):
<rev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xec2(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    1166 <rev+0x46>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <rev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
movslq %esi,%rbx
add    $0x1,%rbx
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
movsbl -0x1(%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jg     1130 <rev+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @rev(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %10, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = icmp sgt i64 %5, 0
%10 = add nsw i64 %5, -1
br i1 %9, label %4, label %11
11: ; preds = %4
ret void
}
/* Variables and functions */
double media();
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("Media: %.2f\n", media());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <media@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Media: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double (...) @media()
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Media: %.2f\0A\00"
define i32 @main() {
%1 = tail call double (...) @media()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
char *dummy_dngettext(const char *domainname, const char *msgid1,
                      const char *msgid2, unsigned long int n) {
  return (char *)(n == 1 ? msgid1 : msgid2);
}


x86 assembly (clang, -O0):
<dummy_dngettext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jne    112c <dummy_dngettext+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1134 <dummy_dngettext+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_dngettext>:
mov    %rsi,%rax
cmp    $0x1,%rcx
cmovne %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @dummy_dngettext(i8* nocapture readnone %0, i8* readnone %1, i8* readnone %2, i64 %3) {
%5 = icmp eq i64 %3, 1
%6 = select i1 %5, i8* %1, i8* %2
ret i8* %6
}