xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int symlink(char *, char *);
main(int argc, char *argv[]) {
  if (argc < 3)
    die("usage: sln dest src\n");
  if (symlink(argv[2], argv[1]) == -1)
    die("symlink failed\n");
  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)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <symlink@plt>
cmp    $0xffffffff,%eax
jne    1176 <main+0x56>
lea    0xea4(%rip),%rdi
call   1040 <die@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     1135 <main+0x15>
lea    0xed0(%rip),%rdi
call   1040 <die@plt>
mov    0x8(%rbx),%rsi
mov    0x10(%rbx),%rdi
call   1030 <symlink@plt>
cmp    $0xffffffff,%eax
jne    1153 <main+0x33>
lea    0xec7(%rip),%rdi
call   1040 <die@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"usage: sln dest src\0A\00"
@.str.1 = [16 x i8] c"symlink failed\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 slt i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @symlink(i8* %13, i8* %16)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = call i32 @die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"usage: sln dest src\0A\00"
@.str.1 = [16 x i8] c"symlink failed\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @symlink(i8* %8, i8* %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %6
%14 = tail call i32 @die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %6
ret i32 0
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/ap.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/ap.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/ap.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int strcmp(char *, char *);
int compString(void *s1, void *s2) { return strcmp((char *)s1, (char *)s2); }


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

