xunge/DecIR huggingface dataset:
/* Type definitions */
typedef size_t uint64_t;
struct sysinfo {
  scalar_t__ mem_unit;
  scalar_t__ totalram;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t, size_t);
int /*<<< orphan*/ sysinfo(struct sysinfo *);
uint64_t get_memory_size() {
  struct sysinfo info;
  sysinfo(&info);
  printf("total ram %lu, mem units %lu\n", (size_t)info.totalram,
         (size_t)info.mem_unit);
  return (size_t)info.totalram * (size_t)info.mem_unit;
}


x86 assembly (clang, -O0):
<get_memory_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1040 <sysinfo@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_memory_size>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1040 <sysinfo@plt>
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
imul   0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sysinfo = type { i64, i64 }
@.str = [30 x i8] c"total ram %lu, mem units %lu\0A\00"
define i64 @get_memory_size() {
%1 = alloca %struct.sysinfo
%2 = call i32 @sysinfo(%struct.sysinfo* %1)
%3 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%6 = load i64, i64* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %6)
%8 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%11 = load i64, i64* %10
%12 = mul i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.sysinfo = type { i64, i64 }
@.str = [30 x i8] c"total ram %lu, mem units %lu\0A\00"
define i64 @get_memory_size() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %7)
%9 = load i64, i64* %4
%10 = load i64, i64* %6
%11 = mul i64 %10, %9
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
scalar_t__ clock_getcpuclockid(int /*<<< orphan*/, int /*<<< orphan*/ *);
int clock_test(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int do_test(void) {
  clockid_t cl;
  int result;
  result = clock_test(CLOCK_REALTIME);
  if (clock_getcpuclockid(0, &cl) == 0)
    clock_test(cl);
  else
    printf("CPU clock unavailble, skipping test\n");
  return result;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <clock_test@plt>
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
call   1050 <clock_getcpuclockid@plt>
cmp    $0x0,%rax
jne    116b <do_test+0x3b>
mov    -0x4(%rbp),%edi
call   1040 <clock_test@plt>
jmp    1177 <do_test+0x47>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <clock_test@plt>
mov    %eax,%ebx
lea    0xc(%rsp),%rsi
xor    %edi,%edi
call   1050 <clock_getcpuclockid@plt>
test   %rax,%rax
je     1164 <do_test+0x34>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
jmp    116d <do_test+0x3d>
mov    0xc(%rsp),%edi
call   1040 <clock_test@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@CLOCK_REALTIME = global i32 0
@.str = [37 x i8] c"CPU clock unavailble, skipping test\0A\00"
define i32 @do_test() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_test(i32 %3)
store i32 %4, i32* %2
%5 = call i64 @clock_getcpuclockid(i32 0, i32* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @clock_test(i32 %8)
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@CLOCK_REALTIME = global i32 0
@str = [36 x i8] c"CPU clock unavailble, skipping test\00"
define i32 @do_test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = tail call i32 @clock_test(i32 %3)
%5 = call i64 @clock_getcpuclockid(i32 0, i32* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @clock_test(i32 %8)
br label %12
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
ret i32 %4
}
int fun310() { return 310; }


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

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

LLVM IR (-O0):
define i32 @fun310() {
ret i32 310
}

LLVM IR (-O2):
define i32 @fun310() {
ret i32 310
}
int is_leap(int year) {
  return (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0));
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
je     1153 <is_leap+0x53>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <is_leap+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     1121 <is_leap+0x21>
xor    %eax,%eax
test   $0x3,%dil
je     1127 <is_leap+0x27>
ret
mov    $0x1,%eax
ret
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setae  %al
ret

LLVM IR (-O0):
define i32 @is_leap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 400
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 100
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 100
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
void aeDeleteFileEvent(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               33, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<aeDeleteFileEvent>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x21,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeDeleteFileEvent>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x21,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aeDeleteFileEvent = [18 x i8] c"aeDeleteFileEvent\00"
define void @aeDeleteFileEvent() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.aeDeleteFileEvent, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aeDeleteFileEvent = [18 x i8] c"aeDeleteFileEvent\00"
define void @aeDeleteFileEvent() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.aeDeleteFileEvent, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_RADIO_FIFOP_OUTPUT() { set_io_bit(-3, 3); }


x86 assembly (clang, -O0):
<TOSH_MAKE_RADIO_FIFOP_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffd,%edi
mov    $0x3,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_RADIO_FIFOP_OUTPUT>:
mov    $0xfffffffd,%edi
mov    $0x3,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_RADIO_FIFOP_OUTPUT() {
%1 = call i32 @set_io_bit(i32 -3, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_RADIO_FIFOP_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 -3, i32 3)
ret void
}
void EC_KEY_print(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_print() {
ret void
}
void glFramebufferTextureLayer(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glFramebufferTextureLayer() {
ret void
}
int bar(float x) { return x == x; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @bar(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp oeq float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @bar(float %0) {
%2 = fcmp ord float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void ptsinc(uint64_t *pts1, uint64_t pts2) {
  *pts1 = (*pts1 + pts2) % (300 * (0x0000000200000000ULL));
}


x86 assembly (clang, -O0):
<ptsinc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    -0xc(%rbp),%eax
cltq
movabs $0x25800000000,%rcx
xor    %edx,%edx
div    %rcx
mov    %edx,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptsinc>:
add    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @ptsinc(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = sext i32 %8 to i64
%10 = urem i64 %9, 2576980377600
%11 = trunc i64 %10 to i32
%12 = load i32*, i32** %3
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @ptsinc(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, %1
%5 = sext i32 %4 to i64
%6 = urem i64 %5, 2576980377600
%7 = trunc i64 %6 to i32
store i32 %7, i32* %0
ret void
}
int f() {
  int j = 1;
  long i;
  i = 0x60000000L;
  do {
    j <<= 1;
    i += 0x10000000L;
  } while (i < -0x60000000L);
  return j;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movq   $0x60000000,-0x10(%rbp)
60
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10000000,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffa0000000,-0x10(%rbp)
a0
jl     1113 <f+0x13>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 2
}
int ds_fs_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ds_fs_shutdown() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Programming is fun!\n");
  printf("And programming in C is even more fun!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%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
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Programming is fun!\0A\00"
@.str.1 = [40 x i8] c"And programming in C is even more fun!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Programming is fun!\00"
@str.2 = [39 x i8] c"And programming in C is even more fun!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int range_decode_culshift(int);
int /*<<< orphan*/ range_decode_update(int, int);
int range_decode_bits(int n) {
  int tmp = range_decode_culshift(n);
  range_decode_update(1, tmp);
  return tmp;
}


x86 assembly (clang, -O0):
<range_decode_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <range_decode_culshift@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1040 <range_decode_update@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_decode_bits>:
push   %rbx
call   1030 <range_decode_culshift@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    %eax,%esi
call   1040 <range_decode_update@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @range_decode_bits(i32 %0) {
%2 = tail call i32 @range_decode_culshift(i32 %0)
%3 = tail call i32 @range_decode_update(i32 1, i32 %2)
ret i32 %2
}
/* Variables and functions */
float __ocml_fmod_f32(float, float);
float fmodf(float x, float y) { return __ocml_fmod_f32(x, y); }


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__ocml_fmod_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
jmp    1030 <__ocml_fmod_f32@plt>

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

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
%3 = tail call float @__ocml_fmod_f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ DAC0_DriverIRQHandler();
__attribute__((weak)) void DAC0_IRQHandler(void) { DAC0_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DAC0_IRQHandler() {
%1 = call i32 (...) @DAC0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DAC0_IRQHandler() {
%1 = tail call i32 (...) @DAC0_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ on_the_wall(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ take_one_down(int);
void _99_bottles_of_beer() {
  int i = 99;
  while (i >= 0) {
    on_the_wall(i);
    i--;
    take_one_down(i);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<_99_bottles_of_beer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1173 <_99_bottles_of_beer+0x43>
mov    -0x4(%rbp),%edi
call   1030 <on_the_wall@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <take_one_down@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <_99_bottles_of_beer+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_99_bottles_of_beer>:
push   %rbx
mov    $0x63,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <on_the_wall@plt>
add    $0xffffffff,%ebx
mov    %ebx,%edi
call   1050 <take_one_down@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
add    $0xffffffff,%eax
inc    %ebx
mov    %eax,%ebx
jne    1140 <_99_bottles_of_beer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @_99_bottles_of_beer() {
%1 = alloca i32
store i32 99, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @on_the_wall(i32 %6)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = call i32 @take_one_down(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @_99_bottles_of_beer() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 99, %0 ], [ %4, %1 ]
%3 = tail call i32 @on_the_wall(i32 %2)
%4 = add nsw i32 %2, -1
%5 = tail call i32 @take_one_down(i32 %4)
%6 = tail call i32 @putchar(i32 10)
%7 = icmp eq i32 %2, 0
br i1 %7, label %8, label %1
8: ; preds = %1
ret void
}
char vchar(char ch) {
  if ((ch >= ' ' && ch <= '~')) {
    return ch;
  }
  return '.';
}


x86 assembly (clang, -O0):
<vchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     112f <vchar+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jg     112f <vchar+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1133 <vchar+0x33>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vchar>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%al
mov    $0x2e,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @vchar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 126
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %14
13: ; preds = %7, %1
store i8 46, i8* %2
br label %14
14: ; preds = %13, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @vchar(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = select i1 %3, i8 %0, i8 46
ret i8 %4
}
/* Variables and functions */
int _xtest();
int __attribute__((__target__("rtm"))) xtest_wrap(void) { return _xtest(); }


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

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

LLVM IR (-O0):
define i32 @xtest_wrap() {
%1 = call i32 (...) @_xtest()
ret i32 %1
}

LLVM IR (-O2):
define i32 @xtest_wrap() {
%1 = tail call i32 (...) @_xtest()
ret i32 %1
}
unsigned int rotateLeft(unsigned int input) {
  int tmp;
  input *= 2;
  tmp = input & 0x100;
  input += tmp / 0x100;
  input &= 0x00ff;
  return input;
}


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

x86 assembly (clang, -O2):
<rotateLeft>:
mov    %edi,%eax
shr    $0x7,%eax
and    $0x1,%eax
and    $0x7f,%edi
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @rotateLeft(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul i32 %4, 2
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 256
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 256
%10 = load i32, i32* %2
%11 = add i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = and i32 %12, 255
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @rotateLeft(i32 %0) {
%2 = shl i32 %0, 1
%3 = lshr i32 %2, 8
%4 = and i32 %3, 1
%5 = and i32 %2, 254
%6 = or i32 %4, %5
ret i32 %6
}
/* Type definitions */
struct sbuf {
  int dummy;
};
struct devio {
  int dummy;
};

/* Variables and functions */
int lbuffer_write(struct devio *, int /*<<< orphan*/, struct sbuf *, int *);
int buffer_io_write(struct devio *io, struct sbuf *buf, int *buferr) {
  return lbuffer_write(io, 0, buf, buferr);
}


x86 assembly (clang, -O0):
<buffer_io_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <lbuffer_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_io_write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <lbuffer_write@plt>

LLVM IR (-O0):
%struct.devio = type { i32 }
%struct.sbuf = type { i32 }
define i32 @buffer_io_write(%struct.devio* %0, %struct.sbuf* %1, i32* %2) {
%4 = alloca %struct.devio*
%5 = alloca %struct.sbuf*
%6 = alloca i32*
store %struct.devio* %0, %struct.devio** %4
store %struct.sbuf* %1, %struct.sbuf** %5
store i32* %2, i32** %6
%7 = load %struct.devio*, %struct.devio** %4
%8 = load %struct.sbuf*, %struct.sbuf** %5
%9 = load i32*, i32** %6
%10 = call i32 @lbuffer_write(%struct.devio* %7, i32 0, %struct.sbuf* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.devio = type { i32 }
%struct.sbuf = type { i32 }
define i32 @buffer_io_write(%struct.devio* %0, %struct.sbuf* %1, i32* %2) {
%4 = tail call i32 @lbuffer_write(%struct.devio* %0, i32 0, %struct.sbuf* %1, i32* %2)
ret i32 %4
}
void set_secvar_ops(const struct secvar_operations *ops) {}


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

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

LLVM IR (-O0):
%struct.secvar_operations = type opaque
define void @set_secvar_ops(%struct.secvar_operations* %0) {
%2 = alloca %struct.secvar_operations*
store %struct.secvar_operations* %0, %struct.secvar_operations** %2
ret void
}

LLVM IR (-O2):
%struct.secvar_operations = type opaque
define void @set_secvar_ops(%struct.secvar_operations* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ str_stats(char *);
int main(int argc, char **argv) {
  if (2 != argc) {
    printf("Nombre de parametres insuffisants\n");
    return 1;
  }
  str_stats(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
je     115c <main+0x3c>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <str_stats@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <str_stats@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Nombre de parametres insuffisants\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 2, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @str_stats(i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@str = [34 x i8] c"Nombre de parametres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @str_stats(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %11
}
/* Variables and functions */
int system(char *);
int execute_system_command(char *s) {
  int stat;
  stat = system(s);
  return (stat);
}


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

x86 assembly (clang, -O2):
<execute_system_command>:
jmp    1030 <system@plt>

LLVM IR (-O0):
define i32 @execute_system_command(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @system(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @execute_system_command(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__29__IO__clr();
void Msp430GpioC__6__HplGeneralIO__clr(void) {
  HplMsp430GeneralIOP__29__IO__clr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__6__HplGeneralIO__clr() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__29__IO__clr()
ret void
}
char *hash_plugin_summary(void) { return ("ntlm \t\tNTLM plugin"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"ntlm \09\09NTLM plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"ntlm \09\09NTLM plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
void foo_2_2_2_2_1_1_2_1_1() {}


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

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

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

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

/* Variables and functions */
int dbg_cpu1_write(uint32_t adr, uint32_t data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dbg_cpu1_write(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(char *);
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  char *path;
  path = getcwd(NULL, 0);
  if (!path) {
    perror(path);
    exit(1);
  }
  puts(path);
  free(path);
  exit(0);
}


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)
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1050 <getcwd@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1193 <main+0x43>
mov    -0x18(%rbp),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1050 <getcwd@plt>
test   %rax,%rax
jne    1170 <main+0x20>
xor    %edi,%edi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @getcwd(i32* null, i32 0)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i8*, i8** %6
%12 = call i32 @perror(i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = call i32 @puts(i8* %15)
%17 = load i8*, i8** %6
%18 = call i32 @free(i8* %17)
%19 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @getcwd(i32* null, i32 0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* null)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 @puts(i8* %3)
%10 = tail call i32 @free(i8* %3)
%11 = tail call i32 @exit(i32 0)
unreachable
}
int cfs_cdebug_show(unsigned int mask, unsigned int subsystem) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cfs_cdebug_show(i32 %0, i32 %1) {
ret i32 0
}
int Mini_AigVar2Lit(int Var, int fCompl) { return Var + Var + fCompl; }


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

x86 assembly (clang, -O2):
<Mini_AigVar2Lit>:
lea    (%rsi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @Mini_AigVar2Lit(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ break_up_num(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  break_up_num(num);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @break_up_num(i32 %4)
ret i32 0
}
/* Variables and functions */
double cos(double);
double sin(double);
double f1(double x) { return sin(x) + cos(x); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = load double, double* %2
%6 = call double @cos(double %5)
%7 = fadd double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @f1(double %0) {
%2 = tail call double @sin(double %0)
%3 = tail call double @cos(double %0)
%4 = fadd double %2, %3
ret double %4
}
/* Variables and functions */
int strtol(char const *, char **, int);
int parseint(const char *str, int *target) {
  char *endptr;
  *target = strtol(str, &endptr, 10);
  if (*endptr) {
    return -1;
  }
  return *target;
}


x86 assembly (clang, -O0):
<parseint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <parseint+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <parseint+0x4c>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseint>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,(%rbx)
mov    0x8(%rsp),%rcx
xor    %edx,%edx
cmp    (%rcx),%dl
sbb    %ecx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @parseint(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtol(i8* %0, i8** %3, i32 10)
store i32 %5, i32* %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = select i1 %8, i32 %5, i32 -1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ chroot(char *);
int /*<<< orphan*/ foo();
void f2(void) {
  chroot("/usr/local");
  chdir("/");
  foo();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <chroot@plt>
lea    0xec4(%rip),%rdi
call   1040 <chdir@plt>
mov    $0x0,%al
call   1050 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <chroot@plt>
lea    0xec7(%rip),%rdi
call   1040 <chdir@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <foo@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/usr/local\00"
@.str.1 = [2 x i8] c"/\00"
define void @f2() {
%1 = call i32 @chroot(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/usr/local\00"
@.str.1 = [2 x i8] c"/\00"
define void @f2() {
%1 = tail call i32 @chroot(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scu_dsp_program_end();
void scu_dsp_program_end_wait(void) {
  while (!(scu_dsp_program_end()))
    ;
}


x86 assembly (clang, -O0):
<scu_dsp_program_end_wait>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <scu_dsp_program_end_wait+0x9>
mov    $0x0,%al
call   1030 <scu_dsp_program_end@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <scu_dsp_program_end_wait+0x25>
jmp    113a <scu_dsp_program_end_wait+0x2a>
jmp    1119 <scu_dsp_program_end_wait+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scu_dsp_program_end_wait>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <scu_dsp_program_end@plt>
test   %eax,%eax
je     1120 <scu_dsp_program_end_wait+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @scu_dsp_program_end_wait() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @scu_dsp_program_end()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @scu_dsp_program_end_wait() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @scu_dsp_program_end()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
double _tan(x)
double x;
{ return _sin(x) / _cos(x); }


x86 assembly (clang, -O0):
<_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <_sin@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1040 <_cos@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tan>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1030 <_sin@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <_cos@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @_tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (double, ...) bitcast (i32 (...)* @_sin to i32 (double, ...)*)(double %3)
%5 = load double, double* %2
%6 = call i32 (double, ...) bitcast (i32 (...)* @_cos to i32 (double, ...)*)(double %5)
%7 = sdiv i32 %4, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @_tan(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @_sin to i32 (double, ...)*)(double %0)
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @_cos to i32 (double, ...)*)(double %0)
%4 = sdiv i32 %2, %3
%5 = sitofp i32 %4 to double
ret double %5
}
int main() {
  int a, b, c;
A:
  if (a) {
    b = 0;
    c = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1123 <main+0x23>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void INT_Excep_TPU3_TGI3A(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU3_TGI3A() {
ret void
}
void out_hex(fmt, x) const char fmt[];
unsigned int x;
{
  printf(fmt, x);
  out_line_count(fmt);
}


x86 assembly (clang, -O0):
<out_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <out_line_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_hex>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <out_line_count@plt>

LLVM IR (-O0):
define void @out_hex(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 = call i32 (i8*, ...) @printf(i8* %5, i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %8)
ret void
}

LLVM IR (-O2):
define void @out_hex(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 %1)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @out_line_count to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char const *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void printDt(char *buff, const char *format) {
  struct tm *tm_info;
  time_t timer;
  time(&timer);
  tm_info = localtime(&timer);
  strftime(buff, 32, format, tm_info);
}


x86 assembly (clang, -O0):
<printDt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
call   1040 <time@plt>
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x20,%esi
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDt>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xc(%rsp),%r15
mov    %r15,%rdi
call   1040 <time@plt>
mov    %r15,%rdi
call   1030 <localtime@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @printDt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.tm*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i32 @time(i32* %6)
%8 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %8, %struct.tm** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load %struct.tm*, %struct.tm** %5
%12 = call i32 @strftime(i8* %9, i32 32, i8* %10, %struct.tm* %11)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @printDt(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 32, i8* %1, %struct.tm* %6)
ret void
}
int flt(float x, float y) {
  if (x < y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<flt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    112d <flt+0x2d>
movl   $0xd,-0x4(%rbp)
jmp    1134 <flt+0x34>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt>:
ucomiss %xmm0,%xmm1
mov    $0xd,%ecx
mov    $0x8c,%eax
cmova  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @flt(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 13, i32* %3
br label %11
10: ; preds = %2
store i32 140, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @flt(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, i32 13, i32 140
ret i32 %4
}