xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ max_height;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_max_height(void *_p) {
  return (int)((XSizeHints *)_p)->max_height;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSizeHints_max_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XSizeHints_max_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int bin_aux(int, int /*<<< orphan*/, int);
int forma(int num) { return bin_aux(num, 0, -1); }


x86 assembly (clang, -O0):
<forma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <bin_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forma>:
xor    %esi,%esi
mov    $0xffffffff,%edx
jmp    1030 <bin_aux@plt>

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

LLVM IR (-O2):
define i32 @forma(i32 %0) {
%2 = tail call i32 @bin_aux(i32 %0, i32 0, i32 -1)
ret i32 %2
}
/* Type definitions */
struct clad_sb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clad_free(struct clad_sb *);
int /*<<< orphan*/ clad_sb_done(struct clad_sb *);
struct clad_sb *clad_sb_free(struct clad_sb *me) {
  if (me) {
    clad_sb_done(me);
  }
  clad_free(me);
  return NULL;
}


x86 assembly (clang, -O0):
<clad_sb_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <clad_sb_free+0x20>
mov    -0x8(%rbp),%rdi
call   1040 <clad_sb_done@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clad_free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_sb_free>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1131 <clad_sb_free+0x11>
mov    %rbx,%rdi
call   1040 <clad_sb_done@plt>
mov    %rbx,%rdi
call   1030 <clad_free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.clad_sb = type { i32 }
define %struct.clad_sb* @clad_sb_free(%struct.clad_sb* %0) {
%2 = alloca %struct.clad_sb*
store %struct.clad_sb* %0, %struct.clad_sb** %2
%3 = load %struct.clad_sb*, %struct.clad_sb** %2
%4 = icmp ne %struct.clad_sb* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.clad_sb*, %struct.clad_sb** %2
%7 = call i32 @clad_sb_done(%struct.clad_sb* %6)
br label %8
8: ; preds = %5, %1
%9 = load %struct.clad_sb*, %struct.clad_sb** %2
%10 = call i32 @clad_free(%struct.clad_sb* %9)
ret %struct.clad_sb* null
}

LLVM IR (-O2):
%struct.clad_sb = type { i32 }
define noalias %struct.clad_sb* @clad_sb_free(%struct.clad_sb* %0) {
%2 = icmp eq %struct.clad_sb* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @clad_sb_done(%struct.clad_sb* %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @clad_free(%struct.clad_sb* %0)
ret %struct.clad_sb* null
}
void to_uns_char_store_4(__float128 a, unsigned char *p) {
  p[4] = (unsigned char)a;
}


x86 assembly (clang, -O0):
<to_uns_char_store_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movaps -0x10(%rbp),%xmm0
call   1130 <__fixtfsi>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<to_uns_char_store_4>:
push   %rbx
mov    %rdi,%rbx
call   1110 <__fixtfsi>
mov    %al,0x4(%rbx)
pop    %rbx
ret
xchg   %ax,%ax

LLVM IR (-O0):
define void @to_uns_char_store_4(fp128 %0, i8* %1) {
%3 = alloca fp128
%4 = alloca i8*
store fp128 %0, fp128* %3
store i8* %1, i8** %4
%5 = load fp128, fp128* %3
%6 = fptoui fp128 %5 to i8
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 4
store i8 %6, i8* %8
ret void
}

LLVM IR (-O2):
define void @to_uns_char_store_4(fp128 %0, i8* nocapture writeonly %1) {
%3 = fptoui fp128 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %3, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ key_swap(char *, int, int);
int rand();
void key_shuffle(char *key) {
  for (int i = 26 - 1; i > 0; i--)
    key_swap(key, i, rand() % (i + 1));
}


x86 assembly (clang, -O0):
<key_shuffle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x19,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1175 <key_shuffle+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
call   1030 <key_swap@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <key_shuffle+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_shuffle>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x1a,%ebx
nopl   0x0(%rax)
lea    -0x1(%rbx),%ebp
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %ebx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <key_swap@plt>
mov    %ebp,%ebx
cmp    $0x1,%ebp
ja     1130 <key_shuffle+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @key_shuffle(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 25, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = call i32 (...) @rand()
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = srem i32 %10, %12
%14 = call i32 @key_swap(i8* %8, i32 %9, i32 %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @key_shuffle(i8* %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i32 [ 25, %1 ], [ %9, %3 ]
%5 = tail call i32 (...) @rand()
%6 = add nuw nsw i32 %4, 1
%7 = srem i32 %5, %6
%8 = tail call i32 @key_swap(i8* %0, i32 %4, i32 %7)
%9 = add nsw i32 %4, -1
%10 = icmp ugt i32 %4, 1
br i1 %10, label %3, label %2
}
long long fib(long long n) {
  if (n <= 2)
    return 1;
  else
    return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jg     1134 <fib+0x24>
movq   $0x1,-0x8(%rbp)
jmp    1160 <fib+0x50>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    $0x3,%rdi
jl     114a <fib+0x3a>
mov    %rdi,%rbx
add    $0x2,%rbx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%rdi
call   1030 <fib@plt>
add    %rax,%r14
add    $0xfffffffffffffffe,%rbx
cmp    $0x4,%rbx
ja     1130 <fib+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @fib(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sle i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %15
7: ; preds = %1
%8 = load i64, i64* %3
%9 = sub nsw i64 %8, 1
%10 = call i64 @fib(i64 %9)
%11 = load i64, i64* %3
%12 = sub nsw i64 %11, 2
%13 = call i64 @fib(i64 %12)
%14 = add nsw i64 %10, %13
store i64 %14, i64* %2
br label %15
15: ; preds = %7, %6
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
define i64 @fib(i64 %0) {
%2 = icmp slt i64 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i64 %4, -1
%7 = tail call i64 @fib(i64 %6)
%8 = add nsw i64 %4, -2
%9 = add nsw i64 %7, %5
%10 = icmp ult i64 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i64 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 1, %1 ], [ %12, %11 ]
ret i64 %14
}
/* Variables and functions */
scalar_t__ write_char(int /*<<< orphan*/);
int write_string(char *s) {
  int cnt = 0;
  while (*s)
    cnt += write_char(*s++);
  return cnt;
}


x86 assembly (clang, -O0):
<write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <write_string+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <write_char@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
jmp    1123 <write_string+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_string>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1147 <write_string+0x37>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <write_char@plt>
add    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <write_string+0x20>
jmp    1149 <write_string+0x39>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @write_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = tail call i64 @write_char(i32 %9)
%11 = trunc i64 %10 to i32
%12 = add i32 %6, %11
%13 = load i8, i8* %8
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
int test_imm_41uint16_reg(unsigned short val) {
  return ((val) & (0x41 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_41uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x41,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_41uint16_reg>:
test   $0x41,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_41uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 65
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int altura_maior(int a, int b) {
  if (a >= b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<altura_maior>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <altura_maior+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <altura_maior+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @altura_maior(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sge i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @altura_maior(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ ndepths;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
int get_Screen_ndepths(void *_p) { return (int)((Screen *)_p)->ndepths; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_Screen_ndepths(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_Screen_ndepths(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void x2(void) { printf("Called modx2\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Called modx2\0A\00"
define void @x2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Called modx2\00"
define void @x2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void yyerror(char *s) { fprintf(stdout, "%s\n", s); }


x86 assembly (clang, -O0):
<yyerror>:
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):
<yyerror>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned char inb(unsigned short port) {
  unsigned char _v;
  __asm__ __volatile__("in"
                       "b"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "Nd"(port));
  return _v;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
unsigned long sdbm(unsigned char *str) {
  unsigned long hash = 0;
  int c;
  while (c = *str++)
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<sdbm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <sdbm+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <sdbm+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbm>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <sdbm+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sdbm+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @sdbm(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = zext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int pigpio_command(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int set_bank_2(int pi, uint32_t levels) {
  return pigpio_command(pi, 15, levels, 0, 1);
}


x86 assembly (clang, -O0):
<set_bank_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0xf,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @set_bank_2(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 = call i32 @pigpio_command(i32 %5, i32 15, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @set_bank_2(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 15, i32 %1, i32 0, i32 1)
ret i32 %3
}
int test_imm_19uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x19 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_19uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x19,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_19uint64_midword_reg>:
test   $0x190000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_19uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1638400
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ pn_is_power_of_two(size_t);
size_t pn_align_up(size_t size, uint32_t align) {
  assert(pn_is_power_of_two(align));
  return (size + align - 1) & ~(align - 1);
}


x86 assembly (clang, -O0):
<pn_align_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pn_is_power_of_two@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_align_up>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <pn_is_power_of_two@plt>
mov    %eax,%edi
call   1030 <assert@plt>
lea    (%r14,%rbx,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rbx
and    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @pn_align_up(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i32 @pn_is_power_of_two(i64 %5)
%7 = call i32 @assert(i32 %6)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = add i64 %8, %9
%11 = sub i64 %10, 1
%12 = load i64, i64* %4
%13 = sub i64 %12, 1
%14 = xor i64 %13, -1
%15 = and i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @pn_align_up(i64 %0, i64 %1) {
%3 = tail call i32 @pn_is_power_of_two(i64 %1)
%4 = tail call i32 @assert(i32 %3)
%5 = add i64 %0, -1
%6 = add i64 %5, %1
%7 = sub i64 0, %1
%8 = and i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) { fprintf(stderr, "%s\n", msg); }


x86 assembly (clang, -O0):
<error>:
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):
<error>:
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 = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void check(int cond, const char *fname, const char *msg) {
  if (!cond) {
    fprintf(stderr, "(error) %s() %s\n", fname, msg);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1168 <check+0x48>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
je     1125 <check+0x5>
ret
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"(error) %s() %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @check(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"(error) %s() %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @check(i32 %0, i8* %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
ret void
}
void foo_2_2_2_1_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_1_2_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mvaddch(int, int, char);
void drawTwo(int y, int x) {
  mvaddch(y + 5, x + 2, 'O');
  mvaddch(y + 1, x + 10, 'O');
}


x86 assembly (clang, -O0):
<drawTwo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x5,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0xa,%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawTwo>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x5(%rbx),%edi
lea    0x2(%r14),%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
add    $0x1,%ebx
add    $0xa,%r14d
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x4f,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mvaddch@plt>

LLVM IR (-O0):
define void @drawTwo(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 = add nsw i32 %5, 5
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 2
%9 = call i32 @mvaddch(i32 %6, i32 %8, i8 signext 79)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 10
%14 = call i32 @mvaddch(i32 %11, i32 %13, i8 signext 79)
ret void
}

LLVM IR (-O2):
define void @drawTwo(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 5
%4 = add nsw i32 %1, 2
%5 = tail call i32 @mvaddch(i32 %3, i32 %4, i8 signext 79)
%6 = add nsw i32 %0, 1
%7 = add nsw i32 %1, 10
%8 = tail call i32 @mvaddch(i32 %6, i32 %7, i8 signext 79)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ floor(double);
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void time_delay(double delay) {
  struct timespec ts;
  time_t i = (time_t)floor(delay);
  double d = delay - (double)i;
  ts.tv_sec = i;
  ts.tv_nsec = (long)(d / 1000000000);
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<time_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
cltq
mov    %rax,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x20(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_delay>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
call   1040 <floor@plt>
cltq
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
divsd  0xeb8(%rip),%xmm1
mov    %rax,0x10(%rsp)
cvttsd2si %xmm1,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @time_delay(double %0) {
%2 = alloca double
%3 = alloca %struct.timespec
%4 = alloca i64
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call i32 @floor(double %6)
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
%9 = load double, double* %2
%10 = load i64, i64* %4
%11 = sitofp i64 %10 to double
%12 = fsub double %9, %11
store double %12, double* %5
%13 = load i64, i64* %4
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %13, i64* %14
%15 = load double, double* %5
%16 = fdiv double %15, 1.000000e+09
%17 = fptosi double %16 to i64
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %17, i64* %18
%19 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @time_delay(double %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = tail call i32 @floor(double %0)
%5 = sext i32 %4 to i64
%6 = sitofp i32 %4 to double
%7 = fsub double %0, %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %5, i64* %8
%9 = fdiv double %7, 1.000000e+09
%10 = fptosi double %9 to i64
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %10, i64* %11
%12 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void alloc_failed(const char *file, int line) {
  fprintf(stderr, "ERROR %s:%d: Out of memory\n", file, line);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<alloc_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<alloc_failed>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"ERROR %s:%d: Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define void @alloc_failed(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"ERROR %s:%d: Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define void @alloc_failed(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ WriteChs(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void WriteInteger(int i) {
  char digits[12];
  sprintf(digits, "%i", i);
  WriteChs(digits);
}


x86 assembly (clang, -O0):
<WriteInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x10(%rbp),%rdi
call   1030 <WriteChs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteInteger>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <WriteChs@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define void @WriteInteger(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%8 = call i32 @WriteChs(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @WriteInteger(i32 %0) {
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @WriteChs(i8* %3)
ret void
}
char const *pubnub_sdk_name(void) { return "OpenSSL"; }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"OpenSSL\00"
define i8* @pubnub_sdk_name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ uart_puts(char *);
void main(void) {
  uart_init();
  uart_puts("Hello, world!");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uart_init@plt>
lea    0xece(%rip),%rdi
call   1040 <uart_puts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define void @main() {
%1 = call i32 (...) @uart_init()
%2 = call i32 @uart_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define void @main() {
%1 = tail call i32 (...) @uart_init()
%2 = tail call i32 @uart_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
RX0AR1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0AR1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movsd  0x21e888(%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     114b <RX0AR1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <RX0AR1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AR1>:
movslq %edi,%rsi
movsd  0x21e888(%rcx),%xmm0
xor    %eax,%eax
ucomisd (%rdx,%rsi,8),%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @RX0AR1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %4, i64 %7
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %5, i64 277777
%11 = load double, double* %10
%12 = fcmp ole double %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
char *foo();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("hello: %s\n", foo());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %rax,%rsi
lea    0xec0(%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 <foo@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"hello: %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u32_xxh32s_data64(int /*<<< orphan*/ const *, size_t,
                                          uintptr_t);
uint32_t rgph_u32_xxh32s_u64a(const uint64_t *key, size_t len, uintptr_t seed) {
  return rgph_u32_xxh32s_data64(key, len, seed);
}


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

x86 assembly (clang, -O2):
<rgph_u32_xxh32s_u64a>:
jmp    1030 <rgph_u32_xxh32s_data64@plt>

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

LLVM IR (-O2):
define i32 @rgph_u32_xxh32s_u64a(i32* %0, i64 %1, i64 %2) {
%4 = tail call i32 @rgph_u32_xxh32s_data64(i32* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int OpenDev(char *Dev) {
  int fd = open(Dev, O_RDWR);
  if (-1 == fd) {
    perror("Can't Open Serial Port");
    return -1;
  } else
    return fd;
}


x86 assembly (clang, -O0):
<OpenDev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
jne    1167 <OpenDev+0x47>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <OpenDev+0x4d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenDev>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     113a <OpenDev+0x1a>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebf(%rip),%rdi
call   1040 <perror@plt>
jmp    1136 <OpenDev+0x16>

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [23 x i8] c"Can't Open Serial Port\00"
define i32 @OpenDev(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 -1, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@.str = [23 x i8] c"Can't Open Serial Port\00"
define i32 @OpenDev(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ handler(int);
int /*<<< orphan*/ printf(char *);
void __stack_chk_fail(void) {
  printf("*** stack smashing detected ***:\n");
  handler(32);
}


x86 assembly (clang, -O0):
<__stack_chk_fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x20,%edi
call   1040 <handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stack_chk_fail>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x20,%edi
pop    %rax
jmp    1040 <handler@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"*** stack smashing detected ***:\0A\00"
define void @__stack_chk_fail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @handler(i32 32)
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"*** stack smashing detected ***:\00"
define void @__stack_chk_fail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @handler(i32 32)
ret void
}
unsigned int fibonacci(unsigned int n) {
  if (n < 2) {
    return n;
  } else {
    return fibonacci(n - 1) + fibonacci(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jae    1130 <fibonacci+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibonacci+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fibonacci+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fibonacci+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, -1
%7 = tail call i32 @fibonacci(i32 %6)
%8 = add i32 %4, -2
%9 = add i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
char getc(void) {
  char ret;
  while (((*(volatile unsigned long *)0x7F005018) & 0x7F) == 0)
    ;
  ret = (*(volatile unsigned long *)0x7F005024);
  if ((ret == 0x0d) || (ret == 0x0a)) {
    putc(0x0d);
    putc(0x0a);
  } else
    putc(ret);
  return ret;
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x7f,%rax
cmp    $0x0,%rax
jne    1133 <getc+0x23>
jmp    1118 <getc+0x8>
mov    $0x7f005024,%eax
mov    (%rax),%rax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
je     1158 <getc+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1171 <getc+0x61>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%edi
call   1030 <putc@plt>
jmp    117a <getc+0x6a>
movsbl -0x1(%rbp),%edi
call   1030 <putc@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testq  $0x7f,0x7f005018
je     1120 <getc+0x10>
mov    0x7f005024,%rbx
7f
cmp    $0xd,%bl
je     1142 <getc+0x32>
mov    %ebx,%eax
cmp    $0xa,%bl
jne    114e <getc+0x3e>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%al
movsbl %al,%edi
call   1030 <putc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getc() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 127
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load volatile i64, i64* inttoptr (i64 2130726948 to i64*)
%9 = trunc i64 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 13
br i1 %12, label %17, label %13
13: ; preds = %7
%14 = load i8, i8* %1
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %20
17: ; preds = %13, %7
%18 = call i32 @putc(i8 signext 13)
%19 = call i32 @putc(i8 signext 10)
br label %23
20: ; preds = %13
%21 = load i8, i8* %1
%22 = call i32 @putc(i8 signext %21)
br label %23
23: ; preds = %20, %17
%24 = load i8, i8* %1
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%3 = and i64 %2, 127
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 2130726948 to i64*)
%7 = trunc i64 %6 to i8
switch i8 %7, label %10 [
i8 13, label %8
i8 10, label %8
]
8: ; preds = %5, %5
%9 = tail call i32 @putc(i8 signext 13)
br label %10
10: ; preds = %5, %8
%11 = phi i8 [ 10, %8 ], [ %7, %5 ]
%12 = tail call i32 @putc(i8 signext %11)
ret i8 %7
}