xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void aeron_array_fast_unordered_remove(uint8_t *restrict array,
                                       size_t element_size, size_t index,
                                       size_t last_index) {
  memcpy(array + (index * element_size), array + (last_index * element_size),
         element_size);
}


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

x86 assembly (clang, -O2):
<aeron_array_fast_unordered_remove>:
mov    %rsi,%rax
imul   %rsi,%rdx
lea    (%rdi,%rdx,4),%rdx
imul   %rsi,%rcx
lea    (%rdi,%rcx,4),%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @aeron_array_fast_unordered_remove(i32* noalias %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i32*, i32** %5
%10 = load i64, i64* %7
%11 = load i64, i64* %6
%12 = mul i64 %10, %11
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32*, i32** %5
%15 = load i64, i64* %8
%16 = load i64, i64* %6
%17 = mul i64 %15, %16
%18 = getelementptr inbounds i32, i32* %14, i64 %17
%19 = load i64, i64* %6
%20 = call i32 @memcpy(i32* %13, i32* %18, i64 %19)
ret void
}

LLVM IR (-O2):
define void @aeron_array_fast_unordered_remove(i32* noalias %0, i64 %1, i64 %2, i64 %3) {
%5 = mul i64 %2, %1
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = mul i64 %3, %1
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @memcpy(i32* %6, i32* %8, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int sn = 0;
  unsigned int x = 0;
  while (1) {
    if (x < 10)
      sn = sn + (2);
    x++;
    assert(sn == x * (2) || sn == 0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jae    1140 <main+0x30>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
je     1169 <main+0x59>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
mov    $0x2,%r14d
xor    %ebp,%ebp
xchg   %ax,%ax
lea    0x2(%rax),%ebx
cmp    $0xa,%ebp
cmovae %eax,%ebx
add    $0x1,%ebp
cmp    %ebx,%r14d
sete   %al
test   %ebx,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
add    $0x2,%r14d
mov    %ebx,%eax
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %0, %20
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 10
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 2
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %4
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = mul i32 %14, 2
%16 = icmp eq i32 %13, %15
br i1 %16, label %20, label %17
17: ; preds = %10
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 0
br label %20
20: ; preds = %17, %10
%21 = phi i1 [ true, %10 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = icmp ult i32 %3, 10
%5 = add nsw i32 %2, 2
%6 = select i1 %4, i32 %5, i32 %2
%7 = add i32 %3, 1
%8 = shl i32 %7, 1
%9 = icmp eq i32 %6, %8
%10 = icmp eq i32 %6, 0
%11 = or i1 %9, %10
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
br label %1
}
EXIT_RET() {}


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

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

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

LLVM IR (-O2):
define i32 @EXIT_RET() {
ret i32 undef
}
void rop3_162_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = *D & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_162_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_162_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_162_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ minprintf(char *, int, double, char *, char);
main() {
  int i = 123;
  double d = -4.1349;
  char s[] = "The Deuce!";
  char c = 't';
  minprintf("int: %d, double: %f, string: %s, char: %c\n", i, d, s, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x7b,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x1b(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x11(%rbp)
movb   $0x74,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    -0x1b(%rbp),%rdx
lea    0xeb1(%rip),%rdi
movsbl -0x1c(%rbp),%ecx
call   1030 <minprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6375654420656854,%rax
65 75 63
mov    %rax,0x8(%rsp)
movl   $0x216563,0xf(%rsp)
lea    0xee1(%rip),%rdi
movsd  0xec6(%rip),%xmm0
lea    0x8(%rsp),%rdx
mov    $0x7b,%esi
mov    $0x74,%ecx
call   1030 <minprintf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [11 x i8] c"The Deuce!\00"
@.str = [43 x i8] c"int: %d, double: %f, string: %s, char: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [11 x i8]
%4 = alloca i8
store i32 123, i32* %1
store double -4.134900e+00, double* %2
%5 = bitcast [11 x i8]* %3 to i8*
store i8 116, i8* %4
%6 = load i32, i32* %1
%7 = load double, double* %2
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%9 = load i8, i8* %4
%10 = call i32 @minprintf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %6, double %7, i8* %8, i8 signext %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [11 x i8] c"The Deuce!\00"
@.str = [43 x i8] c"int: %d, double: %f, string: %s, char: %c\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i32 @minprintf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 123, double -4.134900e+00, i8* %2, i8 signext 116)
ret i32 0
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
__attribute__((always_)) __attribute__((always_)) uint32_t __ROR(uint32_t op1,
                                                                 uint32_t op2) {
  return (op1 >> op2) | (op1 << (32U - op2));
}


x86 assembly (clang, -O0):
<__ROR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ROR>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @__ROR(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @__ROR(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void cmd_quit(int argc, char *argv[]) { exit(0); }


x86 assembly (clang, -O0):
<cmd_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<cmd_quit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @cmd_quit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @cmd_quit(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void yyerror(char *msg) {
  printf("%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned xrop3_59_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_59_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_59_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
lea    -0x100(%rsi),%eax
and    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_59_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
ret i32 %33
}

LLVM IR (-O2):
define i32 @xrop3_59_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %5, -256
%7 = and i32 %4, %6
%8 = xor i32 %7, -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteString(char *);
void iRobot_Motors(unsigned short motors) {
  char data[] = {138, motors};
  SerialWriteString(data);
}


x86 assembly (clang, -O0):
<iRobot_Motors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0x8a,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0x3(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <SerialWriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRobot_Motors>:
push   %rax
movb   $0x8a,0x6(%rsp)
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <SerialWriteString@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @iRobot_Motors(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [2 x i8]
store i16 %0, i16* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -118, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i16, i16* %2
%7 = trunc i16 %6 to i8
store i8 %7, i8* %5
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%9 = call i32 @SerialWriteString(i8* %8)
ret void
}

LLVM IR (-O2):
define void @iRobot_Motors(i16 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -118, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%5 = trunc i16 %0 to i8
store i8 %5, i8* %4
%6 = call i32 @SerialWriteString(i8* %3)
ret void
}
int first(int a, int b) { return a; }


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

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

LLVM IR (-O0):
define i32 @first(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @first(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void qcc_write(int fd, char *buf, int len) { write(fd, buf, len); }


x86 assembly (clang, -O0):
<qcc_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcc_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @qcc_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret void
}
void nil_mark(void *o) {}


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

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

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

LLVM IR (-O2):
define void @nil_mark(i8* nocapture %0) {
ret void
}
__float128 from_sign_char_load_4(signed char *a) { return (__float128)a[4]; }


x86 assembly (clang, -O0):
<from_sign_char_load_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%al
movsbl %al,%edi
call   1130 <__floatsitf>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<from_sign_char_load_4>:
push   %rax
movsbl 0x4(%rdi),%edi
call   1110 <__floatsitf>
pop    %rax
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define fp128 @from_sign_char_load_4(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = load i8, i8* %4
%6 = sitofp i8 %5 to fp128
ret fp128 %6
}

LLVM IR (-O2):
define fp128 @from_sign_char_load_4(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
%4 = sitofp i8 %3 to fp128
ret fp128 %4
}
void gu2_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor,
                           unsigned long data0, unsigned long data1,
                           unsigned long data2, unsigned long data3,
                           unsigned char transparent) {}


x86 assembly (clang, -O0):
<gu2_set_color_pattern>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gu2_set_color_pattern(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i8 zeroext %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i8
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i8 %6, i8* %14
ret void
}

LLVM IR (-O2):
define void @gu2_set_color_pattern(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i8 zeroext %6) {
ret void
}
void _cscout_dummy1(void) { _cscout_dummy1(); }


x86 assembly (clang, -O0):
<_cscout_dummy1>:
push   %rbp
mov    %rsp,%rbp
call   1030 <_cscout_dummy1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cscout_dummy1>:
jmp    1100 <_cscout_dummy1>

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

LLVM IR (-O2):
define void @_cscout_dummy1() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void FF_Yield(void) { usleep(20); }


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

x86 assembly (clang, -O2):
<FF_Yield>:
mov    $0x14,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @FF_Yield() {
%1 = call i32 @usleep(i32 20)
ret void
}

LLVM IR (-O2):
define void @FF_Yield() {
%1 = tail call i32 @usleep(i32 20)
ret void
}
/* Variables and functions */
double ADC_TO_VOLTAGE(int);
double Raw2Voltage(int __val) { return ADC_TO_VOLTAGE(__val); }


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

x86 assembly (clang, -O2):
<Raw2Voltage>:
jmp    1030 <ADC_TO_VOLTAGE@plt>

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

LLVM IR (-O2):
define double @Raw2Voltage(i32 %0) {
%2 = tail call double @ADC_TO_VOLTAGE(i32 %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int getarray(int a[]) {
  int n, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    scanf("%d", &a[i]);
  return n;
}


x86 assembly (clang, -O0):
<getarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <getarray+0x58>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <getarray+0x23>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getarray>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r15
lea    0xedd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    115d <getarray+0x4d>
xor    %ebx,%ebx
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1140 <getarray+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @getarray(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1, %7
%8 = phi i64 [ %11, %7 ], [ 0, %1 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %1
%16 = phi i32 [ %5, %1 ], [ %12, %7 ]
ret i32 %16
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
uint pc_log2(uint val) {
  uint log = 0;
  while ((val >>= 1))
    ++log;
  return log;
}


x86 assembly (clang, -O0):
<pc_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <pc_log2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <pc_log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <pc_log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <pc_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @pc_log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void gtk_list_store_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_list_store_new() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ints;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int smallest(int *, int);
int main(void) {
  int ints[] = {-67, 100, -2, 0, 1, 2, 3, -66, 2, 68};
  printf("%i\n", smallest(ints, sizeof(ints) / sizeof(int)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <smallest@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <smallest@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.ints = [10 x i32] [i32 -67, i32 100, i32 -2, i32 0, i32 1, i32 2, i32 3, i32 -66, i32 2, i32 68]
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @smallest(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ints = [10 x i32] [i32 -67, i32 100, i32 -2, i32 0, i32 1, i32 2, i32 3, i32 -66, i32 2, i32 68]
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @smallest(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
XCirculateSubwindows() {}


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

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

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

LLVM IR (-O2):
define i32 @XCirculateSubwindows() {
ret i32 undef
}
unsigned char *nbs_get_pack() { return 0; }


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

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

LLVM IR (-O0):
define i8* @nbs_get_pack() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @nbs_get_pack() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ hide(int);
void register_state(void) {
  register int a = 0;
  hide(a);
  a++;
  hide(a);
}


x86 assembly (clang, -O0):
<register_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <hide@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <hide@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_state>:
push   %rax
xor    %edi,%edi
call   1030 <hide@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <hide@plt>

LLVM IR (-O0):
define void @register_state() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @hide(i32 %2)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @hide(i32 %6)
ret void
}

LLVM IR (-O2):
define void @register_state() {
%1 = tail call i32 @hide(i32 0)
%2 = tail call i32 @hide(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgincloc(char *, int, int);
void cgincpl(int a, int v) { cgincloc("add", a, v); }


x86 assembly (clang, -O0):
<cgincpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <cgincloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgincpl>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <cgincloc@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"add\00"
define void @cgincpl(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 @cgincloc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
define void @cgincpl(i32 %0, i32 %1) {
%3 = tail call i32 @cgincloc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int array[], size_t size) {
  for (size_t i = 0; i < size; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1160 <print_array+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_array+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <print_array+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
int honda_ign_hook() { return -1; }


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

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

LLVM IR (-O0):
define i32 @honda_ign_hook() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @honda_ign_hook() {
ret i32 -1
}
int fileCalculateOffset(int KVID) { return KVID * 2 * 20 + sizeof(int); }


x86 assembly (clang, -O0):
<fileCalculateOffset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   $0x14,%eax,%eax
cltq
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileCalculateOffset>:
shl    $0x3,%edi
lea    (%rdi,%rdi,4),%eax
or     $0x4,%eax
ret

LLVM IR (-O0):
define i32 @fileCalculateOffset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = mul nsw i32 %4, 20
%6 = sext i32 %5 to i64
%7 = add i64 %6, 4
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @fileCalculateOffset(i32 %0) {
%2 = mul nsw i32 %0, 40
%3 = or i32 %2, 4
ret i32 %3
}
int d_ble_rr1(double a1, double a2) { return (__builtin_islessequal(a1, a2)); }


x86 assembly (clang, -O0):
<d_ble_rr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ble_rr1>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @d_ble_rr1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @d_ble_rr1(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int int32_t;

/* Variables and functions */
int32_t uint64_comparator(const void *l, const void *r) {
  uint64_t lv = (uint64_t)(uint64_t)(l);
  uint64_t rv = (uint64_t)(uint64_t)(r);
  if (lv < rv)
    return -1;
  else if (lv == rv)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<uint64_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1136 <uint64_comparator+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <uint64_comparator+0x57>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1150 <uint64_comparator+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1157 <uint64_comparator+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint64_comparator>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @uint64_comparator(i8* readnone %0, i8* readnone %1) {
%3 = icmp slt i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int foo(void) {
  printf("hello\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int FastIntMax(int a, int b) { return a > b ? a : b; }


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

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

LLVM IR (-O0):
define i32 @FastIntMax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @FastIntMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) { fprintf(stderr, "usage: %s [-v]\n", name); }


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [16 x i8] c"usage: %s [-v]\0A\00"
define void @usage(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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"usage: %s [-v]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_78uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x78 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_78uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 120
%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_78uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 120
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *response(int code) {
  switch (code) {
  case 200:
    return "HTTP/1.1 200 OK";
    break;
  case 404:
    return "HTTP/1.1 404 Not Found";
    break;
  default:
    return "HTTP/1.1 200 OK";
    break;
  }
  return "HTTP/1.1 200 OK";
}


x86 assembly (clang, -O0):
<response>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xc8,%eax
je     1130 <response+0x30>
jmp    111d <response+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x194,%eax
je     1140 <response+0x40>
jmp    1150 <response+0x50>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <response+0x5b>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <response+0x5b>
lea    0xea9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<response>:
cmp    $0x194,%edi
lea    0xf03(%rip),%rax
lea    0xeec(%rip),%rcx
cmovne %rcx,%rax
cmp    $0xc8,%edi
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"HTTP/1.1 200 OK\00"
@.str.1 = [23 x i8] c"HTTP/1.1 404 Not Found\00"
define i8* @response(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 200, label %5
i32 404, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [16 x i8] c"HTTP/1.1 200 OK\00"
@.str.1 = [23 x i8] c"HTTP/1.1 404 Not Found\00"
define i8* @response(i32 %0) {
%2 = icmp eq i32 %0, 404
%3 = select i1 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%4 = icmp eq i32 %0, 200
%5 = select i1 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ comprintf(char *, char const *, char const *);
void gen_writebyte(const char *address, const char *source) {
  comprintf("\twritebyte(%s,%s,scratchie);\n", address, source);
}


x86 assembly (clang, -O0):
<gen_writebyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <comprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_writebyte>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <comprintf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\09writebyte(%s,%s,scratchie);\0A\00"
define void @gen_writebyte(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @comprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\09writebyte(%s,%s,scratchie);\0A\00"
define void @gen_writebyte(i8* %0, i8* %1) {
%3 = tail call i32 @comprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
char *readfile_stdc(char const *, size_t *);
char *readfile(const char *filename, size_t *filesize) {
  return readfile_stdc(filename, filesize);
}


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

x86 assembly (clang, -O2):
<readfile>:
jmp    1030 <readfile_stdc@plt>

LLVM IR (-O0):
define i8* @readfile(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i8*, i8** %3
%6 = load i64*, i64** %4
%7 = call i8* @readfile_stdc(i8* %5, i64* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @readfile(i8* %0, i64* %1) {
%3 = tail call i8* @readfile_stdc(i8* %0, i64* %1)
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct riku_devfs_node {
  int dummy;
};

/* Variables and functions */
int initramfs_read(struct riku_devfs_node *self, const char *buf,
                   uint32_t count) {
  for (uint32_t i = 0; i < count; i++)
    *(char *)(buf + i) = 0x0;
  return 0;
}


x86 assembly (clang, -O0):
<initramfs_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1143 <initramfs_read+0x43>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <initramfs_read+0x18>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initramfs_read>:
test   %rdx,%rdx
jle    1124 <initramfs_read+0x14>
push   %rax
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.riku_devfs_node = type { i32 }
define i32 @initramfs_read(%struct.riku_devfs_node* nocapture readnone %0, i8* nocapture writeonly %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %3
br label %6
6: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main() {
  putc('a', stdout);
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0x61,%edi
call   1030 <putc@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0x61,%edi
call   1030 <putc@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = call i32 @putc(i8 signext 97, i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @putc(i8 signext 10, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @putc(i8 signext 97, i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @putc(i8 signext 10, i32 %3)
ret i32 0
}