xunge/DecIR huggingface dataset:
int opng_isalnum(int ch) {
  return (ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') ||
         (ch >= 'a' && ch <= 'z');
}


x86 assembly (clang, -O0):
<opng_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <opng_isalnum+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <opng_isalnum+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <opng_isalnum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <opng_isalnum+0x58>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <opng_isalnum+0x52>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opng_isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @opng_isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 122
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @opng_isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int scanf(char *, int *);
int main(int argc, char *argv[]) {
  int a;
  int disp;
  disp = scanf("%d", &a);
  printf("the scanf value is %d\nOh wait! maybe it was %d all along!", disp, a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [58 x i8] c"the scanf value is %d\0AOh wait! maybe it was %d all along!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [58 x i8] c"the scanf value is %d\0AOh wait! maybe it was %d all along!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
struct commands {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void commands_free(struct commands *c, void *item) { free((char *)item); }


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

x86 assembly (clang, -O2):
<commands_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.commands = type { i32 }
define void @commands_free(%struct.commands* %0, i8* %1) {
%3 = alloca %struct.commands*
%4 = alloca i8*
store %struct.commands* %0, %struct.commands** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
%struct.commands = type { i32 }
define void @commands_free(%struct.commands* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
signed int unsigned_char_to_signed_int(unsigned char src) { return src; }


x86 assembly (clang, -O0):
<unsigned_char_to_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @unsigned_char_to_signed_int(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @unsigned_char_to_signed_int(i8 zeroext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
int test_imm_2Cuint16_reg(unsigned short val) {
  return ((val) & (-0x2C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Cuint16_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, -44
%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_2Cuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -44
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ COND_CC();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_scc_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_CC() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_scc_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_CC@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_scc_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_CC@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_scc_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_CC()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_scc_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_CC()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
int f1(int p) { return (p * 2 + p / 2); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
lea    (%rax,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = sdiv i32 %0, 2
%4 = add nsw i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int enter_handler(char **save) {
  write_instr(0x00);
  write_imm(0x28);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<enter_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x28,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enter_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x28,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @enter_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 40)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @enter_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 40)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
int _lseek(int file, int ptr, int dir) {
  file = file;
  ptr = ptr;
  dir = dir;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
char getchar();
void clear_to_end(void) {
  char ch;
  ch = getchar();
  while (ch != '\n') {
    ch = getchar();
  }
}


x86 assembly (clang, -O0):
<clear_to_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     113e <clear_to_end+0x2e>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
jmp    1122 <clear_to_end+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_to_end>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clear_to_end+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clear_to_end() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
br label %3
3: ; preds = %7, %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %1
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @clear_to_end() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int __builtin_arc_ffs(int);
int foo(int x) { return __builtin_arc_ffs(x); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <__builtin_arc_ffs@plt>

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @__builtin_arc_ffs(i32 %0)
ret i32 %2
}
int test_imm_3Bint8_mem(signed char *val) {
  return ((*val) & (-0x3B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -59
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ordfilt_sort_compf(const void *_v1, const void *_v2) {
  return *(float *)_v1 > *(float *)_v2 ? 1 : -1;
}


x86 assembly (clang, -O0):
<ordfilt_sort_compf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordfilt_sort_compf>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ordfilt_sort_compf(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 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp ogt float %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @ordfilt_sort_compf(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Bootloader(int /*<<< orphan*/);
int /*<<< orphan*/ ExecuteEnvironmentFunctions();
int /*<<< orphan*/ InitEEPROM();
int /*<<< orphan*/ LoadBootCommands();
int getc(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  InitEEPROM();
  ;
  LoadBootCommands();
  printf("\n\rKB9202(www.kwikbyte.com)\n\rAuto boot..\n\r");
  if (getc(1) == -1)
    ExecuteEnvironmentFunctions();
  Bootloader(0);
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <InitEEPROM@plt>
mov    $0x0,%al
call   1070 <LoadBootCommands@plt>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1080 <getc@plt>
cmp    $0xffffffff,%eax
jne    11a3 <main+0x43>
mov    $0x0,%al
call   1060 <ExecuteEnvironmentFunctions@plt>
xor    %edi,%edi
call   1050 <Bootloader@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <InitEEPROM@plt>
xor    %eax,%eax
call   1070 <LoadBootCommands@plt>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1080 <getc@plt>
cmp    $0xffffffff,%eax
jne    1191 <main+0x31>
xor    %eax,%eax
call   1060 <ExecuteEnvironmentFunctions@plt>
xor    %edi,%edi
call   1050 <Bootloader@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0A\0DKB9202(www.kwikbyte.com)\0A\0DAuto boot..\0A\0D\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @InitEEPROM()
%3 = call i32 (...) @LoadBootCommands()
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @getc(i32 1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @ExecuteEnvironmentFunctions()
br label %9
9: ; preds = %7, %0
%10 = call i32 @Bootloader(i32 0)
ret i32 1
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0A\0DKB9202(www.kwikbyte.com)\0A\0DAuto boot..\0A\0D\00"
define i32 @main() {
%1 = tail call i32 (...) @InitEEPROM()
%2 = tail call i32 (...) @LoadBootCommands()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @getc(i32 1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 (...) @ExecuteEnvironmentFunctions()
br label %8
8: ; preds = %6, %0
%9 = tail call i32 @Bootloader(i32 0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ stdout;
void handler_dest_not_found() {
  printf("\n[NOTA] Il messaggio non e' stato recapitato: uno o piu' "
         "destinatari inesistenti.\n");
  fflush(stdout);
  signal(SIGUSR2, handler_dest_not_found);
}


x86 assembly (clang, -O0):
<handler_dest_not_found>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    0x2e8a(%rip),%rsi
call   1040 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler_dest_not_found>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rsi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [83 x i8] c"\0A[NOTA] Il messaggio non e' stato recapitato: uno o piu' destinatari inesistenti.\0A\00"
@stdout = global i32 0
@SIGUSR2 = global i32 0
define void @handler_dest_not_found() {
%1 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = load i32, i32* @SIGUSR2
%5 = call i32 @signal(i32 %4, void (...)* bitcast (void ()* @handler_dest_not_found to void (...)*))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@SIGUSR2 = global i32 0
@str = [82 x i8] c"\0A[NOTA] Il messaggio non e' stato recapitato: uno o piu' destinatari inesistenti.\00"
define void @handler_dest_not_found() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @SIGUSR2
%5 = tail call i32 @signal(i32 %4, void (...)* bitcast (void ()* @handler_dest_not_found to void (...)*))
ret void
}
int main(void) {
  int i = 1, j = 2;
  int *pi = &i;
  int *pj = &j;
  void swap(int *, int *);
  printf("%15i \t %15i \t %15i \t %15i \n", i, j, pi, pj);
  swap(pi, pj);
  printf("%15i \t %15i \t %15i \t %15i \n", i, j, pi, pj);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
movl   $0x2,0x8(%rsp)
lea    0xec0(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%r15
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r14,%rdi
mov    %rbx,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%15i \09 %15i \09 %15i \09 %15i \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store i32* %2, i32** %4
store i32* %3, i32** %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32* %8, i32* %9)
%11 = load i32*, i32** %4
%12 = load i32*, i32** %5
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = load i32*, i32** %4
%16 = load i32*, i32** %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32* %15, i32* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"%15i \09 %15i \09 %15i \09 %15i \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32* %1, i32* %2)
ret i32 0
}
/* Variables and functions */
unsigned int sys_call(int, int, unsigned int, int /*<<< orphan*/,
                      int /*<<< orphan*/);
unsigned int timer_set_mode(unsigned int val) {
  return sys_call(0x04, 1, val, 0, 0);
}


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

x86 assembly (clang, -O2):
<timer_set_mode>:
mov    %edi,%edx
mov    $0x4,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

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

LLVM IR (-O2):
define i32 @timer_set_mode(i32 %0) {
%2 = tail call i32 @sys_call(i32 4, i32 1, i32 %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bracket(int /*<<< orphan*/, int, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  bracket(0, n, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <bracket@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
xor    %edi,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <bracket@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @bracket(i32 0, i32 %4, i32 0, i32 0)
ret i32 0
}
unsigned short int f45(unsigned short int x, int y) {
  return (x >> y) | (x << ((-y) & (8 * sizeof(unsigned short) - 1)));
}


x86 assembly (clang, -O0):
<f45>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
movslq %ecx,%rcx
and    $0xf,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f45>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0xf,%cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f45(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = sext i32 %12 to i64
%14 = and i64 %13, 15
%15 = trunc i64 %14 to i32
%16 = shl i32 %10, %15
%17 = or i32 %8, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f45(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = lshr i32 %3, %1
%5 = sub nsw i32 0, %1
%6 = and i32 %5, 15
%7 = shl nuw nsw i32 %3, %6
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ getPid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void killProcess() { kill(getPid(), SIGTERM); }


x86 assembly (clang, -O0):
<killProcess>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getPid@plt>
mov    %eax,%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<killProcess>:
push   %rax
xor    %eax,%eax
call   1040 <getPid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @killProcess() {
%1 = call i32 (...) @getPid()
%2 = load i32, i32* @SIGTERM
%3 = call i32 @kill(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @killProcess() {
%1 = tail call i32 (...) @getPid()
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parse();
int main() {
  test_parse();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_parse()
ret i32 0
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createGeqExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x09, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createGeqExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x9,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createGeqExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 9, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createGeqExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 9, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_mathematica_comment_entities() {
  test_parser_verify_entity(
      test_parser_sourcefile("mathematica", " (*comment*)"), "comment",
      "(*comment*)");
}


x86 assembly (clang, -O0):
<test_mathematica_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xed9(%rip),%rsi
lea    0xec6(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mathematica_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xede(%rip),%rsi
lea    0xecb(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"mathematica\00"
@.str.1 = [13 x i8] c" (*comment*)\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [12 x i8] c"(*comment*)\00"
define void @test_mathematica_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"mathematica\00"
@.str.1 = [13 x i8] c" (*comment*)\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [12 x i8] c"(*comment*)\00"
define void @test_mathematica_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGBaseRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGBaseRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGBaseRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
int config_WITH_MCA(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_WITH_MCA() {
ret i32 0
}
/* Variables and functions */
scalar_t__ atoi(char const *);
long atol(const char *nptr) { return (long)atoi(nptr); }


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

x86 assembly (clang, -O2):
<atol>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @atoi(i8* %0)
ret i64 %2
}
int *sub(int *a, int sizeA, int *b, int sizeB, int *resultSize) {}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i32* @sub(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i32 %3, i32* nocapture readnone %4) {
ret i32* undef
}
regx0regx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


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

x86 assembly (clang, -O2):
<regx0regx1>:
movslq %edx,%rax
movzwl (%r8,%rax,2),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,2),%dx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @regx0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i16, i16* %5, i64 %10
%12 = load i16, i16* %11
%13 = icmp sle i16 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ isOk(char);
int rand();
int /*<<< orphan*/ srand(int);
char randomChar(int a) {
  srand(a);
  char dummy = 0;
  while (!isOk(dummy)) {
    dummy = (char)(rand() % 256);
  }
  return dummy;
}


x86 assembly (clang, -O0):
<randomChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <srand@plt>
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isOk@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1165 <randomChar+0x35>
jmp    117e <randomChar+0x4e>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x5(%rbp)
jmp    1147 <randomChar+0x17>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomChar>:
push   %rbx
call   1030 <srand@plt>
xor    %ebx,%ebx
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
call   1040 <isOk@plt>
test   %eax,%eax
jne    1157 <randomChar+0x27>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebx
movsbl %bl,%edi
jmp    1140 <randomChar+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @randomChar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @srand(i32 %4)
store i8 0, i8* %3
br label %6
6: ; preds = %11, %1
%7 = load i8, i8* %3
%8 = call i32 @isOk(i8 signext %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 256
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %6
15: ; preds = %6
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @randomChar(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
%3 = tail call i32 @isOk(i8 signext 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1, %5
%6 = tail call i32 (...) @rand()
%7 = trunc i32 %6 to i8
%8 = tail call i32 @isOk(i8 signext %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5
%11 = trunc i32 %6 to i8
br label %12
12: ; preds = %10, %1
%13 = phi i8 [ 0, %1 ], [ %11, %10 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ perror(char *);
char *strdup(char const *);
char *qd_strdup(const char *s) {
  assert(s);
  char *ptr = strdup(s);
  if (!ptr) {
    perror("qd_strdup");
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<qd_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1180 <qd_strdup+0x40>
lea    0xe8c(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1060 <strdup@plt>
test   %rax,%rax
je     1158 <qd_strdup+0x18>
pop    %rbx
ret
lea    0xea1(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"qd_strdup\00"
define i8* @qd_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @assert(i8* %4)
%6 = load i8*, i8** %2
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [10 x i8] c"qd_strdup\00"
define noalias i8* @qd_strdup(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i8* @strdup(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %3
}
/* Variables and functions */
int _flat3_savefs(int, unsigned int *, int /*<<< orphan*/);
int flat3_savefs(int dowrite, unsigned int *total) {
  return _flat3_savefs(dowrite, total, 0);
}


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

x86 assembly (clang, -O2):
<flat3_savefs>:
xor    %edx,%edx
jmp    1030 <_flat3_savefs@plt>

LLVM IR (-O0):
define i32 @flat3_savefs(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 @_flat3_savefs(i32 %5, i32* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @flat3_savefs(i32 %0, i32* %1) {
%3 = tail call i32 @_flat3_savefs(i32 %0, i32* %1, i32 0)
ret i32 %3
}
unsigned int minu(unsigned int a, unsigned int b) { return (a <= b) ? a : b; }


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

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

LLVM IR (-O0):
define i32 @minu(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 ule 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 @minu(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void reset_mask_(unsigned int *mask, int *e) {
  int w;
  unsigned int m, n;
  w = *e / (8 * sizeof(int) - 1);
  n = 1;
  m = ~(n << *e % (8 * sizeof(int) - 1));
  if (w >= 0 && w < (((2 * (12) + 2)) / (4 * 8) + 1)) {
    mask[w] &= m;
  }
}


x86 assembly (clang, -O0):
<reset_mask_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x20(%rbp),%eax
mov    %edx,%ecx
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1170 <reset_mask_+0x70>
cmpl   $0x1,-0x14(%rbp)
jge    1170 <reset_mask_+0x70>
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_mask_>:
movslq (%rsi),%rcx
movabs $0x842108421084211,%rdx
10 42 08
mov    %rcx,%rax
mul    %rdx
mov    %rcx,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0x4,%rax
test   %eax,%eax
je     1128 <reset_mask_+0x28>
ret
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rdx,%rax
add    %rax,%rcx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @reset_mask_(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = udiv i64 %10, 31
%12 = trunc i64 %11 to i32
store i32 %12, i32* %5
store i32 1, i32* %7
%13 = load i32, i32* %7
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = urem i64 %16, 31
%18 = trunc i64 %17 to i32
%19 = shl i32 %13, %18
%20 = xor i32 %19, -1
store i32 %20, i32* %6
%21 = load i32, i32* %5
%22 = icmp sge i32 %21, 0
br i1 %22, label %23, label %34
23: ; preds = %2
%24 = load i32, i32* %5
%25 = icmp slt i32 %24, 1
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = load i32, i32* %6
%28 = load i32*, i32** %3
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = and i32 %32, %27
store i32 %33, i32* %31
br label %34
34: ; preds = %26, %23, %2
ret void
}

LLVM IR (-O2):
define void @reset_mask_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = udiv i64 %4, 31
%6 = urem i64 %4, 31
%7 = trunc i64 %5 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = trunc i64 %6 to i32
%11 = shl nuw nsw i32 1, %10
%12 = xor i32 %11, -1
%13 = load i32, i32* %0
%14 = and i32 %13, %12
store i32 %14, i32* %0
br label %15
15: ; preds = %9, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void HandleKey(int keycode, int bDown) {
  if (keycode == 65307)
    exit(0);
}


x86 assembly (clang, -O0):
<HandleKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff1b,-0x4(%rbp)
jne    1132 <HandleKey+0x22>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleKey>:
cmp    $0xff1b,%edi
je     1119 <HandleKey+0x9>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @HandleKey(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 = icmp eq i32 %5, 65307
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @HandleKey(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 65307
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_timeval_cmp() {
  printf("NOT IMPLEMENTED:"
         "pa_timeval_cmp"
         "\n");
}


x86 assembly (clang, -O0):
<pa_timeval_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_timeval_cmp\0A\00"
define i32 @pa_timeval_cmp() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_timeval_cmp\00"
define i32 @pa_timeval_cmp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}