xunge/DecIR huggingface dataset:
/* Variables and functions */
char const *va(char *, int, int, int);
const char *WM_TimeToString(float msec) {
  int mins, seconds, tens;
  seconds = msec / 1000;
  mins = seconds / 60;
  seconds -= mins * 60;
  tens = seconds / 10;
  seconds -= tens * 10;
  return va("%i:%i%i", mins, tens, seconds);
}


x86 assembly (clang, -O0):
<WM_TimeToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
imul   $0x3c,-0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
imul   $0xa,-0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe8b(%rip),%rdi
call   1030 <va@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WM_TimeToString>:
divss  0xee8(%rip),%xmm0
cvttss2si %xmm0,%eax
cltq
imul   $0xffffffff88888889,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0x5,%esi
add    %ecx,%esi
imul   $0xffffffc4,%esi,%ecx
add    %eax,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ecx
lea    0xea4(%rip),%rdi
jmp    1030 <va@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%i:%i%i\00"
define i8* @WM_TimeToString(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store float %0, float* %2
%6 = load float, float* %2
%7 = fdiv float %6, 1.000000e+03
%8 = fptosi float %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 60
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 60
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = sdiv i32 %15, 10
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = mul nsw i32 %17, 10
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, %18
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = call i8* @va(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
ret i8* %24
}

LLVM IR (-O2):
@.str = [8 x i8] c"%i:%i%i\00"
define i8* @WM_TimeToString(float %0) {
%2 = fdiv float %0, 1.000000e+03
%3 = fptosi float %2 to i32
%4 = sdiv i32 %3, 60
%5 = mul nsw i32 %4, -60
%6 = add i32 %5, %3
%7 = sdiv i32 %6, 10
%8 = mul nsw i32 %7, -10
%9 = add i32 %8, %6
%10 = tail call i8* @va(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %9)
ret i8* %10
}
void g_queue_get_length() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_get_length() {
ret void
}
void SSMR3HandleSetStatus(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3HandleSetStatus() {
ret void
}
/* Variables and functions */
unsigned short pciConfigReadWord(unsigned short, unsigned short,
                                 int /*<<< orphan*/, int);
unsigned short pciCheckVendor(unsigned short bus, unsigned short slot) {
  unsigned short vendor, device;
  if ((vendor = pciConfigReadWord(bus, slot, 0, 0)) != 0x0300) {
    device = pciConfigReadWord(bus, slot, 0, 2);
  }
  return (vendor);
}


x86 assembly (clang, -O0):
<pciCheckVendor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
xor    %ecx,%ecx
movzwl %ax,%edi
movzwl -0x4(%rbp),%esi
mov    %ecx,%edx
call   1030 <pciConfigReadWord@plt>
mov    %ax,-0x6(%rbp)
movzwl %ax,%eax
cmp    $0x300,%eax
je     1167 <pciCheckVendor+0x57>
mov    -0x2(%rbp),%ax
xor    %edx,%edx
mov    $0x2,%ecx
movzwl %ax,%edi
movzwl -0x4(%rbp),%esi
call   1030 <pciConfigReadWord@plt>
mov    %ax,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pciCheckVendor>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <pciConfigReadWord@plt>
mov    %eax,%ebx
movzwl %ax,%eax
cmp    $0x300,%eax
je     1141 <pciCheckVendor+0x31>
movzwl %bp,%edi
movzwl %r14w,%esi
xor    %edx,%edx
mov    $0x2,%ecx
call   1030 <pciConfigReadWord@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @pciCheckVendor(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%7 = load i16, i16* %3
%8 = load i16, i16* %4
%9 = call zeroext i16 @pciConfigReadWord(i16 zeroext %7, i16 zeroext %8, i32 0, i32 0)
store i16 %9, i16* %5
%10 = zext i16 %9 to i32
%11 = icmp ne i32 %10, 768
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i16, i16* %3
%14 = load i16, i16* %4
%15 = call zeroext i16 @pciConfigReadWord(i16 zeroext %13, i16 zeroext %14, i32 0, i32 2)
store i16 %15, i16* %6
br label %16
16: ; preds = %12, %2
%17 = load i16, i16* %5
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @pciCheckVendor(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call zeroext i16 @pciConfigReadWord(i16 zeroext %0, i16 zeroext %1, i32 0, i32 0)
%4 = icmp eq i16 %3, 768
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call zeroext i16 @pciConfigReadWord(i16 zeroext %0, i16 zeroext %1, i32 0, i32 2)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IFDIR;
int mknod(char const *, int, int /*<<< orphan*/);
int mkdir(const char *path, mode_t mode) {
  mode &= 04777;
  mode |= S_IFDIR;
  return mknod(path, mode, 0);
}


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x9ff,%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <mknod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir>:
and    $0x9ff,%esi
mov    0x2ebb(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
jmp    1030 <mknod@plt>

LLVM IR (-O0):
@S_IFDIR = global i32 0
define i32 @mkdir(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 2559
store i32 %6, i32* %4
%7 = load i32, i32* @S_IFDIR
%8 = load i32, i32* %4
%9 = or i32 %8, %7
store i32 %9, i32* %4
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @mknod(i8* %10, i32 %11, i32 0)
ret i32 %12
}

LLVM IR (-O2):
@S_IFDIR = global i32 0
define i32 @mkdir(i8* %0, i32 %1) {
%3 = and i32 %1, 2559
%4 = load i32, i32* @S_IFDIR
%5 = or i32 %4, %3
%6 = tail call i32 @mknod(i8* %0, i32 %5, i32 0)
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *tracer_cloneString(const char *str) {
  char *res;
  if (str == NULL)
    return NULL;
  res = (char *)malloc(strlen(str) + 1);
  if (res == NULL)
    return NULL;
  strcpy(res, str);
  return res;
}


x86 assembly (clang, -O0):
<tracer_cloneString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <tracer_cloneString+0x24>
movq   $0x0,-0x8(%rbp)
jmp    119a <tracer_cloneString+0x6a>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1185 <tracer_cloneString+0x55>
movq   $0x0,-0x8(%rbp)
jmp    119a <tracer_cloneString+0x6a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracer_cloneString>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <tracer_cloneString+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <tracer_cloneString+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <tracer_cloneString+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @tracer_cloneString(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %11
11: ; preds = %3, %1, %9
%12 = phi i8* [ %7, %9 ], [ null, %1 ], [ null, %3 ]
ret i8* %12
}
/* Variables and functions */
scalar_t__ data_getcards(int, int);
int data_numcards(int p) {
  int sum = 0;
  int i;
  for (i = 0; i < 5; i++)
    sum += data_getcards(p, i);
  return sum;
}


x86 assembly (clang, -O0):
<data_numcards>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1159 <data_numcards+0x49>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <data_getcards@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <data_numcards+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_numcards>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
xor    %esi,%esi
call   1030 <data_getcards@plt>
mov    %rax,%r14
mov    %r15d,%edi
mov    $0x1,%esi
call   1030 <data_getcards@plt>
mov    %rax,%rbx
add    %r14d,%ebx
mov    %r15d,%edi
mov    $0x2,%esi
call   1030 <data_getcards@plt>
mov    %rax,%rbp
add    %ebx,%ebp
mov    %r15d,%edi
mov    $0x3,%esi
call   1030 <data_getcards@plt>
mov    %rax,%rbx
add    %ebp,%ebx
mov    %r15d,%edi
mov    $0x4,%esi
call   1030 <data_getcards@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @data_numcards(i32 %0) {
%2 = tail call i64 @data_getcards(i32 %0, i32 0)
%3 = trunc i64 %2 to i32
%4 = tail call i64 @data_getcards(i32 %0, i32 1)
%5 = trunc i64 %4 to i32
%6 = add i32 %3, %5
%7 = tail call i64 @data_getcards(i32 %0, i32 2)
%8 = trunc i64 %7 to i32
%9 = add i32 %6, %8
%10 = tail call i64 @data_getcards(i32 %0, i32 3)
%11 = trunc i64 %10 to i32
%12 = add i32 %9, %11
%13 = tail call i64 @data_getcards(i32 %0, i32 4)
%14 = trunc i64 %13 to i32
%15 = add i32 %12, %14
ret i32 %15
}
/* Variables and functions */
unsigned short BMP180_I2C_read16(unsigned char);
short BMP180_I2C_reads16(unsigned char reg) {
  unsigned short i;
  i = BMP180_I2C_read16(reg);
  return (short)i;
}


x86 assembly (clang, -O0):
<BMP180_I2C_reads16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <BMP180_I2C_read16@plt>
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP180_I2C_reads16>:
push   %rax
call   1030 <BMP180_I2C_read16@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @BMP180_I2C_reads16(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call zeroext i16 @BMP180_I2C_read16(i8 zeroext %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @BMP180_I2C_reads16(i8 zeroext %0) {
%2 = tail call zeroext i16 @BMP180_I2C_read16(i8 zeroext %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *);
void printbottominstructions() {
  move(17, 42);
  printw("|Replace # with the number |");
  move(17 + 1, 42);
  printw("|of the tableau you want.  |");
  move(17 + 2, 42);
  printw("*--------------------------*");
}


x86 assembly (clang, -O0):
<printbottominstructions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec6(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec8(%rip),%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xeca(%rip),%rdi
call   1030 <printw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printbottominstructions>:
push   %rax
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec9(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xecb(%rip),%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"|Replace # with the number |\00"
@.str.1 = [29 x i8] c"|of the tableau you want. |\00"
@.str.2 = [29 x i8] c"*--------------------------*\00"
define void @printbottominstructions() {
%1 = call i32 @move(i32 17, i32 42)
%2 = call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @move(i32 18, i32 42)
%4 = call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @move(i32 19, i32 42)
%6 = call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"|Replace # with the number |\00"
@.str.1 = [29 x i8] c"|of the tableau you want. |\00"
@.str.2 = [29 x i8] c"*--------------------------*\00"
define void @printbottominstructions() {
%1 = tail call i32 @move(i32 17, i32 42)
%2 = tail call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @move(i32 18, i32 42)
%4 = tail call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @move(i32 19, i32 42)
%6 = tail call i32 @printw(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortran();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  printf("FORTRAN gave us this number: %lf.\n", fortran());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"FORTRAN gave us this number: %lf.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fortran()
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"FORTRAN gave us this number: %lf.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fortran()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef unsigned long long __u64;
typedef unsigned long long __u16;

/* Variables and functions */
__u16 hea_get_u16_bits(__u16 val, int start, int end) {
  return ((((__u64)(val)) &
           ((~0ULL << (63 - (end + 48))) & (~0ULL >> (start + 48)))) >>
          (63 - (end + 48)));
}


x86 assembly (clang, -O0):
<hea_get_u16_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%edx
add    $0x30,%edx
mov    $0x3f,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
mov    $0xffffffffffffffff,%rdx
shl    %cl,%rdx
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x30,%ecx
mov    %ecx,%ecx
mov    $0xffffffffffffffff,%rdx
shr    %cl,%rdx
mov    -0x18(%rbp),%rcx
and    %rdx,%rcx
and    %rcx,%rax
mov    -0x10(%rbp),%edx
add    $0x30,%edx
mov    $0x3f,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_get_u16_bits>:
mov    %rdi,%rax
lea    0x30(%rsi),%ecx
shl    %cl,%rax
mov    $0xf,%sil
shr    %cl,%rax
sub    %dl,%sil
mov    %esi,%ecx
shr    %cl,%rax
shl    %cl,%rax
shr    %cl,%rax
ret

LLVM IR (-O0):
define i64 @hea_get_u16_bits(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 48
%10 = sub nsw i32 63, %9
%11 = zext i32 %10 to i64
%12 = shl i64 -1, %11
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 48
%15 = zext i32 %14 to i64
%16 = lshr i64 -1, %15
%17 = and i64 %12, %16
%18 = and i64 %7, %17
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 48
%21 = sub nsw i32 63, %20
%22 = zext i32 %21 to i64
%23 = lshr i64 %18, %22
ret i64 %23
}

LLVM IR (-O2):
define i64 @hea_get_u16_bits(i64 %0, i32 %1, i32 %2) {
%4 = sub i32 15, %2
%5 = zext i32 %4 to i64
%6 = shl nsw i64 -1, %5
%7 = add nsw i32 %1, 48
%8 = zext i32 %7 to i64
%9 = lshr i64 -1, %8
%10 = and i64 %9, %0
%11 = and i64 %10, %6
%12 = lshr i64 %11, %5
ret i64 %12
}
int highorder(int a(int), int arg) { return a(arg); }


x86 assembly (clang, -O0):
<highorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<highorder>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @highorder(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 %0(i32 %1)
ret i32 %3
}
void gtk_toolbar_get_drop_index() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_get_drop_index() {
ret void
}
__attribute__((no, noclone)) char *f9(char *p, unsigned long int i) {
  return p - i;
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @f9(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 = sub i64 0, %6
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @f9(i8* readnone %0, i64 %1) {
%3 = sub i64 0, %1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
unsigned int get_matrix(unsigned int **matrix, unsigned int x, unsigned int y) {
  return (matrix[y])[x];
}


x86 assembly (clang, -O0):
<get_matrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_matrix>:
mov    %edx,%eax
mov    (%rdi,%rax,8),%rax
mov    %esi,%ecx
mov    (%rax,%rcx,4),%eax
ret

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

LLVM IR (-O2):
define i32 @get_matrix(i32** nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = getelementptr inbounds i32*, i32** %0, i64 %4
%6 = load i32*, i32** %5
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ RotShift_instr(int);
void RRC(void) { RotShift_instr(1); }


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

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

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

LLVM IR (-O2):
define void @RRC() {
%1 = tail call i32 @RotShift_instr(i32 1)
ret void
}
int main(int argc, char *argv[]) { return 1; }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
void foo546(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo546(i32 %0) {
ret void
}
int Cyc_Port_cmp_edit(struct Cyc_Port_Edit *e1, struct Cyc_Port_Edit *e2) {
  struct Cyc_Port_Edit *_T0;
  int _T1;
  struct Cyc_Port_Edit *_T2;
  int _T3;
  int _T4;
  _T0 = e1;
  _T1 = (int)_T0;
  _T2 = e2;
  _T3 = (int)_T2;
  _T4 = _T1 - _T3;
  return _T4;
}


x86 assembly (clang, -O0):
<Cyc_Port_cmp_edit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Port_cmp_edit>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
%struct.Cyc_Port_Edit = type opaque
define i32 @Cyc_Port_cmp_edit(%struct.Cyc_Port_Edit* %0, %struct.Cyc_Port_Edit* %1) {
%3 = alloca %struct.Cyc_Port_Edit*
%4 = alloca %struct.Cyc_Port_Edit*
%5 = alloca %struct.Cyc_Port_Edit*
%6 = alloca i32
%7 = alloca %struct.Cyc_Port_Edit*
%8 = alloca i32
%9 = alloca i32
store %struct.Cyc_Port_Edit* %0, %struct.Cyc_Port_Edit** %3
store %struct.Cyc_Port_Edit* %1, %struct.Cyc_Port_Edit** %4
%10 = load %struct.Cyc_Port_Edit*, %struct.Cyc_Port_Edit** %3
store %struct.Cyc_Port_Edit* %10, %struct.Cyc_Port_Edit** %5
%11 = load %struct.Cyc_Port_Edit*, %struct.Cyc_Port_Edit** %5
%12 = ptrtoint %struct.Cyc_Port_Edit* %11 to i32
store i32 %12, i32* %6
%13 = load %struct.Cyc_Port_Edit*, %struct.Cyc_Port_Edit** %4
store %struct.Cyc_Port_Edit* %13, %struct.Cyc_Port_Edit** %7
%14 = load %struct.Cyc_Port_Edit*, %struct.Cyc_Port_Edit** %7
%15 = ptrtoint %struct.Cyc_Port_Edit* %14 to i32
store i32 %15, i32* %8
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %9
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
%struct.Cyc_Port_Edit = type opaque
define i32 @Cyc_Port_cmp_edit(%struct.Cyc_Port_Edit* %0, %struct.Cyc_Port_Edit* %1) {
%3 = ptrtoint %struct.Cyc_Port_Edit* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint %struct.Cyc_Port_Edit* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
const char *aiger_version(void) { return "1.9"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"1.9\00"
define i8* @aiger_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int __ffs(unsigned int);
int ffz(unsigned int bitmask) { return __ffs(~bitmask); }


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

x86 assembly (clang, -O2):
<ffz>:
not    %edi
jmp    1030 <__ffs@plt>

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

LLVM IR (-O2):
define i32 @ffz(i32 %0) {
%2 = xor i32 %0, -1
%3 = tail call i32 @__ffs(i32 %2)
ret i32 %3
}
int abs1(int a) {
  if (a < 0) {
    return -a;
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<abs1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs1+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs1+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs1(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t n = 0;
  while (str[n])
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int test_imm_41uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x41 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_41uint64_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, 65
%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_41uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 65
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Example_Callback();
int /*<<< orphan*/ Example_DynamicArray();
int /*<<< orphan*/ Example_FSM_in_dynamic();
int /*<<< orphan*/ Example_FSM_in_static();
int /*<<< orphan*/ Example_MessageBuffer();
int /*<<< orphan*/ Example_StaticArray();
int /*<<< orphan*/ Example_StreamBuffer();
int /*<<< orphan*/ printf(char *);
int main(void) {
  Example_StreamBuffer();
  Example_MessageBuffer();
  Example_Callback();
  Example_DynamicArray();
  Example_StaticArray();
  Example_FSM_in_static();
  Example_FSM_in_dynamic();
  printf("Done.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10a0 <Example_StreamBuffer@plt>
mov    $0x0,%al
call   1090 <Example_MessageBuffer@plt>
mov    $0x0,%al
call   1070 <Example_Callback@plt>
mov    $0x0,%al
call   1080 <Example_DynamicArray@plt>
mov    $0x0,%al
call   1060 <Example_StaticArray@plt>
mov    $0x0,%al
call   1050 <Example_FSM_in_static@plt>
mov    $0x0,%al
call   1040 <Example_FSM_in_dynamic@plt>
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10a0 <Example_StreamBuffer@plt>
xor    %eax,%eax
call   1090 <Example_MessageBuffer@plt>
xor    %eax,%eax
call   1070 <Example_Callback@plt>
xor    %eax,%eax
call   1080 <Example_DynamicArray@plt>
xor    %eax,%eax
call   1060 <Example_StaticArray@plt>
xor    %eax,%eax
call   1050 <Example_FSM_in_static@plt>
xor    %eax,%eax
call   1040 <Example_FSM_in_dynamic@plt>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Example_StreamBuffer()
%3 = call i32 (...) @Example_MessageBuffer()
%4 = call i32 (...) @Example_Callback()
%5 = call i32 (...) @Example_DynamicArray()
%6 = call i32 (...) @Example_StaticArray()
%7 = call i32 (...) @Example_FSM_in_static()
%8 = call i32 (...) @Example_FSM_in_dynamic()
%9 = 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"Done.\00"
define i32 @main() {
%1 = tail call i32 (...) @Example_StreamBuffer()
%2 = tail call i32 (...) @Example_MessageBuffer()
%3 = tail call i32 (...) @Example_Callback()
%4 = tail call i32 (...) @Example_DynamicArray()
%5 = tail call i32 (...) @Example_StaticArray()
%6 = tail call i32 (...) @Example_FSM_in_static()
%7 = tail call i32 (...) @Example_FSM_in_dynamic()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int main() {
  int x$1 = 1;
  return (x$1 + 2);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int RAND_bytes(unsigned char *, int);
int /*<<< orphan*/ assert(int);
void getRand(char *buf, int sz) {
  int x;
  x = RAND_bytes((unsigned char *)buf, sz);
  assert(x != 0);
}


x86 assembly (clang, -O0):
<getRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <RAND_bytes@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRand>:
push   %rax
call   1030 <RAND_bytes@plt>
xor    %edi,%edi
test   %eax,%eax
setne  %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @getRand(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @RAND_bytes(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
define void @getRand(i8* %0, i32 %1) {
%3 = tail call i32 @RAND_bytes(i8* %0, i32 %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int CountBits16(int);
int LowestBitSet16(uint16_t val) {
  if (val == 0)
    return -1;
  return CountBits16(val ^ val - 1) - 1;
}


x86 assembly (clang, -O0):
<LowestBitSet16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <LowestBitSet16+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <LowestBitSet16+0x37>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %eax,%edi
call   1030 <CountBits16@plt>
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowestBitSet16>:
test   %edi,%edi
je     1129 <LowestBitSet16+0x19>
push   %rax
lea    -0x1(%rdi),%eax
xor    %edi,%eax
mov    %eax,%edi
call   1030 <CountBits16@plt>
add    $0xffffffff,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @LowestBitSet16(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = xor i32 %4, %0
%6 = tail call i32 @CountBits16(i32 %5)
%7 = add nsw i32 %6, -1
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ __builtin_exp10f(float);
int /*<<< orphan*/ link_failure_builtin_exp10f();
void test_builtin_exp10f(float f) {
  if (__builtin_exp10f(f) != __builtin_exp10f(f))
    link_failure_builtin_exp10f();
}


x86 assembly (clang, -O0):
<test_builtin_exp10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <__builtin_exp10f@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <__builtin_exp10f@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_exp10f+0x3c>
mov    $0x0,%al
call   1030 <link_failure_builtin_exp10f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_exp10f>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <__builtin_exp10f@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <__builtin_exp10f@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_exp10f+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_exp10f@plt>

LLVM IR (-O0):
define void @test_builtin_exp10f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @__builtin_exp10f(float %3)
%5 = load float, float* %2
%6 = call i64 @__builtin_exp10f(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_exp10f()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_exp10f(float %0) {
%2 = tail call i64 @__builtin_exp10f(float %0)
%3 = tail call i64 @__builtin_exp10f(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_exp10f()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_ptr(void *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *calloc(size_t, size_t);
void *_memory_calloc(size_t num, size_t size) {
  void *ptr = calloc(num, size);
  assert(ptr != NULL);
  add_ptr(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<_memory_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1050 <add_ptr@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_memory_calloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <add_ptr@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_memory_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
%14 = call i32 @add_ptr(i8* %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @_memory_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @add_ptr(i8* %3)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ myprintf(char *, int, int);
void test_myprintf() { myprintf("%d", 17, 18); }


x86 assembly (clang, -O0):
<test_myprintf>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x11,%esi
mov    $0x12,%edx
call   1030 <myprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_myprintf>:
lea    0xee9(%rip),%rdi
mov    $0x11,%esi
mov    $0x12,%edx
jmp    1030 <myprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @test_myprintf() {
%1 = call i32 @myprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 17, i32 18)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @test_myprintf() {
%1 = tail call i32 @myprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 17, i32 18)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ umask(int /*<<< orphan*/);
__attribute__((__weak__, __always___)) mode_t softboundmpx_umask(mode_t mask) {
  return umask(mask);
}


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

x86 assembly (clang, -O2):
<softboundmpx_umask>:
jmp    1030 <umask@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_umask(i32 %0) {
%2 = tail call i32 @umask(i32 %0)
ret i32 %2
}
double eval_cge(double x, double y) { return x >= y; }


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

x86 assembly (clang, -O2):
<eval_cge>:
cmplesd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @eval_cge(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 oge double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @eval_cge(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
char *MCopyStr(char *, char const *, int /*<<< orphan*/ *);
char *CopyStr(char *Dest, const char *Src) {
  return (MCopyStr(Dest, Src, NULL));
}


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

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

LLVM IR (-O0):
define i8* @CopyStr(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 i8* @MCopyStr(i8* %5, i8* %6, i32* null)
ret i8* %7
}

LLVM IR (-O2):
define i8* @CopyStr(i8* %0, i8* %1) {
%3 = tail call i8* @MCopyStr(i8* %0, i8* %1, i32* null)
ret i8* %3
}
long ksp_get_minor_version(void) { return 2; }


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

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

LLVM IR (-O0):
define i64 @ksp_get_minor_version() {
ret i64 2
}

LLVM IR (-O2):
define i64 @ksp_get_minor_version() {
ret i64 2
}
int do_574() { return 574; }


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

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

LLVM IR (-O0):
define i32 @do_574() {
ret i32 574
}

LLVM IR (-O2):
define i32 @do_574() {
ret i32 574
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freestr(void *string) {
  char *str = *(char **)string;
  free(str);
  str = NULL;
}


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

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

LLVM IR (-O0):
define void @freestr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @free(i8* %7)
store i8* null, i8** %3
ret void
}

LLVM IR (-O2):
define void @freestr(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
int test_imm_00int16_mem(short *val) {
  return ((*val) & (0x00 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_00int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 0
%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_00int16_mem(i16* nocapture readnone %0) {
ret i32 -40
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ varint(int /*<<< orphan*/);
int main(int argc, const char **argv) {
  printf("%llu\n", varint(STDIN_FILENO));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <varint@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <varint@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%llu\0A\00"
@STDIN_FILENO = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @STDIN_FILENO
%4 = tail call i32 @varint(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int fermat(int);
int /*<<< orphan*/ printf(char *);
int task3() {
  if (64 == 32) {
    printf("INFO: This is a 32bit OS. Problem 3 can only be calculated under "
           "64bit. =( \n");
    return 6857;
  } else {
    return fermat(600851475143);
  }
}


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

x86 assembly (clang, -O2):
<task3>:
mov    $0xe589eac7,%edi
jmp    1030 <fermat@plt>

LLVM IR (-O0):
define i32 @task3() {
%1 = call i32 @fermat(i32 -443946297)
ret i32 %1
}

LLVM IR (-O2):
define i32 @task3() {
%1 = tail call i32 @fermat(i32 -443946297)
ret i32 %1
}