xunge/DecIR huggingface dataset:
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", getpid()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned int pm_num_pages(unsigned int mem_size, unsigned int pg_size) {
  unsigned int n = mem_size / pg_size;
  return n - n % 24;
}


x86 assembly (clang, -O0):
<pm_num_pages>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x18,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x10(%rbp),%eax
sub    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_num_pages>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    $0xaaaaaaab,%ecx
imul   %rax,%rcx
shr    $0x24,%rcx
shl    $0x3,%ecx
lea    (%rcx,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @pm_num_pages(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = udiv i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %5
%11 = urem i32 %10, 24
%12 = sub i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @pm_num_pages(i32 %0, i32 %1) {
%3 = udiv i32 %0, %1
%4 = urem i32 %3, 24
%5 = sub i32 %3, %4
ret i32 %5
}
int math_fequal(const float float1, const float float2, const float epsilon) {
  return (float1 + epsilon >= float2) && (float1 - epsilon <= float2);
}


x86 assembly (clang, -O0):
<math_fequal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
xor    %eax,%eax
ucomiss -0x8(%rbp),%xmm0
mov    %al,-0xd(%rbp)
jb     1144 <math_fequal+0x44>
movss  -0x4(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_fequal>:
movaps %xmm0,%xmm3
addss  %xmm2,%xmm3
ucomiss %xmm1,%xmm3
setae  %al
subss  %xmm2,%xmm0
ucomiss %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @math_fequal(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fadd float %7, %8
%10 = load float, float* %5
%11 = fcmp oge float %9, %10
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fsub float %13, %14
%16 = load float, float* %5
%17 = fcmp ole float %15, %16
br label %18
18: ; preds = %12, %3
%19 = phi i1 [ false, %3 ], [ %17, %12 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @math_fequal(float %0, float %1, float %2) {
%4 = fadd float %0, %2
%5 = fcmp oge float %4, %1
%6 = fsub float %0, %2
%7 = fcmp ole float %6, %1
%8 = and i1 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int sceKernelFindMemBlockByAddr(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ uvl_alloc_code_mem(unsigned int *);
int sceKernelAllocCodeMemBlock(const char *name, unsigned int length) {
  return sceKernelFindMemBlockByAddr(uvl_alloc_code_mem(&length), 0);
}


x86 assembly (clang, -O0):
<sceKernelAllocCodeMemBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <uvl_alloc_code_mem@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <sceKernelFindMemBlockByAddr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sceKernelAllocCodeMemBlock>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <uvl_alloc_code_mem@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <sceKernelFindMemBlockByAddr@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sceKernelAllocCodeMemBlock(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @uvl_alloc_code_mem(i32* %4)
%6 = call i32 @sceKernelFindMemBlockByAddr(i32 %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
define i32 @sceKernelAllocCodeMemBlock(i8* nocapture readnone %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @uvl_alloc_code_mem(i32* %3)
%5 = call i32 @sceKernelFindMemBlockByAddr(i32 %4, i32 0)
ret i32 %5
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int sendto(int, void const *, size_t, int, struct sockaddr const *,
           int /*<<< orphan*/);
int rt_sendto(int s, const void *msg, size_t len, int flags,
              const struct sockaddr *to, socklen_t tolen) {
  return sendto(s, msg, len, flags, to, tolen);
}


x86 assembly (clang, -O0):
<rt_sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <sendto@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_sendto>:
jmp    1030 <sendto@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @rt_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32, i32* %10
%17 = load %struct.sockaddr*, %struct.sockaddr** %11
%18 = load i32, i32* %12
%19 = call i32 @sendto(i32 %13, i8* %14, i64 %15, i32 %16, %struct.sockaddr* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @rt_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = tail call i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5)
ret i32 %7
}
double sign_of(double a) {
  if (a <= 0) {
    return -1;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<sign_of>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1129 <sign_of+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1136 <sign_of+0x36>
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_of>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
lea    0xeec(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @sign_of(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double -1.000000e+00, double* %2
br label %8
7: ; preds = %1
store double 1.000000e+00, double* %2
br label %8
8: ; preds = %7, %6
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @sign_of(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
%3 = select i1 %2, double 1.000000e+00, double -1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ wFree(char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasRename() {
  char *oldName, *newName;
  newName = wPopString();
  oldName = wPopString();
  rename(oldName, newName);
  wFree(oldName);
  wFree(newName);
  wPushNumber(0);
}


x86 assembly (clang, -O0):
<wBasRename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <rename@plt>
mov    -0x8(%rbp),%rdi
call   1060 <wFree@plt>
mov    -0x10(%rbp),%rdi
call   1060 <wFree@plt>
xor    %edi,%edi
call   1040 <wPushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasRename>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <rename@plt>
mov    %rbx,%rdi
call   1060 <wFree@plt>
mov    %r14,%rdi
call   1060 <wFree@plt>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <wPushNumber@plt>

LLVM IR (-O0):
define void @wBasRename() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @wPopString()
store i8* %3, i8** %2
%4 = call i8* (...) @wPopString()
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = load i8*, i8** %2
%7 = call i32 @rename(i8* %5, i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @wFree(i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @wFree(i8* %10)
%12 = call i32 @wPushNumber(i32 0)
ret void
}

LLVM IR (-O2):
define void @wBasRename() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i8* (...) @wPopString()
%3 = tail call i32 @rename(i8* %2, i8* %1)
%4 = tail call i32 @wFree(i8* %2)
%5 = tail call i32 @wFree(i8* %1)
%6 = tail call i32 @wPushNumber(i32 0)
ret void
}
void closeMem(void *pStream) {}


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

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

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

LLVM IR (-O2):
define void @closeMem(i8* nocapture %0) {
ret void
}
int rewtTimer(double t, struct SocketControl *sc) { return -1; }


x86 assembly (clang, -O0):
<rewtTimer>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.SocketControl = type opaque
define i32 @rewtTimer(double %0, %struct.SocketControl* %1) {
%3 = alloca double
%4 = alloca %struct.SocketControl*
store double %0, double* %3
store %struct.SocketControl* %1, %struct.SocketControl** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.SocketControl = type opaque
define i32 @rewtTimer(double %0, %struct.SocketControl* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ pmu_set_sleep_clk(int);
void pmu_set_sleep_radio() { pmu_set_sleep_clk(0x0F0A050F); }


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

x86 assembly (clang, -O2):
<pmu_set_sleep_radio>:
mov    $0xf0a050f,%edi
jmp    1030 <pmu_set_sleep_clk@plt>

LLVM IR (-O0):
define void @pmu_set_sleep_radio() {
%1 = call i32 @pmu_set_sleep_clk(i32 252314895)
ret void
}

LLVM IR (-O2):
define void @pmu_set_sleep_radio() {
%1 = tail call i32 @pmu_set_sleep_clk(i32 252314895)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int /*<<< orphan*/ f3();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Invoking library function from mylib library\n");
  f1();
  f2();
  f3();
  exit(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)
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <f1@plt>
mov    $0x0,%al
call   1030 <f2@plt>
mov    $0x0,%al
call   1050 <f3@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1050 <f3@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Invoking library function from mylib library\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 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @f1()
%8 = call i32 (...) @f2()
%9 = call i32 (...) @f3()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [45 x i8] c"Invoking library function from mylib library\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @f1()
%5 = tail call i32 (...) @f2()
%6 = tail call i32 (...) @f3()
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
struct dhcpmsg {
  int dummy;
};

/* Variables and functions */
size_t get_dhcp_opt(struct dhcpmsg const *const, int, int /*<<< orphan*/ *,
                    int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint32_t get_option_router(const struct dhcpmsg *const packet) {
  uint32_t ret = 0;
  uint8_t buf[500];
  const size_t ol = get_dhcp_opt(packet, 0x03, buf, sizeof buf);
  if (ol == sizeof ret)
    memcpy(&ret, buf, sizeof ret);
  return ret;
}


x86 assembly (clang, -O0):
<get_option_router>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x7e0(%rbp),%rdx
mov    $0x3,%esi
mov    $0x7d0,%ecx
call   1040 <get_dhcp_opt@plt>
mov    %rax,-0x7e8(%rbp)
cmpq   $0x4,-0x7e8(%rbp)
04
jne    117a <get_option_router+0x5a>
lea    -0x7e0(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_option_router>:
sub    $0x7e8,%rsp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdx
mov    $0x3,%esi
mov    $0x7d0,%ecx
call   1040 <get_dhcp_opt@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x4,%rcx
jne    1166 <get_option_router+0x46>
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%eax
add    $0x7e8,%rsp
ret

LLVM IR (-O0):
%struct.dhcpmsg = type { i32 }
define i32 @get_option_router(%struct.dhcpmsg* %0) {
%2 = alloca %struct.dhcpmsg*
%3 = alloca i32
%4 = alloca [500 x i32]
%5 = alloca i64
store %struct.dhcpmsg* %0, %struct.dhcpmsg** %2
store i32 0, i32* %3
%6 = load %struct.dhcpmsg*, %struct.dhcpmsg** %2
%7 = getelementptr inbounds [500 x i32], [500 x i32]* %4, i64 0, i64 0
%8 = call i64 @get_dhcp_opt(%struct.dhcpmsg* %6, i32 3, i32* %7, i32 2000)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, 4
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = getelementptr inbounds [500 x i32], [500 x i32]* %4, i64 0, i64 0
%13 = call i32 @memcpy(i32* %3, i32* %12, i32 4)
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.dhcpmsg = type { i32 }
define i32 @get_option_router(%struct.dhcpmsg* %0) {
%2 = alloca i32
%3 = alloca [500 x i32]
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast [500 x i32]* %3 to i8*
%6 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 0
%7 = call i64 @get_dhcp_opt(%struct.dhcpmsg* %0, i32 3, i32* %6, i32 2000)
%8 = icmp eq i64 %7, 4
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @memcpy(i32* %2, i32* %6, i32 4)
%11 = load i32, i32* %2
br label %12
12: ; preds = %9, %1
%13 = phi i32 [ %11, %9 ], [ 0, %1 ]
ret i32 %13
}
void EVP_MD_block_size(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_MD_block_size() {
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
char *func(char *str1, char *str2) {
  if (strlen(str1) >= strlen(str2)) {
    return str1;
  } else {
    return str2;
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jl     1153 <func+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <func+0x4b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    %rax,%r15
cmovl  %r14,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @func(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp slt i64 %3, %4
%6 = select i1 %5, i8* %1, i8* %0
ret i8* %6
}
unsigned long PSEgetLibType() { return 32; }


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

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

LLVM IR (-O0):
define i64 @PSEgetLibType() {
ret i64 32
}

LLVM IR (-O2):
define i64 @PSEgetLibType() {
ret i64 32
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello world!"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
int grid_xrespondent_ispeer(int socktype) {
  return socktype == (6 * 16 + 2) ? 1 : 0;
}


x86 assembly (clang, -O0):
<grid_xrespondent_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x62,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_xrespondent_ispeer>:
xor    %eax,%eax
cmp    $0x62,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @grid_xrespondent_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 98
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ beep();
int /*<<< orphan*/ flash();
int /*<<< orphan*/ flushinp();
void wrong_key(void) {
  flash();
  beep();
  flushinp();
}


x86 assembly (clang, -O0):
<wrong_key>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <flash@plt>
mov    $0x0,%al
call   1030 <beep@plt>
mov    $0x0,%al
call   1050 <flushinp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrong_key>:
push   %rax
xor    %eax,%eax
call   1040 <flash@plt>
xor    %eax,%eax
call   1030 <beep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <flushinp@plt>

LLVM IR (-O0):
define void @wrong_key() {
%1 = call i32 (...) @flash()
%2 = call i32 (...) @beep()
%3 = call i32 (...) @flushinp()
ret void
}

LLVM IR (-O2):
define void @wrong_key() {
%1 = tail call i32 (...) @flash()
%2 = tail call i32 (...) @beep()
%3 = tail call i32 (...) @flushinp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int *malloc(int);
int *create_peer_key(int id) {
  int *i = malloc(sizeof(int));
  assert(i != NULL);
  *i = id;
  return i;
}


x86 assembly (clang, -O0):
<create_peer_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_peer_key>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %ebp,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @create_peer_key(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %2
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
ret i32* %11
}

LLVM IR (-O2):
define noalias i32* @create_peer_key(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
store i32 %0, i32* %2
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x1b() {
  Assert_real((isalpha(27) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              140, ("isalpha should be 0 for 0x1b"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x1b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x8c,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x1b>:
push   %rax
mov    $0x1b,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x8c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x1b\00"
define void @t_isalpha_0x1b() {
%1 = call i64 @isalpha(i32 27)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x1b\00"
define void @t_isalpha_0x1b() {
%1 = tail call i64 @isalpha(i32 27)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void INT_TM06(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sdsnansumpw(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  float v = stdlib_strided_sdsnansumpw(N, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1050 <stdlib_strided_sdsnansumpw@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_sdsnansumpw@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sdsnansumpw(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sdsnansumpw(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void EMACTimestampPPSCommand(uint32_t ui32Base, uint8_t ui8Cmd) {
  ;
  while ((*((volatile uint32_t *)(ui32Base + 0x0000072C))) & 0x0000000F) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x0000072C))) = (0x00000010 | ui8Cmd);
}


x86 assembly (clang, -O0):
<EMACTimestampPPSCommand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x72c,%eax
cltq
mov    (%rax),%eax
and    $0xf,%eax
cmp    $0x0,%eax
je     1127 <EMACTimestampPPSCommand+0x27>
jmp    110a <EMACTimestampPPSCommand+0xa>
mov    -0x8(%rbp),%ecx
or     $0x10,%ecx
mov    -0x4(%rbp),%eax
add    $0x72c,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTimestampPPSCommand>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0xf,0x72c(%rax)
jne    1110 <EMACTimestampPPSCommand+0x10>
or     $0x10,%esi
mov    %esi,0x72c(%rax)
ret

LLVM IR (-O0):
define void @EMACTimestampPPSCommand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %13, %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1836
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 15
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i32, i32* %4
%16 = or i32 16, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1836
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %16, i32* %20
ret void
}

LLVM IR (-O2):
define void @EMACTimestampPPSCommand(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1836
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
br label %6
6: ; preds = %6, %2
%7 = load volatile i32, i32* %5
%8 = and i32 %7, 15
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6
%11 = or i32 %1, 16
store volatile i32 %11, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printchar(char c) { printf("%c", c); }


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printchar(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RemoveAllTriggers();
int /*<<< orphan*/ RemoveAllWatches();
void FreeTriggersAndWatches(void) {
  RemoveAllTriggers();
  RemoveAllWatches();
}


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

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

LLVM IR (-O0):
define void @FreeTriggersAndWatches() {
%1 = call i32 (...) @RemoveAllTriggers()
%2 = call i32 (...) @RemoveAllWatches()
ret void
}

LLVM IR (-O2):
define void @FreeTriggersAndWatches() {
%1 = tail call i32 (...) @RemoveAllTriggers()
%2 = tail call i32 (...) @RemoveAllWatches()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc_unlocked(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdout;
int putchar_unlocked(int c) {
  FILE *so = stdout;
  return (putc_unlocked(c, so));
}


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

x86 assembly (clang, -O2):
<putchar_unlocked>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%rsi
jmp    1030 <putc_unlocked@plt>

LLVM IR (-O0):
@stdout = global i32* null
define i32 @putchar_unlocked(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32*, i32** @stdout
store i32* %4, i32** %3
%5 = load i32, i32* %2
%6 = load i32*, i32** %3
%7 = call i32 @putc_unlocked(i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@stdout = global i32* null
define i32 @putchar_unlocked(i32 %0) {
%2 = load i32*, i32** @stdout
%3 = tail call i32 @putc_unlocked(i32 %0, i32* %2)
ret i32 %3
}
int fixed_to_i_trunc(long int val, int precision) { return val >> precision; }


x86 assembly (clang, -O0):
<fixed_to_i_trunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_to_i_trunc>:
mov    %esi,%ecx
mov    %rdi,%rax
sar    %cl,%rax
ret

LLVM IR (-O0):
define i32 @fixed_to_i_trunc(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = ashr i64 %5, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @fixed_to_i_trunc(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = ashr i64 %0, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ calc_dispersion(double *, int /*<<< orphan*/);
double sqrt(int /*<<< orphan*/);
double calc_standard_error(double data[], uint32_t element_num) {
  double value = sqrt(calc_dispersion(data, element_num));
  return value;
}


x86 assembly (clang, -O0):
<calc_standard_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <calc_dispersion@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_standard_error>:
push   %rax
call   1030 <calc_dispersion@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @calc_standard_error(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load double*, double** %3
%7 = load i32, i32* %4
%8 = call i32 @calc_dispersion(double* %6, i32 %7)
%9 = call double @sqrt(i32 %8)
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @calc_standard_error(double* %0, i32 %1) {
%3 = tail call i32 @calc_dispersion(double* %0, i32 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
int test4(int *a, int b) {
  a = __builtin_assume_aligned(a, 32, b);
  return a[0];
}


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

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

LLVM IR (-O0):
define i32 @test4(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 = bitcast i32* %5 to i8*
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = bitcast i8* %6 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @test4(i32* %0, i32 %1) {
%3 = bitcast i32* %0 to i8*
%4 = sext i32 %1 to i64
%5 = load i32, i32* %0
ret i32 %5
}
void free(void *mem_handle) { return; }


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

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

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

LLVM IR (-O2):
define void @free(i8* nocapture %0) {
ret void
}
float Sleef_fdimf(float x, float y) { return __builtin_fdimf(x, y); }


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

x86 assembly (clang, -O2):
<Sleef_fdimf>:
jmp    1030 <fdimf@plt>

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

LLVM IR (-O2):
define float @Sleef_fdimf(float %0, float %1) {
%3 = tail call float @fdimf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int anagramma(unsigned char *, unsigned char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, unsigned char *);
int main(void) {
  unsigned char a[1000];
  unsigned char b[1000];
  scanf("%s", a);
  scanf("%s", b);
  printf("%d", anagramma(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x7e0(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1030 <anagramma@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
lea    0xebd(%rip),%r15
lea    0x3f0(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <anagramma@plt>
lea    0xe8d(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @anagramma(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
void walt_inc_cfs_cumulative_runnable_avg(struct cfs_rq *rq,
                                          struct task_struct *p) {}


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

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

LLVM IR (-O0):
%struct.cfs_rq = type opaque
%struct.task_struct = type opaque
define void @walt_inc_cfs_cumulative_runnable_avg(%struct.cfs_rq* %0, %struct.task_struct* %1) {
%3 = alloca %struct.cfs_rq*
%4 = alloca %struct.task_struct*
store %struct.cfs_rq* %0, %struct.cfs_rq** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.cfs_rq = type opaque
%struct.task_struct = type opaque
define void @walt_inc_cfs_cumulative_runnable_avg(%struct.cfs_rq* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
int length(cp)
char *cp;
{
  register char *p = cp;
  while (*p++)
    ;
  return p - cp - 1;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <length+0x2d>
jmp    1110 <length+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length+0x10>
ret

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

LLVM IR (-O2):
define i32 @length(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
void mcdis_magnify(char *what) {}


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

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

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

LLVM IR (-O2):
define void @mcdis_magnify(i8* nocapture %0) {
ret void
}
int nvMod(int n, int d) {
  int m = n % d;
  return (((m < 0) && (d > 0)) || ((m > 0) && (d < 0))) ? (m + d) : m;
}


x86 assembly (clang, -O0):
<nvMod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1128 <nvMod+0x28>
cmpl   $0x0,-0x8(%rbp)
jg     113c <nvMod+0x3c>
cmpl   $0x0,-0xc(%rbp)
jle    114a <nvMod+0x4a>
cmpl   $0x0,-0x8(%rbp)
jge    114a <nvMod+0x4a>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1150 <nvMod+0x50>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvMod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
test   %esi,%esi
jle    110f <nvMod+0xf>
test   %eax,%eax
js     1117 <nvMod+0x17>
test   %esi,%esi
jns    1119 <nvMod+0x19>
test   %eax,%eax
jle    1119 <nvMod+0x19>
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @nvMod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = icmp sgt i32 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = icmp sgt i32 %3, 0
%9 = icmp slt i32 %1, 0
%10 = and i1 %9, %8
br i1 %10, label %11, label %13
11: ; preds = %7, %2
%12 = add nsw i32 %3, %1
br label %13
13: ; preds = %7, %11
%14 = phi i32 [ %12, %11 ], [ %3, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  char *s = (char *)malloc(10);
  printf(s);
  free(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) %2)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ t(int);
main() {
  t(5);
  t(5);
  t(5);
  t(5);
  t(5);
  t(5);
  t(5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
mov    $0x5,%edi
call   1030 <t@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @t(i32 5)
%2 = call i32 @t(i32 5)
%3 = call i32 @t(i32 5)
%4 = call i32 @t(i32 5)
%5 = call i32 @t(i32 5)
%6 = call i32 @t(i32 5)
%7 = call i32 @t(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @t(i32 5)
%2 = tail call i32 @t(i32 5)
%3 = tail call i32 @t(i32 5)
%4 = tail call i32 @t(i32 5)
%5 = tail call i32 @t(i32 5)
%6 = tail call i32 @t(i32 5)
%7 = tail call i32 @t(i32 5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void print_key(const uint8_t *key) {
  int i;
  ("Key: ");
  for (i = 0; i < 8; i++) {
    ("%02X ", key[i]);
  }
  ("\n");
}


x86 assembly (clang, -O0):
<print_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1127 <print_key+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <print_key+0xf>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Key: \00"
@.str.1 = [6 x i8] c"%02X \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_key(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @print_key(i32* nocapture %0) {
ret void
}