xunge/DecIR huggingface dataset:
unsigned char g1(unsigned char *p, int i) { return p[i]; }


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @g1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @g1(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
main(argc, argv) int argc;
char **argv;
{
  int i, j;
  int size;
  printf("This is gifscr ...\n");
  read_IR1J();
  size = imagePointer();
  while (imagePointer() > 1) {
    darkim();
  }
  writeim("test.gif");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <read_IR1J@plt>
mov    $0x0,%al
call   1050 <imagePointer@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <imagePointer@plt>
cmp    $0x1,%eax
jle    11a1 <main+0x51>
mov    $0x0,%al
call   1060 <darkim@plt>
jmp    1185 <main+0x35>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1070 <writeim@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <read_IR1J@plt>
xor    %eax,%eax
call   1050 <imagePointer@plt>
xor    %eax,%eax
call   1050 <imagePointer@plt>
cmp    $0x2,%eax
jl     1193 <main+0x43>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <darkim@plt>
xor    %eax,%eax
call   1050 <imagePointer@plt>
cmp    $0x1,%eax
jg     1180 <main+0x30>
lea    0xe66(%rip),%rdi
xor    %eax,%eax
call   1070 <writeim@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"This is gifscr ...\0A\00"
@.str.1 = [9 x i8] c"test.gif\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @read_IR1J()
%11 = call i32 (...) @imagePointer()
store i32 %11, i32* %8
br label %12
12: ; preds = %15, %2
%13 = call i32 (...) @imagePointer()
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (...) @darkim()
br label %12
17: ; preds = %12
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @writeim to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"test.gif\00"
@str = [19 x i8] c"This is gifscr ...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @read_IR1J()
%5 = tail call i32 (...) @imagePointer()
%6 = tail call i32 (...) @imagePointer()
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2, %8
%9 = tail call i32 (...) @darkim()
%10 = tail call i32 (...) @imagePointer()
%11 = icmp sgt i32 %10, 1
br i1 %11, label %8, label %12
12: ; preds = %8, %2
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @writeim to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void sfcEPS(double *cnst) { *cnst = 1e-16; }


x86 assembly (clang, -O0):
<sfcEPS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfcEPS>:
movabs $0x3c9cd2b297d889bc,%rax
d2 9c 3c
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @sfcEPS(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
store double 0x3C9CD2B297D889BC, double* %3
ret void
}

LLVM IR (-O2):
define void @sfcEPS(double* nocapture writeonly %0) {
store double 0x3C9CD2B297D889BC, double* %0
ret void
}
p3(a, b, c) unsigned char a, b, c;
{
  int i = 3;
  while (--i >= 0) {
    p1(a);
    p1(b);
    p1(c);
  }
}


x86 assembly (clang, -O0):
<p3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edx,%eax
mov    %dil,%dl
mov    %sil,%cl
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1168 <p3+0x58>
movzbl -0x5(%rbp),%edi
mov    $0x0,%al
call   1030 <p1@plt>
movzbl -0x6(%rbp),%edi
mov    $0x0,%al
call   1030 <p1@plt>
movzbl -0x7(%rbp),%edi
mov    $0x0,%al
call   1030 <p1@plt>
jmp    1130 <p3+0x20>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p3>:
push   %rbp
push   %r14
push   %rbx
movzbl %dil,%ebx
movzbl %sil,%ebp
movzbl %dl,%r14d
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    %r14d,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    %r14d,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    %r14d,%edi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <p1@plt>

LLVM IR (-O0):
define i32 @p3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
%9 = trunc i32 %0 to i8
%10 = trunc i32 %1 to i8
%11 = trunc i32 %2 to i8
store i8 %9, i8* %5
store i8 %10, i8* %6
store i8 %11, i8* %7
store i32 3, i32* %8
br label %12
12: ; preds = %16, %3
%13 = load i32, i32* %8
%14 = add nsw i32 %13, -1
store i32 %14, i32* %8
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %18)
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %21)
%23 = load i8, i8* %7
%24 = zext i8 %23 to i32
%25 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %24)
br label %12
26: ; preds = %12
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @p3(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %0, 255
%5 = and i32 %1, 255
%6 = and i32 %2, 255
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %4)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %5)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %6)
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %4)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %5)
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %6)
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %4)
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %5)
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %6)
ret i32 undef
}
int int_size_is_32() {
  int set_msb = 1 << 31;
  int beyond_msb = 1 << 31;
  beyond_msb = beyond_msb << 1;
  return set_msb && !beyond_msb;
}


