xunge/DecIR huggingface dataset:
/* Variables and functions */
int yas_bma222_write_reg(unsigned char, unsigned char *, int);
int yas_bma222_write_reg_byte(unsigned char adr, unsigned char val) {
  return yas_bma222_write_reg(adr, &val, 1);
}


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

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

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

LLVM IR (-O2):
define i32 @yas_bma222_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @yas_bma222_write_reg(i8 zeroext %0, i8* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ latch_byte(unsigned long, scalar_t__, unsigned char);
void latch_input(unsigned long when, unsigned char addr, unsigned char value) {
  latch_byte(when, addr * 2 + 0, value);
}


x86 assembly (clang, -O0):
<latch_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
shl    $0x1,%eax
add    $0x0,%eax
movslq %eax,%rsi
movzbl -0xa(%rbp),%edx
call   1030 <latch_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<latch_input>:
mov    %esi,%esi
add    %rsi,%rsi
jmp    1030 <latch_byte@plt>

LLVM IR (-O0):
define void @latch_input(i64 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i64 %0, i64* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i64, i64* %4
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = mul nsw i32 %9, 2
%11 = add nsw i32 %10, 0
%12 = sext i32 %11 to i64
%13 = load i8, i8* %6
%14 = call i32 @latch_byte(i64 %7, i64 %12, i8 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @latch_input(i64 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %1 to i64
%5 = shl nuw nsw i64 %4, 1
%6 = tail call i32 @latch_byte(i64 %0, i64 %5, i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ffcmsg();
extern void ftcmsg_(void) {
  ;
  ffcmsg();
  return;
}


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

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

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

LLVM IR (-O2):
define void @ftcmsg_() {
%1 = tail call i32 (...) @ffcmsg()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int AT_EXP_CGATT(const unsigned char *RESP) {
  if (RESP == NULL) {
    return (0);
  }
  if (strstr((char *)RESP, "+CGATT: 1") != NULL) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<AT_EXP_CGATT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <AT_EXP_CGATT+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1160 <AT_EXP_CGATT+0x50>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1159 <AT_EXP_CGATT+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1160 <AT_EXP_CGATT+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT_EXP_CGATT>:
test   %rdi,%rdi
je     1132 <AT_EXP_CGATT+0x22>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"+CGATT: 1\00"
define i32 @AT_EXP_CGATT(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ a_function(int, int, int, ...);
void main() {
  a_function(2, 11, 22);
  a_function(3, 11, 22, 33);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0xb,%esi
mov    $0x16,%edx
mov    $0x0,%al
call   1030 <a_function@plt>
mov    $0x3,%edi
mov    $0xb,%esi
mov    $0x16,%edx
mov    $0x21,%ecx
mov    $0x0,%al
call   1030 <a_function@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0xb,%esi
mov    $0x16,%edx
xor    %eax,%eax
call   1030 <a_function@plt>
mov    $0x3,%edi
mov    $0xb,%esi
mov    $0x16,%edx
mov    $0x21,%ecx
xor    %eax,%eax
pop    %r8
jmp    1030 <a_function@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (i32, i32, i32, ...) @a_function(i32 2, i32 11, i32 22)
%2 = call i32 (i32, i32, i32, ...) @a_function(i32 3, i32 11, i32 22, i32 33)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (i32, i32, i32, ...) @a_function(i32 2, i32 11, i32 22)
%2 = tail call i32 (i32, i32, i32, ...) @a_function(i32 3, i32 11, i32 22, i32 33)
ret void
}
/* Variables and functions */
scalar_t__ IsConnectionArrFull(int);
int rand();
int SelectRandomRoom() {
  int roomIndex;
  do {
    roomIndex = rand() % 10;
  } while (IsConnectionArrFull(roomIndex) == 0);
  return roomIndex;
}


x86 assembly (clang, -O0):
<SelectRandomRoom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <IsConnectionArrFull@plt>
cmp    $0x0,%rax
je     1128 <SelectRandomRoom+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SelectRandomRoom>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
mov    %ebx,%edi
call   1030 <IsConnectionArrFull@plt>
test   %rax,%rax
je     1130 <SelectRandomRoom+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SelectRandomRoom() {
%1 = alloca i32
br label %2
2: ; preds = %5, %0
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 10
store i32 %4, i32* %1
br label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i64 @IsConnectionArrFull(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %2, label %9
9: ; preds = %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @SelectRandomRoom() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 10
%4 = tail call i64 @IsConnectionArrFull(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %1, label %6
6: ; preds = %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver32p_putbox(int, int, int, int, void *, int);
void __svgalib_driver32p_putboxpart(int x, int y, int w, int h, int ow, int oh,
                                    void *b, int xo, int yo) {
  __svgalib_driver32p_putbox(x, y, w, h, b + yo * ow * 4 + xo * 4, ow);
}


x86 assembly (clang, -O0):
<__svgalib_driver32p_putboxpart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    0x20(%rbp),%eax
imul   -0x14(%rbp),%eax
shl    $0x2,%eax
cltq
add    %rax,%r8
mov    0x18(%rbp),%eax
shl    $0x2,%eax
cltq
add    %rax,%r8
mov    -0x14(%rbp),%r9d
call   1030 <__svgalib_driver32p_putbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver32p_putboxpart>:
mov    %r8d,%r9d
mov    0x18(%rsp),%eax
imul   %r8d,%eax
shl    $0x2,%eax
movslq %eax,%r10
add    0x8(%rsp),%r10
mov    0x10(%rsp),%eax
shl    $0x2,%eax
movslq %eax,%r8
add    %r10,%r8
jmp    1030 <__svgalib_driver32p_putbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver32p_putboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i8*, i8** %16
%24 = load i32, i32* %18
%25 = load i32, i32* %14
%26 = mul nsw i32 %24, %25
%27 = mul nsw i32 %26, 4
%28 = sext i32 %27 to i64
%29 = getelementptr i8, i8* %23, i64 %28
%30 = load i32, i32* %17
%31 = mul nsw i32 %30, 4
%32 = sext i32 %31 to i64
%33 = getelementptr i8, i8* %29, i64 %32
%34 = load i32, i32* %14
%35 = call i32 @__svgalib_driver32p_putbox(i32 %19, i32 %20, i32 %21, i32 %22, i8* %33, i32 %34)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver32p_putboxpart(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8) {
%10 = shl i32 %4, 2
%11 = mul i32 %10, %8
%12 = sext i32 %11 to i64
%13 = getelementptr i8, i8* %6, i64 %12
%14 = shl nsw i32 %7, 2
%15 = sext i32 %14 to i64
%16 = getelementptr i8, i8* %13, i64 %15
%17 = tail call i32 @__svgalib_driver32p_putbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %16, i32 %4)
ret void
}
int test_imm_4Fint8_reg(signed char val) {
  return ((val) & (-0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffb1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_4Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -79
%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_4Fint8_reg(i8 signext %0) {
%2 = and i8 %0, -79
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int /*<<< orphan*/, int, int);
u_int32_t Interp10(u_int32_t c1, u_int32_t c2, u_int32_t c3) {
  return Interpolate_3(c1, 14, c2, 1, c3, 1, 4);
}


x86 assembly (clang, -O0):
<Interp10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
mov    $0xe,%esi
mov    $0x1,%r9d
mov    %r9d,%ecx
movl   $0x4,(%rsp)
call   1030 <Interpolate_3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp10>:
push   %rax
mov    %edx,%r8d
mov    %esi,%edx
movl   $0x4,(%rsp)
mov    $0xe,%esi
mov    $0x1,%ecx
mov    $0x1,%r9d
call   1030 <Interpolate_3@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Interp10(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Interpolate_3(i32 %0, i32 14, i32 %1, i32 1, i32 %2, i32 1, i32 4)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _xend();
void test_xend(void) { _xend(); }


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

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

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

LLVM IR (-O2):
define void @test_xend() {
%1 = tail call i32 (...) @_xend()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char str[] = "abc";
  printf("%s", str);
  if (str == "abc") {
    printf("equal!");
  } else {
    printf("not!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rax
lea    0xebb(%rip),%rcx
cmp    %rcx,%rax
jne    1161 <main+0x51>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116f <main+0x5f>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x636261,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [4 x i8] c"abc\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [7 x i8] c"equal!\00"
@.str.3 = [5 x i8] c"not!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = bitcast [4 x i8]* %2 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = icmp eq i8* %6, getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.3 = [5 x i8] c"not!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
long long ROUND(double value) {
  long long intpart;
  intpart = (long long)value;
  value = value - intpart;
  if (value >= 0.5)
    intpart++;
  return intpart;
}


x86 assembly (clang, -O0):
<ROUND>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     114a <ROUND+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROUND>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xeea(%rip),%xmm0
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @ROUND(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load double, double* %2
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = fsub double %6, %8
store double %9, double* %2
%10 = load double, double* %2
%11 = fcmp oge double %10, 5.000000e-01
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @ROUND(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fcmp oge double %4, 5.000000e-01
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
ret i64 %7
}
int MyStaticFunction() { return 7; }


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

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

LLVM IR (-O0):
define i32 @MyStaticFunction() {
ret i32 7
}

LLVM IR (-O2):
define i32 @MyStaticFunction() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ clear_buffer();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char const *);
int /*<<< orphan*/ scanf(char *, int *);
int generate(const char *message) {
  int num;
  puts(message);
  scanf("%d", &num);
  printf("\n");
  clear_buffer();
  return num;
}


x86 assembly (clang, -O0):
<generate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <clear_buffer@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate>:
push   %rax
call   1040 <puts@plt>
lea    0xeb3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <clear_buffer@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @generate(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @putchar(i32 10)
%7 = call i32 (...) @clear_buffer()
%8 = load i32, i32* %2
ret i32 %8
}
/* Variables and functions */
int ashr_i8(int, int);
int fail(int /*<<< orphan*/);
int test_ashr(void) {
  if (ashr_i8(0xfe, 1) != -1)
    return fail(0);
  if (ashr_i8(0x7e, 1) != 0x3f)
    return fail(0);
  return 0x10000;
}


x86 assembly (clang, -O0):
<test_ashr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xfe,%edi
mov    $0x1,%esi
call   1040 <ashr_i8@plt>
cmp    $0xffffffff,%eax
je     114f <test_ashr+0x2f>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    117d <test_ashr+0x5d>
mov    $0x7e,%edi
mov    $0x1,%esi
call   1040 <ashr_i8@plt>
cmp    $0x3f,%eax
je     1176 <test_ashr+0x56>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    117d <test_ashr+0x5d>
movl   $0x10000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ashr>:
push   %rax
mov    $0xfe,%edi
mov    $0x1,%esi
call   1040 <ashr_i8@plt>
cmp    $0xffffffff,%eax
jne    1150 <test_ashr+0x30>
mov    $0x7e,%edi
mov    $0x1,%esi
call   1040 <ashr_i8@plt>
cmp    $0x3f,%eax
jne    1150 <test_ashr+0x30>
mov    $0x10000,%eax
pop    %rcx
ret
xor    %edi,%edi
pop    %rax
jmp    1030 <fail@plt>

LLVM IR (-O0):
define i32 @test_ashr() {
%1 = alloca i32
%2 = call i32 @ashr_i8(i32 254, i32 1)
%3 = icmp ne i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @fail(i32 0)
store i32 %5, i32* %1
br label %12
6: ; preds = %0
%7 = call i32 @ashr_i8(i32 126, i32 1)
%8 = icmp ne i32 %7, 63
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @fail(i32 0)
store i32 %10, i32* %1
br label %12
11: ; preds = %6
store i32 65536, i32* %1
br label %12
12: ; preds = %11, %9, %4
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_ashr() {
%1 = tail call i32 @ashr_i8(i32 254, i32 1)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @ashr_i8(i32 126, i32 1)
%5 = icmp eq i32 %4, 63
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 @fail(i32 0)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ 65536, %3 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int getchar();
int getachar(void) {
  int ch = getchar();
  return ch;
}


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

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

LLVM IR (-O0):
define i32 @getachar() {
%1 = alloca i32
%2 = call i32 (...) @getchar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @getachar() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
void pin_thread(int where) {}


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

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

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

LLVM IR (-O2):
define void @pin_thread(i32 %0) {
ret void
}
unsigned int gcd(unsigned int x, unsigned int y) {
  unsigned int rem = 0;
  if (x < y) {
    rem = x;
    x = y;
    y = rem;
  }
  for (rem = 0; y > 0;) {
    rem = x % y;
    x = y;
    y = rem;
  }
  return x;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    115c <gcd+0x5c>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <gcd+0x36>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
cmp    %esi,%edi
mov    %edi,%eax
cmovb  %esi,%eax
cmovb  %edi,%edx
test   %edx,%edx
je     111e <gcd+0x1e>
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %5, %2 ]
%9 = phi i32 [ %8, %7 ], [ %4, %2 ]
%10 = urem i32 %9, %8
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i32 [ %4, %2 ], [ %8, %7 ]
ret i32 %13
}
const char *find_char(const char *str, const char *strend, char ch) {
  while (str != strend && *str != ch)
    str++;
  return str;
}


x86 assembly (clang, -O0):
<find_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x12(%rbp)
je     1137 <find_char+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1147 <find_char+0x47>
jmp    1158 <find_char+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1111 <find_char+0x11>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_char>:
mov    %rdi,%rax
cmp    %rsi,%rdi
je     1120 <find_char+0x20>
nopl   0x0(%rax,%rax,1)
cmp    %dl,(%rax)
je     1120 <find_char+0x20>
add    $0x1,%rax
cmp    %rsi,%rax
jne    1110 <find_char+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @find_char(i8* %0, i8* readnone %1, i8 signext %2) {
%4 = icmp eq i8* %0, %1
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = ptrtoint i8* %1 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = getelementptr i8, i8* %0, i64 %8
br label %10
10: ; preds = %5, %14
%11 = phi i8* [ %15, %14 ], [ %0, %5 ]
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, %2
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = icmp eq i8* %15, %1
br i1 %16, label %17, label %10
17: ; preds = %10, %14, %3
%18 = phi i8* [ %0, %3 ], [ %9, %14 ], [ %11, %10 ]
ret i8* %18
}
void dev_winch_reset(void *dev) {}


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

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

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

LLVM IR (-O2):
define void @dev_winch_reset(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ get_carg(char *, int, int);
int count_carg(void) {
  int count = 0;
  char arg[128];
  while (get_carg(arg, 128, count) > 0) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_carg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x80,%esi
call   1030 <get_carg@plt>
cmp    $0x0,%rax
jle    114e <count_carg+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <count_carg+0x12>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_carg>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    $0xffffffff,%ebx
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
mov    %r14,%rdi
mov    $0x80,%esi
mov    %ebx,%edx
call   1030 <get_carg@plt>
test   %rax,%rax
jg     1130 <count_carg+0x20>
mov    %ebx,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @count_carg() {
%1 = alloca i32
%2 = alloca [128 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* %1
%6 = call i64 @get_carg(i8* %4, i32 128, i32 %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @count_carg() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = call i64 @get_carg(i8* %2, i32 128, i32 %4)
%6 = icmp sgt i64 %5, 0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret i32 %4
}
int BackupLineNumber(int LineNumber, int Amount) {
  LineNumber -= Amount;
  if (LineNumber < 1)
    LineNumber = 1;
  return LineNumber;
}


x86 assembly (clang, -O0):
<BackupLineNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1126 <BackupLineNumber+0x26>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BackupLineNumber>:
sub    %esi,%edi
test   %edi,%edi
mov    $0x1,%eax
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @BackupLineNumber(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = icmp sgt i32 %3, 1
%5 = select i1 %4, i32 %3, i32 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
void str_assign(void *dst, const void *src) {
  strcpy((char *)dst, (const char *)src);
  return;
}


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

x86 assembly (clang, -O2):
<str_assign>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @str_assign(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
int differ(const void *_objA, const void *_objB) { return _objA != _objB; }


x86 assembly (clang, -O0):
<differ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<differ>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @differ(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 = icmp ne i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @differ(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ read_code_memory(int, int, int, int /*<<< orphan*/ *);
int read_flash_page(uint32_t address, uint8_t *outputData) {
  read_code_memory(address & 0xFFFF, (address >> 15) & 0x03, 1024, outputData);
  return 0;
}


x86 assembly (clang, -O0):
<read_flash_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
mov    -0x4(%rbp),%esi
sar    $0xf,%esi
and    $0x3,%esi
mov    -0x10(%rbp),%rcx
mov    $0x400,%edx
call   1030 <read_code_memory@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_flash_page>:
push   %rax
mov    %rsi,%rcx
mov    %edi,%esi
movzwl %si,%edi
shr    $0xf,%esi
and    $0x3,%esi
mov    $0x400,%edx
call   1030 <read_code_memory@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_flash_page(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 = and i32 %5, 65535
%7 = load i32, i32* %3
%8 = ashr i32 %7, 15
%9 = and i32 %8, 3
%10 = load i32*, i32** %4
%11 = call i32 @read_code_memory(i32 %6, i32 %9, i32 1024, i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @read_flash_page(i32 %0, i32* %1) {
%3 = and i32 %0, 65535
%4 = lshr i32 %0, 15
%5 = and i32 %4, 3
%6 = tail call i32 @read_code_memory(i32 %3, i32 %5, i32 1024, i32* %1)
ret i32 0
}
void ar_cnt_set_notify_cnt(int my_cid, int cnt, int val, int ntf_bid,
                           int ntf_cid, int ntf_cnt) {}


x86 assembly (clang, -O0):
<ar_cnt_set_notify_cnt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ar_cnt_set_notify_cnt(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = 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
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @ar_cnt_set_notify_cnt(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nogo();
void emulate_on(void) { nogo(); }


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

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

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

LLVM IR (-O2):
define void @emulate_on() {
%1 = tail call i32 (...) @nogo()
ret void
}
indreg0adr1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= (*((unsigned int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
ja     1137 <indreg0adr1+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <indreg0adr1+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adr1>:
mov    (%r8),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @indreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = load i32, i32* inttoptr (i64 11111111 to i32*)
%9 = icmp ule i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void memReserve_initially(const void *dPtr) {}


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

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

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

LLVM IR (-O2):
define void @memReserve_initially(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, char *);
void test_strncpy_nowarn(char *d) { strncpy(d + 1, d + 3, ""); }


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

x86 assembly (clang, -O2):
<test_strncpy_nowarn>:
lea    0x1(%rdi),%rax
lea    0x3(%rdi),%rsi
lea    0xee1(%rip),%rdx
mov    %rax,%rdi
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @test_strncpy_nowarn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 3
%7 = call i32 @strncpy(i8* %4, i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @test_strncpy_nowarn(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = tail call i32 @strncpy(i8* %2, i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
unsigned int Timelocal(struct tm *);
unsigned int timelocal(struct tm *tm) { return Timelocal(tm); }


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

x86 assembly (clang, -O2):
<timelocal>:
jmp    1030 <Timelocal@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @timelocal(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i32 @Timelocal(%struct.tm* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @timelocal(%struct.tm* %0) {
%2 = tail call i32 @Timelocal(%struct.tm* %0)
ret i32 %2
}
void gjmp_addr(int a) {}


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

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

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

LLVM IR (-O2):
define void @gjmp_addr(i32 %0) {
ret void
}
/* Variables and functions */
void *vector_dummy_dup(const void *data, const size_t len) {
  return (void *)data;
}


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

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

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

LLVM IR (-O2):
define i8* @vector_dummy_dup(i8* readnone returned %0, i64 %1) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  float a = 12.5;
  printf("%f\n", a);
  printf("%d\n", *(int *)&a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x41480000,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 1.250000e+01, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = bitcast float* %2 to i32*
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1095237632)
ret i32 0
}
int ft_isdigit(int c) { return (c >= 48 && c <= 57); }


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(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 label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ simuKimmel(int, double, int *);
void simuKimmel_R_wrapper(int *nGgen, double *mutRate, int *mutants) {
  simuKimmel(*nGgen, *mutRate, mutants);
}


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

x86 assembly (clang, -O2):
<simuKimmel_R_wrapper>:
mov    (%rdi),%edi
movsd  (%rsi),%xmm0
mov    %rdx,%rsi
jmp    1030 <simuKimmel@plt>

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

LLVM IR (-O2):
define void @simuKimmel_R_wrapper(i32* nocapture %0, double* nocapture %1, i32* %2) {
%4 = load i32, i32* %0
%5 = load double, double* %1
%6 = tail call i32 @simuKimmel(i32 %4, double %5, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(
      stderr,
      "Calc mult/shift coefficients to be used by timecounter/cyclecounter\n"
      "for cycles2ns conversation:\n"
      "  ns = (cycles * mult) >> shift\n\n"
      "usage: %s [options]\n"
      " -f freq	frequency\n"
      " -w width	Counter width (optional), default 32 bit\n"
      " -h		prints this message\n"
      " -v		verbose output\n",
      progname);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [265 x i8] c"Calc mult/shift coefficients to be used by timecounter/cyclecounter\0Afor cycles2ns conversation:\0A ns = (cycles * mult) >> shift\0A\0Ausage: %s [options]\0A -f freq\09frequency\0A -w width\09Counter width (optional), default 32 bit\0A -h\09\09prints this message\0A -v\09\09verbose output\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [265 x i8] c"Calc mult/shift coefficients to be used by timecounter/cyclecounter\0Afor cycles2ns conversation:\0A ns = (cycles * mult) >> shift\0A\0Ausage: %s [options]\0A -f freq\09frequency\0A -w width\09Counter width (optional), default 32 bit\0A -h\09\09prints this message\0A -v\09\09verbose output\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1;
  if (a == 1) {
    a = 2;
  } else {
    a = 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1121 <main+0x21>
movl   $0x2,-0x4(%rbp)
jmp    1128 <main+0x28>
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 2, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
struct RBTREE_TYPENAME {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RBTREE_CLEAR_CALLBACK(struct RBTREE_TYPENAME *,
                                         int /*<<< orphan*/ *);
void RBTREE_CLEAR(struct RBTREE_TYPENAME *target) {
  RBTREE_CLEAR_CALLBACK(target, NULL);
}


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

x86 assembly (clang, -O2):
<RBTREE_CLEAR>:
xor    %esi,%esi
jmp    1030 <RBTREE_CLEAR_CALLBACK@plt>

LLVM IR (-O0):
%struct.RBTREE_TYPENAME = type { i32 }
define void @RBTREE_CLEAR(%struct.RBTREE_TYPENAME* %0) {
%2 = alloca %struct.RBTREE_TYPENAME*
store %struct.RBTREE_TYPENAME* %0, %struct.RBTREE_TYPENAME** %2
%3 = load %struct.RBTREE_TYPENAME*, %struct.RBTREE_TYPENAME** %2
%4 = call i32 @RBTREE_CLEAR_CALLBACK(%struct.RBTREE_TYPENAME* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.RBTREE_TYPENAME = type { i32 }
define void @RBTREE_CLEAR(%struct.RBTREE_TYPENAME* %0) {
%2 = tail call i32 @RBTREE_CLEAR_CALLBACK(%struct.RBTREE_TYPENAME* %0, i32* null)
ret void
}