xunge/DecIR huggingface dataset:
int main() {
  int *number;
  int a = 5;
  int b = 6;
  printf("a = %d\n", a);
  number = &a;
  *number = 10;
  printf("a = %d\n", a);
  printf("&a = %x\n", &a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xa,0xc(%rsp)
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"a = %d\0A\00"
@.str.1 = [9 x i8] c"&a = %x\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
store i32 5, i32* %2
store i32 6, i32* %3
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32* %2, i32** %1
%6 = load i32*, i32** %1
store i32 10, i32* %6
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"a = %d\0A\00"
@.str.1 = [9 x i8] c"&a = %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 5)
store i32 10, i32* %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void MyFree(void *p) { fprintf(stderr, "MyFree %p\n", p); }


x86 assembly (clang, -O0):
<MyFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyFree>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"MyFree %p\0A\00"
define void @MyFree(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)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"MyFree %p\0A\00"
define void @MyFree(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)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
unsigned short refcount_decr(unsigned short *refcount, pthread_mutex_t *mutex) {
  unsigned short res;
  mutex_lock(mutex);
  (*refcount)--;
  res = *refcount;
  pthread_mutex_unlock(mutex);
  return res;
}


x86 assembly (clang, -O0):
<refcount_decr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mutex_lock@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%cx
add    $0xffff,%cx
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
movzwl -0x12(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refcount_decr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <mutex_lock@plt>
movzwl (%rbx),%ebp
add    $0xffffffff,%ebp
mov    %bp,(%rbx)
mov    %r14,%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @refcount_decr(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
%5 = alloca i16
store i16* %0, i16** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call i32 @mutex_lock(i32* %6)
%8 = load i16*, i16** %3
%9 = load i16, i16* %8
%10 = add i16 %9, -1
store i16 %10, i16* %8
%11 = load i16*, i16** %3
%12 = load i16, i16* %11
store i16 %12, i16* %5
%13 = load i32*, i32** %4
%14 = call i32 @pthread_mutex_unlock(i32* %13)
%15 = load i16, i16* %5
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @refcount_decr(i16* nocapture %0, i32* %1) {
%3 = tail call i32 @mutex_lock(i32* %1)
%4 = load i16, i16* %0
%5 = add i16 %4, -1
store i16 %5, i16* %0
%6 = tail call i32 @pthread_mutex_unlock(i32* %1)
ret i16 %5
}
void gtk_label_get_angle() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_get_angle() {
ret void
}
int multiplica(int a, int b) { return (a * b); }


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

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

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

LLVM IR (-O2):
define i32 @multiplica(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_memery_err();
int main() {
  test_memery_err();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_memery_err()
ret i32 0
}
/* Variables and functions */
int yas_bma250_read_reg_byte(int);
int /*<<< orphan*/ yas_bma250_write_reg_byte(int, int);
int yas_bma250_power_up(void) {
  yas_bma250_write_reg_byte(
      0x17, ((yas_bma250_read_reg_byte(0x17) & ~0x10) | ((1) << 4)));
  yas_bma250_write_reg_byte(
      0x11, ((yas_bma250_read_reg_byte(0x11) & ~0xc0) | ((0) << 6)));
  return (0);
}


x86 assembly (clang, -O0):
<yas_bma250_power_up>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffffef,%esi
or     $0x10,%esi
mov    $0x17,%edi
call   1030 <yas_bma250_write_reg_byte@plt>
mov    $0x11,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffff3f,%esi
or     $0x0,%esi
mov    $0x11,%edi
call   1030 <yas_bma250_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_bma250_power_up>:
push   %rax
mov    $0x17,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
or     $0x10,%eax
mov    $0x17,%edi
mov    %eax,%esi
call   1030 <yas_bma250_write_reg_byte@plt>
mov    $0x11,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
and    $0xffffff3f,%eax
mov    $0x11,%edi
mov    %eax,%esi
call   1030 <yas_bma250_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_bma250_power_up() {
%1 = call i32 @yas_bma250_read_reg_byte(i32 23)
%2 = and i32 %1, -17
%3 = or i32 %2, 16
%4 = call i32 @yas_bma250_write_reg_byte(i32 23, i32 %3)
%5 = call i32 @yas_bma250_read_reg_byte(i32 17)
%6 = and i32 %5, -193
%7 = or i32 %6, 0
%8 = call i32 @yas_bma250_write_reg_byte(i32 17, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_bma250_power_up() {
%1 = tail call i32 @yas_bma250_read_reg_byte(i32 23)
%2 = or i32 %1, 16
%3 = tail call i32 @yas_bma250_write_reg_byte(i32 23, i32 %2)
%4 = tail call i32 @yas_bma250_read_reg_byte(i32 17)
%5 = and i32 %4, -193
%6 = tail call i32 @yas_bma250_write_reg_byte(i32 17, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x48() {
  Assert_real((isalpha(72)),
              "/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/ctype/test_isalpha.c",
              365, ("isalpha should be 1 for H"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x48>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x16d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x48>:
push   %rax
mov    $0x48,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x16d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for H\00"
define void @t_isalpha_0x48() {
%1 = call i32 @isalpha(i32 72)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for H\00"
define void @t_isalpha_0x48() {
%1 = tail call i32 @isalpha(i32 72)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BITHLm(int);
void BIT0HLm() { BITHLm(0x01); }


x86 assembly (clang, -O0):
<BIT0HLm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <BITHLm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIT0HLm>:
mov    $0x1,%edi
jmp    1030 <BITHLm@plt>

LLVM IR (-O0):
define void @BIT0HLm() {
%1 = call i32 @BITHLm(i32 1)
ret void
}

LLVM IR (-O2):
define void @BIT0HLm() {
%1 = tail call i32 @BITHLm(i32 1)
ret void
}
void foo2(void) { long t; }


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

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

LLVM IR (-O0):
define void @foo2() {
%1 = alloca i64
ret void
}

LLVM IR (-O2):
define void @foo2() {
ret void
}
signed char g2(unsigned long long n) { return (float)n; }


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x10(%rbp)
test   %rax,%rax
movss  %xmm0,-0xc(%rbp)
js     1149 <g2+0x49>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movss  -0xc(%rbp),%xmm0
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @g2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to float
%5 = fptosi float %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @g2(i64 %0) {
%2 = trunc i64 %0 to i8
ret i8 %2
}
void set_color_lsb(unsigned char *color_sample, unsigned char bit) {
  *color_sample = (bit) ? (*color_sample | 0x1) : (*color_sample & 0xfe);
}


x86 assembly (clang, -O0):
<set_color_lsb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     112d <set_color_lsb+0x2d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
or     $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <set_color_lsb+0x3c>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xfe,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_color_lsb>:
test   %esi,%esi
setne  %al
mov    (%rdi),%cl
and    $0xfe,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @set_color_lsb(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %11, 1
br label %18
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = and i32 %16, 254
br label %18
18: ; preds = %13, %8
%19 = phi i32 [ %12, %8 ], [ %17, %13 ]
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
store i8 %20, i8* %21
ret void
}

LLVM IR (-O2):
define void @set_color_lsb(i8* nocapture %0, i8 zeroext %1) {
%3 = icmp ne i8 %1, 0
%4 = load i8, i8* %0
%5 = and i8 %4, -2
%6 = zext i1 %3 to i8
%7 = or i8 %5, %6
store i8 %7, i8* %0
ret void
}
void JTAG_DELAY(void) {
  int _d;
  for (_d = 0; _d < 1; _d++)
    ;
}


x86 assembly (clang, -O0):
<JTAG_DELAY>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1128 <JTAG_DELAY+0x28>
jmp    111a <JTAG_DELAY+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <JTAG_DELAY+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @JTAG_DELAY() {
ret void
}
int toAscii(int c) { return ((c)&0177); }


x86 assembly (clang, -O0):
<toAscii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toAscii>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @toAscii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
__attribute__((__no__)) void
do_nothing_small_hole_dynamic_all(struct test_small_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_small_hole_dynamic_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_small_hole_dynamic_all+0x1b>
jmp    1120 <do_nothing_small_hole_dynamic_all+0x20>
jmp    1120 <do_nothing_small_hole_dynamic_all+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_dynamic_all(%struct.test_small_hole* %0) {
%2 = alloca %struct.test_small_hole*
store %struct.test_small_hole* %0, %struct.test_small_hole** %2
%3 = load %struct.test_small_hole*, %struct.test_small_hole** %2
%4 = ptrtoint %struct.test_small_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_dynamic_all(%struct.test_small_hole* nocapture %0) {
ret void
}
int getlight(int *lights, int x, int y) { return lights[x * 1000 + y]; }


x86 assembly (clang, -O0):
<getlight>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,-0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlight>:
imul   $0x3e8,%esi,%eax
add    %edx,%eax
cltq
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getlight(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 1000
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %7, i64 %12
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @getlight(i32* nocapture %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, 1000
%5 = add nsw i32 %4, %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free_settings();
void free_util() { free_settings(); }


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

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

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

LLVM IR (-O2):
define void @free_util() {
%1 = tail call i32 (...) @free_settings()
ret void
}
void foo334() {}


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

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

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

LLVM IR (-O2):
define void @foo334() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr(char const *s) {
  int i;
  i = 0;
  while (s[i])
    i++;
  write(1, s, i);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1143 <ft_putstr+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putstr+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = tail call i32 @write(i32 1, i8* %0, i32 %9)
ret void
}
/* Type definitions */
struct DSHashMap {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void *ds_hashmap_get(struct DSHashMap *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/, int);
void *ds_hashmap_get_int(struct DSHashMap *hash, int32_t key) {
  return ds_hashmap_get(hash, NULL, key, 1);
}


x86 assembly (clang, -O0):
<ds_hashmap_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%ecx
call   1030 <ds_hashmap_get@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds_hashmap_get_int>:
mov    %esi,%edx
xor    %esi,%esi
mov    $0x1,%ecx
jmp    1030 <ds_hashmap_get@plt>

LLVM IR (-O0):
%struct.DSHashMap = type { i32 }
define i8* @ds_hashmap_get_int(%struct.DSHashMap* %0, i32 %1) {
%3 = alloca %struct.DSHashMap*
%4 = alloca i32
store %struct.DSHashMap* %0, %struct.DSHashMap** %3
store i32 %1, i32* %4
%5 = load %struct.DSHashMap*, %struct.DSHashMap** %3
%6 = load i32, i32* %4
%7 = call i8* @ds_hashmap_get(%struct.DSHashMap* %5, i32* null, i32 %6, i32 1)
ret i8* %7
}

LLVM IR (-O2):
%struct.DSHashMap = type { i32 }
define i8* @ds_hashmap_get_int(%struct.DSHashMap* %0, i32 %1) {
%3 = tail call i8* @ds_hashmap_get(%struct.DSHashMap* %0, i32* null, i32 %1, i32 1)
ret i8* %3
}
double MMtoMI(double MM) { return MM / 1609344.0; }


x86 assembly (clang, -O0):
<MMtoMI>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMtoMI>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MMtoMI(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x41388E8000000000
ret double %4
}

LLVM IR (-O2):
define double @MMtoMI(double %0) {
%2 = fdiv double %0, 0x41388E8000000000
ret double %2
}
reg0regx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (r0 <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movswl -0x6(%rbp),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1143 <reg0regx1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <reg0regx1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0regx1>:
movswl %di,%edx
movslq %ecx,%rax
movswl (%r9,%rax,2),%ecx
xor    %eax,%eax
cmp    %ecx,%edx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @reg0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = shl i32 %0, 16
%8 = ashr exact i32 %7, 16
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i16, i16* %5, i64 %9
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = icmp sle i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
extern long PassLong(long *lng) { return *lng; }


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

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

LLVM IR (-O0):
define i64 @PassLong(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @PassLong(i64* nocapture %0) {
%2 = load i64, i64* %0
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
void voxel_space_write_uint16(FILE *f, uint16_t val) {
  val = htons(val);
  fwrite(&val, 2, 1, f);
}


x86 assembly (clang, -O0):
<voxel_space_write_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voxel_space_write_uint16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @voxel_space_write_uint16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htons(i32 %5)
store i32 %6, i32* %4
%7 = load i32*, i32** %3
%8 = call i32 @fwrite(i32* %4, i32 2, i32 1, i32* %7)
ret void
}

LLVM IR (-O2):
define void @voxel_space_write_uint16(i32* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htons(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @fwrite(i32* %3, i32 2, i32 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
int strtol(char *, int /*<<< orphan*/ *, int);
int readbyte(FILE *f) {
  char data[3];
  data[0] = fgetc(f);
  data[1] = fgetc(f);
  data[2] = 0;
  return strtol(data, NULL, 16);
}


x86 assembly (clang, -O0):
<readbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xa(%rbp)
movb   $0x0,-0x9(%rbp)
lea    -0xb(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readbyte>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %al,0xd(%rsp)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %al,0xe(%rsp)
movb   $0x0,0xf(%rsp)
lea    0xd(%rsp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtol@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readbyte(i32* %0) {
%2 = alloca i32*
%3 = alloca [3 x i8]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i8 @fgetc(i32* %4)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 %5, i8* %6
%7 = load i32*, i32** %2
%8 = call signext i8 @fgetc(i32* %7)
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %8, i8* %9
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %10
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%12 = call i32 @strtol(i8* %11, i32* null, i32 16)
ret i32 %12
}

LLVM IR (-O2):
define i32 @readbyte(i32* nocapture %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = tail call signext i8 @fgetc(i32* %0)
store i8 %4, i8* %3
%5 = tail call signext i8 @fgetc(i32* %0)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 0, i8* %7
%8 = call i32 @strtol(i8* nocapture %3, i32* null, i32 16)
ret i32 %8
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, char const *, char *const *,
                       char *const *, int);
int shim_execveat(int dir_fd, const char *pathname, char *const argv[],
                  char *const envp[], int flags) {
  return (int)shim_enosys(0, dir_fd, pathname, argv, envp, flags);
}


x86 assembly (clang, -O0):
<shim_execveat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_execveat>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_execveat(i32 %0, i8* %1, i8** %2, i8** %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8**, i8*** %8
%14 = load i8**, i8*** %9
%15 = load i32, i32* %10
%16 = call i64 @shim_enosys(i32 0, i32 %11, i8* %12, i8** %13, i8** %14, i32 %15)
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @shim_execveat(i32 %0, i8* %1, i8** %2, i8** %3, i32 %4) {
%6 = tail call i64 @shim_enosys(i32 0, i32 %0, i8* %1, i8** %2, i8** %3, i32 %4)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ prince_enc_dec(int /*<<< orphan*/ const *,
                                  int /*<<< orphan*/ const *,
                                  int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                  int);
void prince_encrypt(const uint8_t in_bytes[8], const uint8_t key_bytes[16],
                    uint8_t out_bytes[8], int num_half_rounds,
                    int old_key_schedule) {
  prince_enc_dec(in_bytes, key_bytes, out_bytes, 0, num_half_rounds,
                 old_key_schedule);
}


x86 assembly (clang, -O0):
<prince_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
xor    %ecx,%ecx
call   1030 <prince_enc_dec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prince_encrypt>:
mov    %r8d,%r9d
mov    %ecx,%r8d
xor    %ecx,%ecx
jmp    1030 <prince_enc_dec@plt>

LLVM IR (-O0):
define void @prince_encrypt(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
%16 = call i32 @prince_enc_dec(i32* %11, i32* %12, i32* %13, i32 0, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @prince_encrypt(i32* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @prince_enc_dec(i32* %0, i32* %1, i32* %2, i32 0, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ McASPRxFmtMaskSet(unsigned int, int);
int /*<<< orphan*/ McASPRxFmtSet(unsigned int, int);
void McASPRxFmtI2SSet(unsigned int baseAddr, unsigned int wordSize,
                      unsigned int slotSize, unsigned int rxMode) {
  McASPRxFmtMaskSet(baseAddr, (1 << wordSize) - 1);
  McASPRxFmtSet(baseAddr, ((0x00000000u) | (0x00008000u) |
                           ((0x00000001u) << (0x00000010u)) | (wordSize >> 2) |
                           ((slotSize / 2 - 1) << (0x00000004u)) | rxMode));
}


x86 assembly (clang, -O0):
<McASPRxFmtI2SSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
sub    $0x1,%esi
call   1030 <McASPRxFmtMaskSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shr    $0x2,%esi
or     $0x18000,%esi
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
sub    $0x1,%eax
shl    $0x4,%eax
or     %eax,%esi
or     -0x10(%rbp),%esi
call   1040 <McASPRxFmtSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPRxFmtI2SSet>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xffffffff,%esi
mov    %ebp,%ecx
shl    %cl,%esi
not    %esi
call   1030 <McASPRxFmtMaskSet@plt>
shr    $0x2,%ebp
lea    -0x10(,%r15,8),%eax
ff
and    $0xfffe7ff0,%eax
or     %r14d,%ebp
or     %eax,%ebp
or     $0x18000,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <McASPRxFmtSet@plt>

LLVM IR (-O0):
define void @McASPRxFmtI2SSet(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = shl i32 1, %10
%12 = sub nsw i32 %11, 1
%13 = call i32 @McASPRxFmtMaskSet(i32 %9, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = lshr i32 %15, 2
%17 = or i32 98304, %16
%18 = load i32, i32* %7
%19 = udiv i32 %18, 2
%20 = sub i32 %19, 1
%21 = shl i32 %20, 4
%22 = or i32 %17, %21
%23 = load i32, i32* %8
%24 = or i32 %22, %23
%25 = call i32 @McASPRxFmtSet(i32 %14, i32 %24)
ret void
}

LLVM IR (-O2):
define void @McASPRxFmtI2SSet(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %1
%6 = xor i32 %5, -1
%7 = tail call i32 @McASPRxFmtMaskSet(i32 %0, i32 %6)
%8 = lshr i32 %1, 2
%9 = shl i32 %2, 3
%10 = add i32 %9, -16
%11 = and i32 %10, -98320
%12 = or i32 %8, %3
%13 = or i32 %12, %11
%14 = or i32 %13, 98304
%15 = tail call i32 @McASPRxFmtSet(i32 %0, i32 %14)
ret void
}
/* Type definitions */
typedef uintptr_t ssize_t;

/* Variables and functions */
ssize_t utf8_count_non_start_bytes_in_word(uintptr_t w) {
  w = ((w & (((uintptr_t)(-1) / 0xFF) * 0x80)) >> 7) & ((~w) >> 6);
  return (w * ((uintptr_t)(-1) / 0xFF)) >> ((sizeof(uintptr_t) - 1) * 8);
}


x86 assembly (clang, -O0):
<utf8_count_non_start_bytes_in_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x8080808080808080,%rax
80 80 80
and    -0x8(%rbp),%rax
shr    $0x7,%rax
mov    -0x8(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
shr    $0x6,%rcx
and    %rcx,%rax
mov    %rax,-0x8(%rbp)
movabs $0x101010101010101,%rax
01 01 01
imul   -0x8(%rbp),%rax
shr    $0x38,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_count_non_start_bytes_in_word>:
mov    %rdi,%rax
shr    $0x7,%rax
not    %rdi
shr    $0x6,%rdi
movabs $0x101010101010101,%rcx
01 01 01
and    %rcx,%rax
and    %rdi,%rax
imul   %rcx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i64 @utf8_count_non_start_bytes_in_word(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -9187201950435737472
%5 = lshr i64 %4, 7
%6 = load i64, i64* %2
%7 = xor i64 %6, -1
%8 = lshr i64 %7, 6
%9 = and i64 %5, %8
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = mul i64 %10, 72340172838076673
%12 = lshr i64 %11, 56
ret i64 %12
}

LLVM IR (-O2):
define i64 @utf8_count_non_start_bytes_in_word(i64 %0) {
%2 = lshr i64 %0, 7
%3 = and i64 %2, 72340172838076673
%4 = xor i64 %0, -1
%5 = lshr i64 %4, 6
%6 = and i64 %3, %5
%7 = mul i64 %6, 72340172838076673
%8 = lshr i64 %7, 56
ret i64 %8
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_coding_batchack(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x000c | 0x0080);
}


x86 assembly (clang, -O0):
<ieee80211_is_coding_batchack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x8c,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_coding_batchack>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x8c,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_coding_batchack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 140)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_coding_batchack(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 140)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void radio_control_impl_init(void) {}


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

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

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

LLVM IR (-O2):
define void @radio_control_impl_init() {
ret void
}
int mod(int a, int b) {
  int divs, _a;
  divs = a / b;
  _a = b * divs;
  return (a - _a);
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
unarg() {}


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

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

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

LLVM IR (-O2):
define i32 @unarg() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_serial_write(char *, int);
void drv_SL_vt100_clear(void) {
  char cmd[4];
  cmd[0] = 0x1b;
  cmd[1] = '[';
  cmd[2] = '2';
  cmd[3] = 'J';
  drv_generic_serial_write(cmd, 4);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1b,-0x4(%rbp)
movb   $0x5b,-0x3(%rbp)
movb   $0x32,-0x2(%rbp)
movb   $0x4a,-0x1(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <drv_generic_serial_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
movl   $0x4a325b1b,0x4(%rsp)
4a
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <drv_generic_serial_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @drv_SL_vt100_clear() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
store i8 27, i8* %2
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 1
store i8 91, i8* %3
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 2
store i8 50, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 3
store i8 74, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%7 = call i32 @drv_generic_serial_write(i8* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @drv_SL_vt100_clear() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
store i8 27, i8* %2
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 1
store i8 91, i8* %3
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 2
store i8 50, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 3
store i8 74, i8* %5
%6 = call i32 @drv_generic_serial_write(i8* %2, i32 4)
ret void
}
/* Variables and functions */
char const *gui_nick_find_color(char const *);
const char *plugin_api_info_nick_color_cb(const void *pointer, void *data,
                                          const char *info_name,
                                          const char *arguments) {
  (void)pointer;
  (void)data;
  (void)info_name;
  return gui_nick_find_color(arguments);
}


x86 assembly (clang, -O0):
<plugin_api_info_nick_color_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <gui_nick_find_color@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_info_nick_color_cb>:
mov    %rcx,%rdi
jmp    1030 <gui_nick_find_color@plt>

LLVM IR (-O0):
define i8* @plugin_api_info_nick_color_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* @gui_nick_find_color(i8* %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @plugin_api_info_nick_color_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i8* @gui_nick_find_color(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
void zylons() {
  unsigned char *leds = (unsigned char *)0xd00003;
  unsigned char curled = 0xfe;
  while (1) {
    *leds = curled;
    curled = (curled >> 1) | (curled << 7);
    delay(200);
  }
}


x86 assembly (clang, -O0):
<zylons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0xd00003,%eax
mov    %rax,-0x8(%rbp)
movb   $0xfe,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x9(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x18(%rbp)
movzbl -0x9(%rbp),%ecx
shl    $0x7,%ecx
mov    %ecx,-0x14(%rbp)
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xc8,%edi
call   1030 <delay@plt>
jmp    1125 <zylons+0x15>

x86 assembly (clang, -O2):
<zylons>:
push   %rbx
mov    $0xfe,%bl
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %bl,0xd00003
ror    %bl
mov    $0xc8,%edi
call   1030 <delay@plt>
jmp    1120 <zylons+0x10>

LLVM IR (-O0):
define void @zylons() {
%1 = alloca i8*
%2 = alloca i8
store i8* inttoptr (i64 13631491 to i8*), i8** %1
store i8 -2, i8* %2
br label %3
3: ; preds = %0, %3
%4 = load i8, i8* %2
%5 = load i8*, i8** %1
store i8 %4, i8* %5
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = ashr i32 %7, 1
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 7
%12 = or i32 %8, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
%14 = call i32 @delay(i32 200)
br label %3
}

LLVM IR (-O2):
define void @zylons() {
br label %1
1: ; preds = %1, %0
%2 = phi i8 [ -2, %0 ], [ %3, %1 ]
store i8 %2, i8* inttoptr (i64 13631491 to i8*)
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = tail call i32 @delay(i32 200)
br label %1
}
int wrap(int value, int min, int max) {
  if (value < min)
    value = max;
  else if (value > max)
    value = min;
  return value;
}


x86 assembly (clang, -O0):
<wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <wrap+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <wrap+0x3b>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1136 <wrap+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <wrap+0x3b>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap>:
cmp    %edx,%edi
mov    %edi,%eax
cmovg  %esi,%eax
cmp    %esi,%edi
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @wrap(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %1, i32 %0
%7 = select i1 %4, i32 %2, i32 %6
ret i32 %7
}
/* Variables and functions */
int yas_lis331dlh_write_reg(unsigned char, unsigned char *, int);
int yas_lis331dlh_write_reg_byte(unsigned char adr, unsigned char val) {
  return yas_lis331dlh_write_reg(adr, &val, 1);
}


x86 assembly (clang, -O0):
<yas_lis331dlh_write_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x2(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x1(%rbp),%edi
call   1030 <yas_lis331dlh_write_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_lis331dlh_write_reg_byte>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_lis331dlh_write_reg@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_lis331dlh_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @yas_lis331dlh_write_reg(i8 zeroext %5, i8* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @yas_lis331dlh_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @yas_lis331dlh_write_reg(i8 zeroext %0, i8* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
bool nrf52_errata_91(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_91() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_91() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ puts(char *);
int main() {
  alarm(5);
  pause();
  puts("");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <alarm@plt>
mov    $0x0,%al
call   1050 <pause@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <alarm@plt>
xor    %eax,%eax
call   1050 <pause@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @alarm(i32 5)
%3 = call i32 (...) @pause()
%4 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @alarm(i32 5)
%2 = tail call i32 (...) @pause()
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}