x86 assembly (clang, -O0):
<int_size_is_32>:
push   %rbp
mov    %rsp,%rbp
movl   $0x80000000,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1136 <int_size_is_32+0x36>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_size_is_32() {
%1 = alloca i32
%2 = alloca i32
store i32 -2147483648, i32* %1
store i32 -2147483648, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %7, %0
%12 = phi i1 [ false, %0 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @int_size_is_32() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
int clzi(int);
void test_bytes() {
  assertTrue("clzi(3) == 30", clzi(3) == 30);
  ;
  assertTrue("clzi(255) == 24", clzi(255) == 24);
  ;
}


x86 assembly (clang, -O0):
<test_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <clzi@plt>
cmp    $0x1e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xec0(%rip),%rdi
call   1040 <assertTrue@plt>
mov    $0xff,%edi
call   1030 <clzi@plt>
cmp    $0x18,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xead(%rip),%rdi
call   1040 <assertTrue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bytes>:
push   %rax
mov    $0x3,%edi
call   1030 <clzi@plt>
xor    %esi,%esi
cmp    $0x1e,%eax
sete   %sil
lea    0xec5(%rip),%rdi
call   1040 <assertTrue@plt>
mov    $0xff,%edi
call   1030 <clzi@plt>
xor    %esi,%esi
cmp    $0x18,%eax
sete   %sil
lea    0xeb4(%rip),%rdi
pop    %rax
jmp    1040 <assertTrue@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"clzi(3) == 30\00"
@.str.1 = [16 x i8] c"clzi(255) == 24\00"
define void @test_bytes() {
%1 = call i32 @clzi(i32 3)
%2 = icmp eq i32 %1, 30
%3 = zext i1 %2 to i32
%4 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @clzi(i32 255)
%6 = icmp eq i32 %5, 24
%7 = zext i1 %6 to i32
%8 = call i32 @assertTrue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"clzi(3) == 30\00"
@.str.1 = [16 x i8] c"clzi(255) == 24\00"
define void @test_bytes() {
%1 = tail call i32 @clzi(i32 3)
%2 = icmp eq i32 %1, 30
%3 = zext i1 %2 to i32
%4 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @clzi(i32 255)
%6 = icmp eq i32 %5, 24
%7 = zext i1 %6 to i32
%8 = tail call i32 @assertTrue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
float const mulsignf(int, float);
__attribute__((always_)) const float signf(float d) { return mulsignf(1, d); }


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

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

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

LLVM IR (-O2):
define float @signf(float %0) {
%2 = tail call float @mulsignf(i32 1, float %0)
ret float %2
}
/* Variables and functions */
int ENODEV;
int sandbox_sdl_scan_keys(int key[], int max_keys) { return -ENODEV; }


x86 assembly (clang, -O0):
<sandbox_sdl_scan_keys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sandbox_sdl_scan_keys>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @sandbox_sdl_scan_keys(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @sandbox_sdl_scan_keys(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_load_si128(int /*<<< orphan*/ const *);
__m128i xx_load_128(const void *a) {
  return _mm_load_si128((const __m128i *)a);
}


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

x86 assembly (clang, -O2):
<xx_load_128>:
jmp    1030 <_mm_load_si128@plt>

LLVM IR (-O0):
define i32 @xx_load_128(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @_mm_load_si128(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @xx_load_128(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @_mm_load_si128(i32* %2)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ jtag_reset_to_idle(int volatile *);
void jtag_clear_fpga(volatile uint32_t *host) {
  jtag_reset_to_idle(host);
  host[0] = 0x80000000 | (3 << 16) | 0x03;
  host[0] = 0x40000000 | (9 << 16) | 2;
  host[0] = 0x80000000 | (3 << 16) | 0x06;
  host[0] = 0x80000000 | (12499 << 16);
  host[0] = 0x80000000 | (12499 << 16);
}


x86 assembly (clang, -O0):
<jtag_clear_fpga>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <jtag_reset_to_idle@plt>
mov    -0x8(%rbp),%rax
movl   $0x80030003,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x40090002,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x80030006,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xb0d30000,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xb0d30000,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jtag_clear_fpga>:
push   %rbx
mov    %rdi,%rbx
call   1030 <jtag_reset_to_idle@plt>
movl   $0x80030003,(%rbx)
movl   $0x40090002,(%rbx)
movl   $0x80030006,(%rbx)
movl   $0xb0d30000,(%rbx)
movl   $0xb0d30000,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @jtag_clear_fpga(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @jtag_reset_to_idle(i32* %3)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store volatile i32 -2147287037, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
store volatile i32 1074331650, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
store volatile i32 -2147287034, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 0
store volatile i32 -1328349184, i32* %12
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 0
store volatile i32 -1328349184, i32* %14
ret void
}

LLVM IR (-O2):
define void @jtag_clear_fpga(i32* %0) {
%2 = tail call i32 @jtag_reset_to_idle(i32* %0)
store volatile i32 -2147287037, i32* %0
store volatile i32 1074331650, i32* %0
store volatile i32 -2147287034, i32* %0
store volatile i32 -1328349184, i32* %0
store volatile i32 -1328349184, i32* %0
ret void
}
void UsageFault_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<UsageFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UsageFault_Handler+0x9>
jmp    1109 <UsageFault_Handler+0x9>

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

LLVM IR (-O0):
define void @UsageFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UsageFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
double fX3(double x1, double x2, double x3) { return ((18 - x2 - x1) / 5.); }


x86 assembly (clang, -O0):
<fX3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xeed(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fX3>:
movsd  0xef8(%rip),%xmm2
subsd  %xmm1,%xmm2
subsd  %xmm0,%xmm2
divsd  0xef0(%rip),%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fX3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fsub double 1.800000e+01, %7
%9 = load double, double* %4
%10 = fsub double %8, %9
%11 = fdiv double %10, 5.000000e+00
ret double %11
}

LLVM IR (-O2):
define double @fX3(double %0, double %1, double %2) {
%4 = fsub double 1.800000e+01, %1
%5 = fsub double %4, %0
%6 = fdiv double %5, 5.000000e+00
ret double %6
}
char *strcpy(char *s1, const char *s2) {
  char *s = s1;
  while (*s2)
    *s1++ = *s2++;
  *s1 = 0;
  return s;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float x, y;
  scanf("%f%f", &x, &y);
  x = x + y;
  printf("%.0f", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%f%f\00"
@.str.1 = [5 x i8] c"%.0f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fadd float %6, %7
store float %8, float* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %8)
ret i32 0
}
unsigned int get_block(unsigned int c, unsigned int s) { return c * 32 + s; }


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

x86 assembly (clang, -O2):
<get_block>:
shl    $0x5,%edi
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @get_block(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 = mul i32 %5, 32
%7 = load i32, i32* %4
%8 = add i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_block(i32 %0, i32 %1) {
%3 = shl i32 %0, 5
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ killServer();
int /*<<< orphan*/ stdout;
char *strsignal(int);
void sighandler(int signal) {
  fprintf(stdout, "Received signal %d: %s.  Shutting down.\n", signal,
          strsignal(signal));
  killServer();
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strsignal@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    %rax,%rcx
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <killServer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ea4(%rip),%rax
mov    (%rax),%ebp
call   1050 <strsignal@plt>
lea    0xeb6(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %rax,%rcx
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <killServer@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [41 x i8] c"Received signal %d: %s. Shutting down.\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i8* @strsignal(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %6)
%8 = call i32 (...) @killServer()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [41 x i8] c"Received signal %d: %s. Shutting down.\0A\00"
define void @sighandler(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i8* @strsignal(i32 %0)
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
%5 = tail call i32 (...) @killServer()
ret void
}
int test_imm_E6int16_mem(short *val) {
  return ((*val) & (0xE6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E6int16_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, 230
%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_E6int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 230
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char const *);
int /*<<< orphan*/ isatty(int /*<<< orphan*/);
int strfile_istty(const char *str) { return !isatty(atoi(str)); }


x86 assembly (clang, -O0):
<strfile_istty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strfile_istty>:
push   %rax
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @strfile_istty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @atoi(i8* %3)
%5 = call i32 @isatty(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @strfile_istty(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = tail call i32 @isatty(i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ sin(double);
void sinus() {
  double a;
  printf("Func sin\nInput: \n");
  scanf("%lf", &a);
  printf("Out: %lf\n", sin(a * (3.14159265 / 180)));
}


x86 assembly (clang, -O0):
<sinus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  0xea2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinus>:
push   %rax
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xe97(%rip),%xmm0
call   1050 <sin@plt>
lea    0xe97(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Func sin\0AInput: \0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [10 x i8] c"Out: %lf\0A\00"
define void @sinus() {
%1 = alloca double
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 0x3F91DF46A1FAE712
%6 = call i32 @sin(double %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [10 x i8] c"Out: %lf\0A\00"
@str = [17 x i8] c"Func sin\0AInput: \00"
define void @sinus() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 0x3F91DF46A1FAE712
%7 = call i32 @sin(double %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret void
}
void wait_RnB(void) {
  while (!((*((volatile unsigned char *)0x70200028)) & 0x1))
    ;
}


x86 assembly (clang, -O0):
<wait_RnB>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <wait_RnB+0x9>
mov    $0x70200028,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <wait_RnB+0x2b>
jmp    1130 <wait_RnB+0x30>
jmp    1109 <wait_RnB+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_RnB>:
testb  $0x1,0x70200028
01
je     1100 <wait_RnB>
ret

LLVM IR (-O0):
define void @wait_RnB() {
br label %1
1: ; preds = %7, %0
%2 = load volatile i8, i8* inttoptr (i64 1881145384 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %1
br label %1
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @wait_RnB() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i8, i8* inttoptr (i64 1881145384 to i8*)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int errno;
int lseek(int, int, int);
int k_seek(int *pos, int fd, int offset, int whence) {
  off_t rc = lseek(fd, offset, whence);
  if (rc < 0)
    return errno;
  if (pos)
    *pos = rc;
  return 0;
}


x86 assembly (clang, -O0):
<k_seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <lseek@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1151 <k_seek+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <k_seek+0x5c>
cmpq   $0x0,-0x10(%rbp)
je     1165 <k_seek+0x55>
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_seek>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <lseek@plt>
test   %eax,%eax
js     1130 <k_seek+0x20>
mov    %eax,%ecx
xor    %eax,%eax
test   %rbx,%rbx
je     112e <k_seek+0x1e>
mov    %ecx,(%rbx)
pop    %rbx
ret
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @k_seek(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = call i32 @lseek(i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %10
%15 = load i32, i32* %10
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = load i32, i32* @errno
store i32 %18, i32* %5
br label %26
19: ; preds = %4
%20 = load i32*, i32** %6
%21 = icmp ne i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %10
%24 = load i32*, i32** %6
store i32 %23, i32* %24
br label %25
25: ; preds = %22, %19
store i32 0, i32* %5
br label %26
26: ; preds = %25, %17
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @k_seek(i32* writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @lseek(i32 %1, i32 %2, i32 %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = load i32, i32* @errno
br label %12
9: ; preds = %4
%10 = icmp eq i32* %0, null
br i1 %10, label %12, label %11
11: ; preds = %9
store i32 %5, i32* %0
br label %12
12: ; preds = %9, %11, %7
%13 = phi i32 [ %8, %7 ], [ 0, %11 ], [ 0, %9 ]
ret i32 %13
}
/* Type definitions */
struct svc_rqst {
  int dummy;
};
typedef int /*<<< orphan*/ __be32;

/* Variables and functions */
void nfsd4_set_statp(struct svc_rqst *rqstp, __be32 *statp) {}


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

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

LLVM IR (-O0):
%struct.svc_rqst = type { i32 }
define void @nfsd4_set_statp(%struct.svc_rqst* %0, i32* %1) {
%3 = alloca %struct.svc_rqst*
%4 = alloca i32*
store %struct.svc_rqst* %0, %struct.svc_rqst** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
%struct.svc_rqst = type { i32 }
define void @nfsd4_set_statp(%struct.svc_rqst* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
char *ltrim(char *, char const);
char *rtrim(char *, char const);
char *trim(char *s, const char d) {
  char *t, *r;
  t = ltrim(s, d);
  r = rtrim(t, d);
  return r;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <ltrim@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <rtrim@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %esi,%ebx
call   1040 <ltrim@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <rtrim@plt>

LLVM IR (-O0):
define i8* @trim(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %4
%9 = call i8* @ltrim(i8* %7, i8 signext %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8, i8* %4
%12 = call i8* @rtrim(i8* %10, i8 signext %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
ret i8* %13
}

LLVM IR (-O2):
define i8* @trim(i8* %0, i8 signext %1) {
%3 = tail call i8* @ltrim(i8* %0, i8 signext %1)
%4 = tail call i8* @rtrim(i8* %3, i8 signext %1)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *private_get_line_from_file(int /*<<< orphan*/ *, int);
char *bb_get_chomped_line_from_file(FILE *file) {
  return private_get_line_from_file(file, 1);
}


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

x86 assembly (clang, -O2):
<bb_get_chomped_line_from_file>:
mov    $0x1,%esi
jmp    1030 <private_get_line_from_file@plt>

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

LLVM IR (-O2):
define i8* @bb_get_chomped_line_from_file(i32* %0) {
%2 = tail call i8* @private_get_line_from_file(i32* %0, i32 1)
ret i8* %2
}
int main(void) {
  char *p;
  if (1) {
    char i[48];
    p = __builtin_alloca(8);
    p[0] = 1;
  }
  if (1) {
    char i[48], j[64];
    j[48] = 0;
  }
  return !p[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc0(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
movb   $0x0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [48 x i8]
%4 = alloca [48 x i8]
%5 = alloca [64 x i8]
store i32 0, i32* %1
%6 = alloca i8, i64 8
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 1, i8* %8
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 48
store i8 0, i8* %9
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int rand_number(int /*<<< orphan*/, int);
int /*<<< orphan*/ swap_cards(int, int *, int, int);
void shuffle_cards(int size, int deck[size]) {
  int i, r;
  for (i = 1; i < size; i++) {
    r = rand_number(0, i);
    swap_cards(size, deck, i, r);
  }
}


x86 assembly (clang, -O0):
<shuffle_cards>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116f <shuffle_cards+0x4f>
mov    -0x14(%rbp),%esi
xor    %edi,%edi
call   1040 <rand_number@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <swap_cards@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <shuffle_cards+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shuffle_cards>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     115e <shuffle_cards+0x3e>
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
mov    %ebx,%esi
call   1040 <rand_number@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
call   1030 <swap_cards@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1140 <shuffle_cards+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @shuffle_cards(i32 %0, i32* %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 1, %2 ]
%6 = tail call i32 @rand_number(i32 0, i32 %5)
%7 = tail call i32 @swap_cards(i32 %0, i32* %1, i32 %5, i32 %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ delta;
};
typedef TYPE_1__ XwcTextItem;

/* Variables and functions */
int get_XwcTextItem_delta(void *_p) { return (int)((XwcTextItem *)_p)->delta; }


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

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

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

LLVM IR (-O2):
define i32 @get_XwcTextItem_delta(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ initdigger();
int /*<<< orphan*/ initmbspr();
int /*<<< orphan*/ initmonsters();
void initchars(void) {
  initmbspr();
  initdigger();
  initmonsters();
}


x86 assembly (clang, -O0):
<initchars>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initmbspr@plt>
mov    $0x0,%al
call   1050 <initdigger@plt>
mov    $0x0,%al
call   1030 <initmonsters@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initchars>:
push   %rax
xor    %eax,%eax
call   1040 <initmbspr@plt>
xor    %eax,%eax
call   1050 <initdigger@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <initmonsters@plt>

LLVM IR (-O0):
define void @initchars() {
%1 = call i32 (...) @initmbspr()
%2 = call i32 (...) @initdigger()
%3 = call i32 (...) @initmonsters()
ret void
}

LLVM IR (-O2):
define void @initchars() {
%1 = tail call i32 (...) @initmbspr()
%2 = tail call i32 (...) @initdigger()
%3 = tail call i32 (...) @initmonsters()
ret void
}
float celscon(float fahr) { return ((5.0 / 9.0) * (fahr - 32.0)); }


x86 assembly (clang, -O0):
<celscon>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celscon>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @celscon(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @celscon(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t signum_i32(int32_t i) {
  if (i > 0)
    return 1;
  if (i < 0)
    return (-1);
  return 0;
}


x86 assembly (clang, -O0):
<signum_i32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1120 <signum_i32+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1140 <signum_i32+0x40>
cmpq   $0x0,-0x10(%rbp)
jge    1138 <signum_i32+0x38>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1140 <signum_i32+0x40>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_i32>:
mov    %rdi,%rcx
sar    $0x3f,%rcx
test   %rdi,%rdi
mov    $0x1,%eax
cmovle %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @signum_i32(i64 %0) {
%2 = ashr i64 %0, 63
%3 = icmp slt i64 %0, 1
%4 = select i1 %3, i64 %2, i64 1
ret i64 %4
}
/* Variables and functions */
int base64_decode_block(unsigned char *, int *, unsigned char const *, int);
int decode_block(unsigned char *dst, int *dstlen, const unsigned char *src,
                 int srclen) {
  return (base64_decode_block(dst, dstlen, src, srclen));
}


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

x86 assembly (clang, -O2):
<decode_block>:
jmp    1030 <base64_decode_block@plt>

LLVM IR (-O0):
define i32 @decode_block(i8* %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @base64_decode_block(i8* %9, i32* %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @decode_block(i8* %0, i32* %1, i8* %2, i32 %3) {
%5 = tail call i32 @base64_decode_block(i8* %0, i32* %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
void deckpam(void) { esc("="); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
define void @deckpam() {
%1 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define void @deckpam() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_Huffman_tables();
int /*<<< orphan*/ set_DHTinfo();
int /*<<< orphan*/ set_DQTinfo();
void init_all() {
  set_DQTinfo();
  set_DHTinfo();
  init_Huffman_tables();
}


x86 assembly (clang, -O0):
<init_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <set_DQTinfo@plt>
mov    $0x0,%al
call   1040 <set_DHTinfo@plt>
mov    $0x0,%al
call   1030 <init_Huffman_tables@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_all>:
push   %rax
xor    %eax,%eax
call   1050 <set_DQTinfo@plt>
xor    %eax,%eax
call   1040 <set_DHTinfo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_Huffman_tables@plt>

LLVM IR (-O0):
define void @init_all() {
%1 = call i32 (...) @set_DQTinfo()
%2 = call i32 (...) @set_DHTinfo()
%3 = call i32 (...) @init_Huffman_tables()
ret void
}

LLVM IR (-O2):
define void @init_all() {
%1 = tail call i32 (...) @set_DQTinfo()
%2 = tail call i32 (...) @set_DHTinfo()
%3 = tail call i32 (...) @init_Huffman_tables()
ret void
}
double sancus_time_ms_to_fp(int ms) {
  int x = ms < 0 ? -ms : ms;
  double d = x / (1000L * (1));
  x %= (1000L * (1));
  d += (double)x / 1000.;
  return ms < 0 ? -d : d;
}


x86 assembly (clang, -O0):
<sancus_time_ms_to_fp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <sancus_time_ms_to_fp+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1124 <sancus_time_ms_to_fp+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movslq -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    11a0 <sancus_time_ms_to_fp+0xa0>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11aa <sancus_time_ms_to_fp+0xaa>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_time_ms_to_fp>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
imul   $0x10624dd3,%rax,%rcx
shr    $0x26,%rcx
imul   $0x3e8,%ecx,%edx
sub    %edx,%eax
cvtsi2sd %ecx,%xmm1
cvtsi2sd %eax,%xmm0
divsd  0xed6(%rip),%xmm0
addsd  %xmm1,%xmm0
test   %edi,%edi
jns    113a <sancus_time_ms_to_fp+0x3a>
xorpd  0xed6(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sancus_time_ms_to_fp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = sdiv i64 %15, 1000
%17 = sitofp i64 %16 to double
store double %17, double* %4
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = srem i64 %19, 1000
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = sitofp i32 %22 to double
%24 = fdiv double %23, 1.000000e+03
%25 = load double, double* %4
%26 = fadd double %25, %24
store double %26, double* %4
%27 = load i32, i32* %2
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %12
%30 = load double, double* %4
%31 = fneg double %30
br label %34
32: ; preds = %12
%33 = load double, double* %4
br label %34
34: ; preds = %32, %29
%35 = phi double [ %31, %29 ], [ %33, %32 ]
ret double %35
}

LLVM IR (-O2):
define double @sancus_time_ms_to_fp(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = sub nsw i32 0, %0
%4 = select i1 %2, i32 %3, i32 %0
%5 = udiv i32 %4, 1000
%6 = uitofp i32 %5 to double
%7 = urem i32 %4, 1000
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+03
%10 = fadd double %9, %6
%11 = fneg double %10
%12 = select i1 %2, double %11, double %10
ret double %12
}