x86 assembly (clang, -O2):
<compString>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compString(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int fn2(int, int, int);
__attribute__((no, noclone)) int fn4(int x, int y) { return fn2(x, y, 8); }


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

x86 assembly (clang, -O2):
<fn4>:
mov    $0x8,%edx
jmp    1030 <fn2@plt>

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

LLVM IR (-O2):
define i32 @fn4(i32 %0, i32 %1) {
%3 = tail call i32 @fn2(i32 %0, i32 %1, i32 8)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
void qstat_report(int v) {
  int w = 0xa305352 + (v << 16);
  write(1, &w, 4);
}


x86 assembly (clang, -O0):
<qstat_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
add    $0xa305352,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qstat_report>:
push   %rax
shl    $0x10,%edi
add    $0xa305352,%edi
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @qstat_report(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 16
%6 = add nsw i32 170939218, %5
store i32 %6, i32* %3
%7 = call i32 @write(i32 1, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
define void @qstat_report(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = shl i32 %0, 16
%5 = add nsw i32 %4, 170939218
store i32 %5, i32* %2
%6 = call i32 @write(i32 1, i32* %2, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void *MAP_FAILED;
void *mmap(void *, size_t, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ quit(char *);
void *_mmap(void *addr, size_t length, int prot, int flags, int fd,
            off_t offset) {
  void *m;
  if ((m = mmap(addr, length, prot, flags, fd, offset)) == MAP_FAILED)
    quit("mmap() failed");
  return m;
}


x86 assembly (clang, -O0):
<_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%rax
jne    1179 <_mmap+0x59>
lea    0xe8c(%rip),%rdi
call   1040 <quit@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mmap>:
push   %rbx
call   1030 <mmap@plt>
mov    %rax,%rbx
mov    0x2eb0(%rip),%rax
cmp    (%rax),%rbx
jne    1141 <_mmap+0x21>
lea    0xec4(%rip),%rdi
call   1040 <quit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@MAP_FAILED = global i8* null
@.str = [14 x i8] c"mmap() failed\00"
define i8* @_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = call i8* @mmap(i8* %14, i64 %15, i32 %16, i32 %17, i32 %18, i32 %19)
store i8* %20, i8** %13
%21 = load i8*, i8** @MAP_FAILED
%22 = icmp eq i8* %20, %21
br i1 %22, label %23, label %25
23: ; preds = %6
%24 = call i32 @quit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %23, %6
%26 = load i8*, i8** %13
ret i8* %26
}

LLVM IR (-O2):
@MAP_FAILED = global i8* null
@.str = [14 x i8] c"mmap() failed\00"
define i8* @_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = load i8*, i8** @MAP_FAILED
%9 = icmp eq i8* %7, %8
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @quit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freePacket(void *packet) { free(packet); }


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

x86 assembly (clang, -O2):
<freePacket>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freePacket(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned int fun(unsigned int a) { return a + 13; }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    0xd(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = add i32 %0, 13
ret i32 %2
}
/* Variables and functions */
scalar_t__ stdlib_base_is_nanf(float const);
float stdlib_base_signumf(const float x) {
  if (x == 0.0f || stdlib_base_is_nanf(x)) {
    return x;
  }
  return (x < 0.0f) ? -1.0f : 1.0f;
}


x86 assembly (clang, -O0):
<stdlib_base_signumf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1139 <stdlib_base_signumf+0x29>
jp     1139 <stdlib_base_signumf+0x29>
jmp    114d <stdlib_base_signumf+0x3d>
movss  -0x8(%rbp),%xmm0
call   1030 <stdlib_base_is_nanf@plt>
cmp    $0x0,%rax
je     115c <stdlib_base_signumf+0x4c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118a <stdlib_base_signumf+0x7a>
movss  -0x8(%rbp),%xmm0
movss  0xe97(%rip),%xmm3
movss  0xe93(%rip),%xmm2
xorps  %xmm1,%xmm1
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_signumf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    111d <stdlib_base_signumf+0xd>
jp     111d <stdlib_base_signumf+0xd>
pop    %rax
ret
movss  %xmm0,0x4(%rsp)
call   1030 <stdlib_base_is_nanf@plt>
test   %rax,%rax
je     1135 <stdlib_base_signumf+0x25>
movss  0x4(%rsp),%xmm0
pop    %rax
ret
xorps  %xmm0,%xmm0
xor    %eax,%eax
ucomiss 0x4(%rsp),%xmm0
seta   %al
lea    0xeb7(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stdlib_base_signumf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oeq float %4, 0.000000e+00
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load float, float* %3
%8 = call i64 @stdlib_base_is_nanf(float %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6, %1
%11 = load float, float* %3
store float %11, float* %2
br label %17
12: ; preds = %6
%13 = load float, float* %3
%14 = fcmp olt float %13, 0.000000e+00
%15 = zext i1 %14 to i64
%16 = select i1 %14, float -1.000000e+00, float 1.000000e+00
store float %16, float* %2
br label %17
17: ; preds = %12, %10
%18 = load float, float* %2
ret float %18
}

LLVM IR (-O2):
define float @stdlib_base_signumf(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @stdlib_base_is_nanf(float %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = fcmp olt float %0, 0.000000e+00
%8 = select i1 %7, float -1.000000e+00, float 1.000000e+00
br label %9
9: ; preds = %1, %3, %6
%10 = phi float [ %8, %6 ], [ %0, %3 ], [ %0, %1 ]
ret float %10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xresizerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xresizerequest_display(void *_p) {
  return (void *)((XEvent *)_p)->xresizerequest.display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XEvent_xresizerequest_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void printNewLine() { putchar('\n'); }


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

x86 assembly (clang, -O2):
<printNewLine>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @printNewLine() {
%1 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @printNewLine() {
%1 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int foo(char *, int);
int main(void) {
  int i = 42;
  return foo("Hello", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x2a,%esi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 42)
ret i32 %1
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handle_bev_write(struct bufferevent *bev, void *udata) {
  printf("handle_bev_write()\n");
}


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

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

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
@.str = [20 x i8] c"handle_bev_write()\0A\00"
define void @handle_bev_write(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
@str = [19 x i8] c"handle_bev_write()\00"
define void @handle_bev_write(%struct.bufferevent* nocapture readnone %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))
ret void
}
int init_iosched_switcher(struct request_queue *q) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.request_queue = type opaque
define i32 @init_iosched_switcher(%struct.request_queue* nocapture readnone %0) {
ret i32 0
}
__attribute__((no)) void tail4() { asm(""); }


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

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

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

LLVM IR (-O2):
define void @tail4() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void foo_1_1_1_1_1_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_1_1_1_1() {
ret void
}
void foo136() {}


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

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

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

LLVM IR (-O2):
define void @foo136() {
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double randomVal(double Low, double High) {
  return ((double)rand() / RAND_MAX) * (High - Low) + Low;
}


x86 assembly (clang, -O0):
<randomVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
divsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomVal>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @randomVal(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %8, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @randomVal(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
void pm8921_bms_calibrate_hkadc(void) {}


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

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

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

LLVM IR (-O2):
define void @pm8921_bms_calibrate_hkadc() {
ret void
}
unsigned int cipher_mask(void) {
  unsigned int mask = 0;
  mask |= 1 << 1;
  mask |= 1 << 3;
  mask |= 1 << 6;
  return mask;
}


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

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

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

LLVM IR (-O2):
define i32 @cipher_mask() {
ret i32 74
}
int test_fun(int x, int y) {
  int c = 0;
  while (x > y) {
    x = x - 1;
    y = y + 1;
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113d <test_fun+0x3d>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_fun+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
xor    %eax,%eax
cmp    %esi,%edi
jle    1129 <test_fun+0x29>
add    $0xffffffff,%edi
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
add    $0x1,%eax
lea    (%rsi,%rcx,1),%r8d
add    $0x1,%r8d
lea    -0x1(%rdi),%edx
mov    %eax,%ecx
cmp    %r8d,%edi
mov    %edx,%edi
jg     1110 <test_fun+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %1, %2 ]
%7 = phi i32 [ %8, %4 ], [ %0, %2 ]
%8 = add nsw i32 %7, -1
%9 = add nsw i32 %6, 1
%10 = add nuw nsw i32 %5, 1
%11 = icmp sgt i32 %8, %9
br i1 %11, label %4, label %12
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %13
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_unsigned_char(unsigned char const k1,
                                          unsigned char const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_unsigned_char>:
xor    %eax,%eax
cmp    %sil,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_unsigned_char(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_unsigned_char(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ult i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcmpcasenosensitive_internal(char const *, char const *);
extern int unzStringFileNameCompare(const char *fileName1,
                                    const char *fileName2,
                                    int iCaseSensitivity) {
  if (iCaseSensitivity == 0)
    iCaseSensitivity = 1;
  if (iCaseSensitivity == 1)
    return strcmp(fileName1, fileName2);
  return strcmpcasenosensitive_internal(fileName1, fileName2);
}


x86 assembly (clang, -O0):
<unzStringFileNameCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1144 <unzStringFileNameCompare+0x24>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1163 <unzStringFileNameCompare+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <unzStringFileNameCompare+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmpcasenosensitive_internal@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unzStringFileNameCompare>:
cmp    $0x1,%edx
ja     112a <unzStringFileNameCompare+0xa>
jmp    1040 <strcmp@plt>
jmp    1030 <strcmpcasenosensitive_internal@plt>

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

LLVM IR (-O2):
define i32 @unzStringFileNameCompare(i8* %0, i8* %1, i32 %2) {
%4 = icmp ult i32 %2, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @strcmpcasenosensitive_internal(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
void work(x) int *x;
{
#pragma omp atomic
  *x += 1;
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<work>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @work(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
int ls_cost_nm10_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 1;
  return 0;
}


x86 assembly (clang, -O0):
<ls_cost_nm10_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <ls_cost_nm10_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <ls_cost_nm10_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <ls_cost_nm10_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <ls_cost_nm10_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm10_work>:
test   %rdi,%rdi
je     110b <ls_cost_nm10_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <ls_cost_nm10_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <ls_cost_nm10_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <ls_cost_nm10_work+0x2c>
movl   $0x1,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ls_cost_nm10_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Type definitions */
struct fins_sys_tp {
  int dummy;
};
struct fins_command_tp {
  int dummy;
};

/* Variables and functions */
int fins_tcp_recv(struct fins_sys_tp *, unsigned char *, int);
int fins_recv_tcp_command(struct fins_sys_tp *sys, int total_len,
                          struct fins_command_tp *command) {
  if (fins_tcp_recv(sys, (unsigned char *)command, total_len) != total_len)
    return 0x8707;
  return 0x0000;
}


x86 assembly (clang, -O0):
<fins_recv_tcp_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fins_tcp_recv@plt>
cmp    -0x14(%rbp),%eax
je     1148 <fins_recv_tcp_command+0x38>
movl   $0x8707,-0x4(%rbp)
jmp    114f <fins_recv_tcp_command+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fins_recv_tcp_command>:
push   %rbx
mov    %esi,%ebx
mov    %rdx,%rsi
mov    %ebx,%edx
call   1030 <fins_tcp_recv@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
mov    $0x8707,%eax
cmove  %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.fins_sys_tp = type { i32 }
%struct.fins_command_tp = type { i32 }
define i32 @fins_recv_tcp_command(%struct.fins_sys_tp* %0, i32 %1, %struct.fins_command_tp* %2) {
%4 = bitcast %struct.fins_command_tp* %2 to i8*
%5 = tail call i32 @fins_tcp_recv(%struct.fins_sys_tp* %0, i8* %4, i32 %1)
%6 = icmp eq i32 %5, %1
%7 = select i1 %6, i32 0, i32 34567
ret i32 %7
}
float AngleNormalize2Pi(float angle) {
  return (((AngleNormalize360((((angle)*180.0f) / 3.14159265358979323846f))) *
           3.14159265358979323846f) /
          180.0F);
}


x86 assembly (clang, -O0):
<AngleNormalize2Pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xed2(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <AngleNormalize360@plt>
cvtsi2ss %eax,%xmm0
movss  0xeb7(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xea7(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleNormalize2Pi>:
push   %rax
mulss  0xee7(%rip),%xmm0
divss  0xee3(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <AngleNormalize360@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xec9(%rip),%xmm0
divss  0xebd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @AngleNormalize2Pi(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.800000e+02
%5 = fdiv float %4, 0x400921FB60000000
%6 = fpext float %5 to double
%7 = call i32 (double, ...) bitcast (i32 (...)* @AngleNormalize360 to i32 (double, ...)*)(double %6)
%8 = sitofp i32 %7 to float
%9 = fmul float %8, 0x400921FB60000000
%10 = fdiv float %9, 1.800000e+02
ret float %10
}

LLVM IR (-O2):
define float @AngleNormalize2Pi(float %0) {
%2 = fmul float %0, 1.800000e+02
%3 = fdiv float %2, 0x400921FB60000000
%4 = fpext float %3 to double
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @AngleNormalize360 to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to float
%7 = fmul float %6, 0x400921FB60000000
%8 = fdiv float %7, 1.800000e+02
ret float %8
}
/* Type definitions */
typedef long int32_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdrrec_putint32(int /*<<< orphan*/ *, long *);
bool_t xdrrec_putlong(XDR *xdrs, const long *lp) {
  int32_t v = *lp;
  return xdrrec_putint32(xdrs, &v);
}


x86 assembly (clang, -O0):
<xdrrec_putlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <xdrrec_putint32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdrrec_putlong>:
push   %rax
mov    (%rsi),%rax
mov    %rax,(%rsp)
mov    %rsp,%rsi
call   1030 <xdrrec_putint32@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @xdrrec_putlong(i32* %0, i64* nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = load i64, i64* %1
store i64 %5, i64* %3
%6 = call i32 @xdrrec_putint32(i32* %0, i64* %3)
ret i32 %6
}
void foo_1_2_2_2_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_2_2_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_output_files();
int /*<<< orphan*/ free_global_thread_memory();
void destroy_thr_global(void) {
  close_output_files();
  free_global_thread_memory();
}


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

x86 assembly (clang, -O2):
<destroy_thr_global>:
push   %rax
xor    %eax,%eax
call   1040 <close_output_files@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <free_global_thread_memory@plt>

LLVM IR (-O0):
define void @destroy_thr_global() {
%1 = call i32 (...) @close_output_files()
%2 = call i32 (...) @free_global_thread_memory()
ret void
}

LLVM IR (-O2):
define void @destroy_thr_global() {
%1 = tail call i32 (...) @close_output_files()
%2 = tail call i32 (...) @free_global_thread_memory()
ret void
}
unsigned xrop3_17_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  stk1 = D | S;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_17_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_17_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_17_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = or i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = xor i32 %17, -1
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = xor i32 %20, -1
%22 = and i32 %19, %21
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = and i32 %23, %24
%26 = or i32 %22, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @xrop3_17_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -256
ret i32 %5
}
void fix_filename(char *name, int length) {
  if (length > 2) {
    length -= 2;
    name[length] = 0;
  }
  if (length > 1 && name[length - 1] == '.') {
    length--;
    name[length] = 0;
  }
}


x86 assembly (clang, -O0):
<fix_filename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jle    112a <fix_filename+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
cmpl   $0x1,-0xc(%rbp)
jle    1163 <fix_filename+0x63>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1163 <fix_filename+0x63>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_filename>:
cmp    $0x3,%esi
jl     110c <fix_filename+0xc>
add    $0xfffffffe,%esi
movb   $0x0,(%rdi,%rsi,1)
cmp    $0x2,%esi
jl     111e <fix_filename+0x1e>
add    $0xffffffff,%esi
cmpb   $0x2e,(%rdi,%rsi,1)
jne    111e <fix_filename+0x1e>
movb   $0x0,(%rdi,%rsi,1)
ret

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

LLVM IR (-O2):
define void @fix_filename(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = add nsw i32 %1, -2
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %5, %4 ], [ %1, %2 ]
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = add nsw i32 %9, -1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 46
br i1 %16, label %17, label %18
17: ; preds = %11
store i8 0, i8* %14
br label %18
18: ; preds = %17, %11, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fixnegzero(char *);
int hputc(char *, char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, float const);
int hputr4(char *hstring, const char *keyword, const const float rval) {
  char value[30];
  sprintf(value, "%f", rval);
  fixnegzero(value);
  return (hputc(hstring, keyword, value));
}


x86 assembly (clang, -O0):
<hputr4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
lea    0xeab(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <fixnegzero@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <hputc@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputr4>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xeba(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <fixnegzero@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <hputc@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @hputr4(i8* %0, i8* %1, float %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
%7 = alloca [30 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store float %2, float* %6
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%9 = load float, float* %6
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %9)
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%12 = call i32 @fixnegzero(i8* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%16 = call i32 @hputc(i8* %13, i8* %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @hputr4(i8* %0, i8* %1, float %2) {
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %2)
%7 = call i32 @fixnegzero(i8* %5)
%8 = call i32 @hputc(i8* %0, i8* %1, i8* %5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ADC1_ISR();
int /*<<< orphan*/ COMP_ISR();
void ADC1_COMP_ISR(void) {
  ADC1_ISR();
  COMP_ISR();
}


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

x86 assembly (clang, -O2):
<ADC1_COMP_ISR>:
push   %rax
xor    %eax,%eax
call   1040 <ADC1_ISR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <COMP_ISR@plt>

LLVM IR (-O0):
define void @ADC1_COMP_ISR() {
%1 = call i32 (...) @ADC1_ISR()
%2 = call i32 (...) @COMP_ISR()
ret void
}

LLVM IR (-O2):
define void @ADC1_COMP_ISR() {
%1 = tail call i32 (...) @ADC1_ISR()
%2 = tail call i32 (...) @COMP_ISR()
ret void
}