xunge/DecIR huggingface dataset:
/* Variables and functions */
int nvidia_mcp_gpio_set(int, int);
int nvidia_mcp_gpio0a_raise(void) { return nvidia_mcp_gpio_set(0x0a, 1); }


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

x86 assembly (clang, -O2):
<nvidia_mcp_gpio0a_raise>:
mov    $0xa,%edi
mov    $0x1,%esi
jmp    1030 <nvidia_mcp_gpio_set@plt>

LLVM IR (-O0):
define i32 @nvidia_mcp_gpio0a_raise() {
%1 = call i32 @nvidia_mcp_gpio_set(i32 10, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @nvidia_mcp_gpio0a_raise() {
%1 = tail call i32 @nvidia_mcp_gpio_set(i32 10, i32 1)
ret i32 %1
}
void tcp_ack_data(struct Squirrel *squirrel, struct NetFrame *frame,
                  unsigned seqno) {}


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

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

LLVM IR (-O0):
%struct.Squirrel = type opaque
%struct.NetFrame = type opaque
define void @tcp_ack_data(%struct.Squirrel* %0, %struct.NetFrame* %1, i32 %2) {
%4 = alloca %struct.Squirrel*
%5 = alloca %struct.NetFrame*
%6 = alloca i32
store %struct.Squirrel* %0, %struct.Squirrel** %4
store %struct.NetFrame* %1, %struct.NetFrame** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.Squirrel = type opaque
%struct.NetFrame = type opaque
define void @tcp_ack_data(%struct.Squirrel* nocapture %0, %struct.NetFrame* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *zmalloc(size_t);
char *zstrdup(const char *s) {
  size_t l = strlen(s) + 1;
  char *p = zmalloc(l);
  memcpy(p, s, l);
  return p;
}


x86 assembly (clang, -O0):
<zstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <zmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1040 <zmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @zstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @zmalloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @zstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @zmalloc(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void check(int *h, long *k) {
  *h = 5;
  *k = 6;
  printf("%d\n", *h);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x6,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
movl   $0x5,(%rdi)
movq   $0x6,(%rsi)
lea    0xedc(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @check(i32* nocapture writeonly %0, i64* nocapture writeonly %1) {
store i32 5, i32* %0
store i64 6, i64* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) { printf("Hello!\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Hello!\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
void inflateBack(void) {}


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

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

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

LLVM IR (-O2):
define void @inflateBack() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ierr_exit(char *, char *, int, char *);
void *lsd_nomem_error(char *file, int line, char *mesg) {
  ierr_exit("OUT OF MEMORY: [%s::%d] %s", file, line, mesg);
  return NULL;
}


x86 assembly (clang, -O0):
<lsd_nomem_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <ierr_exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsd_nomem_error>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
call   1030 <ierr_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"OUT OF MEMORY: [%s::%d] %s\00"
define i8* @lsd_nomem_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @ierr_exit(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret i8* null
}

LLVM IR (-O2):
@.str = [27 x i8] c"OUT OF MEMORY: [%s::%d] %s\00"
define noalias i8* @lsd_nomem_error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @ierr_exit(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret i8* null
}
/* Type definitions */
struct pmd_part {
  int dummy;
};
struct fmdriver_work {
  int dummy;
};
struct driver_pmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pmd_cmdca_lfo_ext(struct fmdriver_work *,
                                     struct driver_pmd *, struct pmd_part *);
int /*<<< orphan*/ pmd_part_lfo_flip(struct pmd_part *);
void pmd_cmdbb_lfo2_ext(struct fmdriver_work *work, struct driver_pmd *pmd,
                        struct pmd_part *part) {
  pmd_part_lfo_flip(part);
  pmd_cmdca_lfo_ext(work, pmd, part);
  pmd_part_lfo_flip(part);
}


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

x86 assembly (clang, -O2):
<pmd_cmdbb_lfo2_ext>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <pmd_part_lfo_flip@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <pmd_cmdca_lfo_ext@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <pmd_part_lfo_flip@plt>

LLVM IR (-O0):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdbb_lfo2_ext(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = alloca %struct.fmdriver_work*
%5 = alloca %struct.driver_pmd*
%6 = alloca %struct.pmd_part*
store %struct.fmdriver_work* %0, %struct.fmdriver_work** %4
store %struct.driver_pmd* %1, %struct.driver_pmd** %5
store %struct.pmd_part* %2, %struct.pmd_part** %6
%7 = load %struct.pmd_part*, %struct.pmd_part** %6
%8 = call i32 @pmd_part_lfo_flip(%struct.pmd_part* %7)
%9 = load %struct.fmdriver_work*, %struct.fmdriver_work** %4
%10 = load %struct.driver_pmd*, %struct.driver_pmd** %5
%11 = load %struct.pmd_part*, %struct.pmd_part** %6
%12 = call i32 @pmd_cmdca_lfo_ext(%struct.fmdriver_work* %9, %struct.driver_pmd* %10, %struct.pmd_part* %11)
%13 = load %struct.pmd_part*, %struct.pmd_part** %6
%14 = call i32 @pmd_part_lfo_flip(%struct.pmd_part* %13)
ret void
}

LLVM IR (-O2):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdbb_lfo2_ext(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = tail call i32 @pmd_part_lfo_flip(%struct.pmd_part* %2)
%5 = tail call i32 @pmd_cmdca_lfo_ext(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2)
%6 = tail call i32 @pmd_part_lfo_flip(%struct.pmd_part* %2)
ret void
}
void foo104() {}


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

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

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

LLVM IR (-O2):
define void @foo104() {
ret void
}
float complFtr(float output, float ang_a, float g, float dt, float a) {
  output = a * (output + g * dt) + (1 - a) * ang_a;
  return output;
}


x86 assembly (clang, -O0):
<complFtr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
mulss  %xmm3,%xmm2
addss  %xmm1,%xmm2
movss  0xebf(%rip),%xmm1
subss  -0x14(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<complFtr>:
mulss  %xmm3,%xmm2
addss  %xmm2,%xmm0
movss  0xef0(%rip),%xmm2
subss  %xmm4,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm4,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @complFtr(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %10
%12 = load float, float* %6
%13 = load float, float* %8
%14 = load float, float* %9
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float %12)
%16 = load float, float* %10
%17 = fsub float 1.000000e+00, %16
%18 = load float, float* %7
%19 = fmul float %17, %18
%20 = call float @llvm.fmuladd.f32(float %11, float %15, float %19)
store float %20, float* %6
%21 = load float, float* %6
ret float %21
}

LLVM IR (-O2):
define float @complFtr(float %0, float %1, float %2, float %3, float %4) {
%6 = tail call float @llvm.fmuladd.f32(float %2, float %3, float %0)
%7 = fsub float 1.000000e+00, %4
%8 = fmul float %7, %1
%9 = tail call float @llvm.fmuladd.f32(float %4, float %6, float %8)
ret float %9
}
int compare(int *x, int *y) { return (*x - *y); }


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

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

LLVM IR (-O0):
define i32 @compare(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 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ warnx(char *);
int basex_status(int sfd) {
  char c;
  int b = read(sfd, &c, 1);
  if (b == -1) {
    warnx("Can not retrieve status code.");
    return -1;
  }
  return c;
}


x86 assembly (clang, -O0):
<basex_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1161 <basex_status+0x41>
lea    0xeb0(%rip),%rdi
call   1030 <warnx@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <basex_status+0x48>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basex_status>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0xffffffff,%eax
je     113c <basex_status+0x1c>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1030 <warnx@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Can not retrieve status code.\00"
define i32 @basex_status(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @read(i32 %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @warnx(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %15
12: ; preds = %1
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [30 x i8] c"Can not retrieve status code.\00"
define i32 @basex_status(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @warnx(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ -1, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void print_uint16_t(uint16_t m) { fprintf(stderr, "%u", m); }


x86 assembly (clang, -O0):
<print_uint16_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uint16_t>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%u\00"
define void @print_uint16_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%u\00"
define void @print_uint16_t(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ __ESBMC_get_thread_id();
pthread_t pthread_self(void) { return __ESBMC_get_thread_id(); }


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

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

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

LLVM IR (-O2):
define i32 @pthread_self() {
%1 = tail call i32 (...) @__ESBMC_get_thread_id()
ret i32 %1
}
unsigned long long weight(unsigned long long x, unsigned long long pi) {
  unsigned long long ret = 0;
  while (x) {
    ret += x % pi;
    x /= pi;
  }
  return ret;
}


x86 assembly (clang, -O0):
<weight>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <weight+0x49>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
add    -0x18(%rbp),%rdx
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    1114 <weight+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<weight>:
xor    %ecx,%ecx
test   %rdi,%rdi
jne    1123 <weight+0x23>
mov    %rcx,%rax
ret
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
add    %rdx,%rcx
cmp    %rsi,%rdi
mov    %rax,%rdi
jb     1107 <weight+0x7>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1110 <weight+0x10>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
jmp    1118 <weight+0x18>

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

LLVM IR (-O2):
define i64 @weight(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = phi i64 [ %9, %4 ], [ %0, %2 ]
%7 = urem i64 %6, %1
%8 = add i64 %7, %5
%9 = udiv i64 %6, %1
%10 = icmp ult i64 %6, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i64 [ 0, %2 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("Hello World \n");
  printf("The max of 2 and 3 is: %i", (2 > 3) ? 2 : 3);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World \0A\00"
@.str.1 = [26 x i8] c"The max of 2 and 3 is: %i\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"The max of 2 and 3 is: %i\00"
@str = [13 x i8] c"Hello World \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int comp(const void *leftptr, const void *rightptr) {
  uint64_t left = *(const uint64_t *)leftptr;
  uint64_t right = *(const uint64_t *)rightptr;
  return (right < left) - (left < right);
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
cmp    -0x20(%rbp),%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rcx,%rdx
setl   %al
setg   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = load i64, i64* %5
%15 = icmp slt i64 %13, %14
%16 = zext i1 %15 to i32
%17 = load i64, i64* %5
%18 = load i64, i64* %6
%19 = icmp slt i64 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %6, %4
%8 = zext i1 %7 to i32
%9 = icmp slt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int strpos(const char *s, char c) {
  int x = 0;
  while (s[x] != 0) {
    if (s[x] == c)
      return x;
    x++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <strpos+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <strpos+0x4d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <strpos+0x62>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <strpos+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <strpos+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <strpos+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strpos+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strpos(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %1
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %9 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationStatusHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void StabilizationStatusLogging() {
  UAVObjLogging(StabilizationStatusHandle());
}


x86 assembly (clang, -O0):
<StabilizationStatusLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <StabilizationStatusHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationStatusLogging>:
push   %rax
xor    %eax,%eax
call   1040 <StabilizationStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @StabilizationStatusLogging() {
%1 = call i32 (...) @StabilizationStatusHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationStatusLogging() {
%1 = tail call i32 (...) @StabilizationStatusHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;

/* Variables and functions */
int countDigit(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int /*<<< orphan*/ *, int *);
int main() {
  uint64_t number;
  uint32_t wantedDigit;
  scanf("%lu %d", &number, &wantedDigit);
  printf("o digito %d aparece %d vezes no numero %lu\n", wantedDigit,
         countDigit(number, wantedDigit), number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <countDigit@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
mov    -0x8(%rbp),%ecx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    0x8(%rsp),%edi
mov    %ebx,%esi
call   1050 <countDigit@plt>
mov    0x8(%rsp),%ecx
lea    0xea2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%lu %d\00"
@.str.1 = [44 x i8] c"o digito %d aparece %d vezes no numero %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @countDigit(i32 %6, i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%lu %d\00"
@.str.1 = [44 x i8] c"o digito %d aparece %d vezes no numero %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = call i32 @countDigit(i32 %7, i32 %6)
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, size_t);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, size_t size) {
  void *ret;
  if ((ret = realloc(ptr, size)) == 0) {
    fprintf(stderr, "make: can't reallocate %p to %u bytes", ptr, size);
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1182 <xrealloc+0x52>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     114c <xrealloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"make: can't reallocate %p to %u bytes\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %12, i64 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"make: can't reallocate %p to %u bytes\00"
define noalias i8* @xrealloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
void echo_log_nothing(int priority, const char *format, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @echo_log_nothing(i32 %0, i8* nocapture %1, ...) {
ret void
}
void calli(unsigned long faddr, int a) {
  void (*func)(int);
  func = (void *)faddr;
  func(a);
}


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

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

LLVM IR (-O0):
define void @calli(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca void (i32)*
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i8*
%8 = bitcast i8* %7 to void (i32)*
store void (i32)* %8, void (i32)** %5
%9 = load void (i32)*, void (i32)** %5
%10 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @calli(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to void (i32)*
tail call void %3(i32 %1)
ret void
}
int fun1277() { return 1277; }


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

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

LLVM IR (-O0):
define i32 @fun1277() {
ret i32 1277
}

LLVM IR (-O2):
define i32 @fun1277() {
ret i32 1277
}
void XSharpFontExtentsStruct(void *fontSet, void *max_ink_return,
                             void *max_logical_return) {}


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

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

LLVM IR (-O0):
define void @XSharpFontExtentsStruct(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @XSharpFontExtentsStruct(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ readlink(char const *, char *, size_t);
ssize_t fb_lfs_readlink(const char *path, char *buf, size_t buf_size) {
  return (readlink(path, buf, buf_size));
}


x86 assembly (clang, -O0):
<fb_lfs_readlink>:
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),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <readlink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_lfs_readlink>:
jmp    1030 <readlink@plt>

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

LLVM IR (-O2):
define i32 @fb_lfs_readlink(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @readlink(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void sock_close(int skt) {
  if (skt == (-1))
    return;
  close(skt);
}


x86 assembly (clang, -O0):
<sock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    112a <sock_close+0x1a>
jmp    1132 <sock_close+0x22>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_close>:
cmp    $0xffffffff,%edi
je     111a <sock_close+0xa>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @sock_close(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
void svg_rel(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @svg_rel(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
double ft_invsqrt(float);
float ft_sqrt(float x) { return (1.0 / ft_invsqrt(x)); }


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <ft_invsqrt@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
push   %rax
call   1030 <ft_invsqrt@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ft_sqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @ft_invsqrt(float %3)
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @ft_sqrt(float %0) {
%2 = tail call double @ft_invsqrt(float %0)
%3 = fdiv double 1.000000e+00, %2
%4 = fptrunc double %3 to float
ret float %4
}
int main() {
  unsigned long t1 = -1;
  return t1 != -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
cmpq   $0xffffffffffffffff,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 -1, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lua_reportbug(char *);
void concatFB(void) {
  lua_reportbug("unexpected type at conversion to string");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"unexpected type at conversion to string\00"
define void @concatFB() {
%1 = call i32 @lua_reportbug(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"unexpected type at conversion to string\00"
define void @concatFB() {
%1 = tail call i32 @lua_reportbug(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srfft(double *, double *, int);
void srifft(double *xr, double *xi, int logm) { srfft(xi, xr, logm); }


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

x86 assembly (clang, -O2):
<srifft>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <srfft@plt>

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

LLVM IR (-O2):
define void @srifft(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @srfft(double* %1, double* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef long uint32_t;

/* Variables and functions */
long __read_png_int_raw(int /*<<< orphan*/ const *);
bool read_png_uint(const uint8_t *buf, uint32_t *out) {
  uint32_t val;
  val = __read_png_int_raw(buf);
  *out = val;
  return 0 <= val && val <= ((1L << 31) - 1);
}


x86 assembly (clang, -O0):
<read_png_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__read_png_int_raw@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x18(%rbp),%rcx
mov    %al,-0x19(%rbp)
jg     1157 <read_png_uint+0x47>
cmpq   $0x7fffffff,-0x18(%rbp)
7f
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_png_uint>:
push   %rbx
mov    %rsi,%rbx
call   1030 <__read_png_int_raw@plt>
mov    %rax,(%rbx)
xor    %ecx,%ecx
test   $0xffffffff80000000,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_png_uint(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 i32*, i32** %3
%7 = call i64 @__read_png_int_raw(i32* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i64*, i64** %4
store i64 %8, i64* %9
%10 = load i64, i64* %5
%11 = icmp sle i64 0, %10
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i64, i64* %5
%14 = icmp sle i64 %13, 2147483647
br label %15
15: ; preds = %12, %2
%16 = phi i1 [ false, %2 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @read_png_uint(i32* %0, i64* nocapture writeonly %1) {
%3 = tail call i64 @__read_png_int_raw(i32* %0)
store i64 %3, i64* %1
%4 = icmp ult i64 %3, 2147483648
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Z_SYNC_FLUSH;
int /*<<< orphan*/ gzflush(void *, int /*<<< orphan*/);
void gz_file_handler_flush(void *file) { gzflush(file, Z_SYNC_FLUSH); }


x86 assembly (clang, -O0):
<gz_file_handler_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <gzflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gz_file_handler_flush>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <gzflush@plt>

LLVM IR (-O0):
@Z_SYNC_FLUSH = global i32 0
define void @gz_file_handler_flush(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @Z_SYNC_FLUSH
%5 = call i32 @gzflush(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@Z_SYNC_FLUSH = global i32 0
define void @gz_file_handler_flush(i8* %0) {
%2 = load i32, i32* @Z_SYNC_FLUSH
%3 = tail call i32 @gzflush(i8* %0, i32 %2)
ret void
}
void wcsutil_setAli(int ncoord, int nelem, int *first) {
  int v0, *vp;
  v0 = *first;
  for (vp = first + nelem; vp < first + ncoord * nelem; vp += nelem) {
    *vp = v0;
  }
}


x86 assembly (clang, -O0):
<wcsutil_setAli>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
movslq %edx,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    116f <wcsutil_setAli+0x6f>
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    112a <wcsutil_setAli+0x2a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsutil_setAli>:
imul   %esi,%edi
cmp    %esi,%edi
jle    112a <wcsutil_setAli+0x2a>
mov    (%rdx),%eax
movslq %esi,%rcx
movslq %edi,%rsi
lea    (%rdx,%rsi,4),%rsi
lea    (%rdx,%rcx,4),%rdx
shl    $0x2,%rcx
nopl   0x0(%rax,%rax,1)
mov    %eax,(%rdx)
add    %rcx,%rdx
cmp    %rsi,%rdx
jb     1120 <wcsutil_setAli+0x20>
ret

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

LLVM IR (-O2):
define void @wcsutil_setAli(i32 %0, i32 %1, i32* %2) {
%4 = load i32, i32* %2
%5 = sext i32 %1 to i64
%6 = mul nsw i32 %1, %0
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %2, i64 %7
%9 = icmp sgt i32 %6, %1
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = getelementptr inbounds i32, i32* %2, i64 %5
br label %12
12: ; preds = %10, %12
%13 = phi i32* [ %14, %12 ], [ %11, %10 ]
store i32 %4, i32* %13
%14 = getelementptr inbounds i32, i32* %13, i64 %5
%15 = icmp ult i32* %14, %8
br i1 %15, label %12, label %16
16: ; preds = %12, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ carriage(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void carriage_return(FILE *f, int m) {
  fprintf(f, "\n");
  carriage(f, m);
}


x86 assembly (clang, -O0):
<carriage_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <carriage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carriage_return>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <carriage@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @carriage_return(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 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @carriage(i32* %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @carriage_return(i32* %0, i32 %1) {
%3 = tail call i32 @fputc(i32 10, i32* %0)
%4 = tail call i32 @carriage(i32* %0, i32 %1)
ret void
}
int pl_on_close_wr(const int label, void *handle) { return 0; }


x86 assembly (clang, -O0):
<pl_on_close_wr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pl_on_close_wr(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
void EC_GROUP_new(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_new() {
ret void
}
void gdk_gc_set_dashes() {}


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

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

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

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

/* Variables and functions */
uint32_t rotl32(uint32_t n, uint8_t bits) {
  return ((n << bits) | (n >> (32 - bits)));
}


x86 assembly (clang, -O0):
<rotl32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl32(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}