xunge/DecIR huggingface dataset:
unsigned char bitreverse(unsigned char c) {
  int i;
  unsigned char r = 0;
  for (i = 0; i < 8; i++) {
    r <<= 1;
    if (c & 1)
      r |= 1;
    c >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<bitreverse>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    115b <bitreverse+0x5b>
movzbl -0x9(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x9(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1143 <bitreverse+0x43>
movzbl -0x9(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x9(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <bitreverse+0x15>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitreverse>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @bitreverse(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %4
store i32 0, i32* %3
br label %5
5: ; preds = %27, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %30
8: ; preds = %5
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = and i32 %14, 1
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %19, 1
%21 = trunc i32 %20 to i8
store i8 %21, i8* %4
br label %22
22: ; preds = %17, %8
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 1
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
br label %27
27: ; preds = %22
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %5
30: ; preds = %5
%31 = load i8, i8* %4
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @bitreverse(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ puthex(int);
void puthex_l(int c) {
  puthex((c >> 16) & 0xFFFFU);
  puthex(c & 0xFFFFU);
}


x86 assembly (clang, -O0):
<puthex_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
and    $0xffff,%edi
call   1030 <puthex@plt>
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
call   1030 <puthex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puthex_l>:
push   %rbx
mov    %edi,%ebx
shr    $0x10,%edi
call   1030 <puthex@plt>
movzwl %bx,%edi
pop    %rbx
jmp    1030 <puthex@plt>

LLVM IR (-O0):
define void @puthex_l(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = and i32 %4, 65535
%6 = call i32 @puthex(i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 65535
%9 = call i32 @puthex(i32 %8)
ret void
}

LLVM IR (-O2):
define void @puthex_l(i32 %0) {
%2 = lshr i32 %0, 16
%3 = tail call i32 @puthex(i32 %2)
%4 = and i32 %0, 65535
%5 = tail call i32 @puthex(i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void *sagetv_malloc1(int size) {
  char *p;
  p = (char *)malloc(size);
  if (p)
    memset(p, 0, size);
  return (void *)p;
}


x86 assembly (clang, -O0):
<sagetv_malloc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <sagetv_malloc1+0x30>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sagetv_malloc1>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <sagetv_malloc1+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @sagetv_malloc1(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i32, i32* %2
%12 = call i32 @memset(i8* %10, i32 0, i32 %11)
br label %13
13: ; preds = %9, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @sagetv_malloc1(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @memset(i8* %3, i32 0, i32 %0)
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _bad_return_address(int);
void bad_return_bad_location(void) { _bad_return_address(0x87654320); }


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

x86 assembly (clang, -O2):
<bad_return_bad_location>:
mov    $0x87654320,%edi
jmp    1030 <_bad_return_address@plt>

LLVM IR (-O0):
define void @bad_return_bad_location() {
%1 = call i32 @_bad_return_address(i32 -2023406816)
ret void
}

LLVM IR (-O2):
define void @bad_return_bad_location() {
%1 = tail call i32 @_bad_return_address(i32 -2023406816)
ret void
}
void I2CMasterIntRawStatusClearEx(unsigned int baseAdd, unsigned int intFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x24)))) = intFlag;
}


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

x86 assembly (clang, -O2):
<I2CMasterIntRawStatusClearEx>:
add    $0x24,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterIntRawStatusClearEx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 36
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntRawStatusClearEx(i32 %0, i32 %1) {
%3 = add i32 %0, 36
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
int test_imm_ECuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xEC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ECuint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0xec,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_ECuint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 236
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_ECuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1013612281856
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int open(char const *, int, int);
int File_Open(const char *FileName) {
  int fd;
  fd = open(FileName, O_RDWR | O_CREAT, 0664);
  if (fd == -1)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<File_Open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
or     (%rax),%esi
mov    $0x1b4,%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1155 <File_Open+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <File_Open+0x4b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_Open>:
mov    0x2ec9(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1b4,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @File_Open(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = call i32 @open(i8* %5, i32 %8, i32 436)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %15
13: ; preds = %1
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @File_Open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4, i32 436)
ret i32 %5
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ _tolower(int);
int getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int main() {
  int c;
  while ((c = getchar()) != EOF)
    putchar(_tolower(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     116c <main+0x3c>
mov    -0x8(%rbp),%edi
call   1050 <_tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%eax
je     1169 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1050 <_tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @_tolower(i32 %5)
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float const, float const, float const);
void mlVectorPrint(const float *a) {
  printf("(%f, %f, %f)\n", a[0], a[1], a[2]);
}


x86 assembly (clang, -O0):
<mlVectorPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlVectorPrint>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  0x8(%rdi),%xmm2
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"(%f, %f, %f)\0A\00"
define void @mlVectorPrint(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float %2, float %4, float %6)
ret void
}
double signum(double z) {
  if (z < 0.0)
    return (-1.0);
  if (z > 0.0)
    return (1.0);
  return (0.0);
}


x86 assembly (clang, -O0):
<signum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1129 <signum+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <signum+0x55>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <signum+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <signum+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm3,%xmm1
movsd  0xeda(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @signum(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double 0.000000e+00
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ format_initial_capital(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, int);
void annual_hydroperiod_get_report_title(char *title, char *report_title,
                                         int begin_year, int end_year) {
  sprintf(title, "%s from %d to %d", report_title, begin_year, end_year);
  format_initial_capital(title, title);
}


x86 assembly (clang, -O0):
<annual_hydroperiod_get_report_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xeb4(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <format_initial_capital@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<annual_hydroperiod_get_report_title>:
push   %rbx
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xecd(%rip),%rsi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <format_initial_capital@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s from %d to %d\00"
define void @annual_hydroperiod_get_report_title(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i32 %12)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %5
%16 = call i32 @format_initial_capital(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s from %d to %d\00"
define void @annual_hydroperiod_get_report_title(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i32 %3)
%6 = tail call i32 @format_initial_capital(i8* %0, i8* %0)
ret void
}
long long bit52() { return 0x0010000000000000LL; }


x86 assembly (clang, -O0):
<bit52>:
push   %rbp
mov    %rsp,%rbp
movabs $0x10000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit52>:
movabs $0x10000000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit52() {
ret i64 4503599627370496
}

LLVM IR (-O2):
define i64 @bit52() {
ret i64 4503599627370496
}
/* Variables and functions */
int sendAll(int, unsigned char *, unsigned int);
unsigned int strlen(char const *);
int sendMsg(int fd, const char *buf, int nullflag) {
  unsigned int len = strlen(buf);
  return sendAll(fd, (unsigned char *)buf, nullflag ? (len + 1) : len);
}


x86 assembly (clang, -O0):
<sendMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1164 <sendMsg+0x44>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    116a <sendMsg+0x4a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%edx
call   1040 <sendAll@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendMsg>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0x1,%ebp
sbb    $0xffffffff,%eax
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sendAll@plt>

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

LLVM IR (-O2):
define i32 @sendMsg(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp ne i32 %2, 0
%6 = zext i1 %5 to i32
%7 = add i32 %4, %6
%8 = tail call i32 @sendAll(i32 %0, i8* %1, i32 %7)
ret i32 %8
}
void CONF_dump_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @CONF_dump_bio() {
ret void
}
/* Variables and functions */
int fieldncmp(char *, char *);
int /*<<< orphan*/ substring(char *, char *);
int ncmp(char *a, char *b) {
  char a1[100];
  char b1[100];
  substring(a, a1);
  substring(b, b1);
  return fieldncmp(a1, b1);
}


x86 assembly (clang, -O0):
<ncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <substring@plt>
mov    -0x10(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1030 <substring@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1040 <fieldncmp@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncmp>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
mov    %rsi,%rbx
lea    0x70(%rsp),%r14
mov    %r14,%rsi
call   1030 <substring@plt>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <substring@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <fieldncmp@plt>
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ncmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = call i32 @substring(i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%12 = call i32 @substring(i8* %10, i8* %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%15 = call i32 @fieldncmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @ncmp(i8* %0, i8* %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = call i32 @substring(i8* %0, i8* %5)
%8 = call i32 @substring(i8* %1, i8* %6)
%9 = call i32 @fieldncmp(i8* %5, i8* %6)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ frexp(double, int *);
unsigned int floorPow2(unsigned int x) {
  int exp;
  frexp((double)x, &exp);
  return 1 << (exp - 1);
}


x86 assembly (clang, -O0):
<floorPow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
lea    -0x8(%rbp),%rdi
call   1030 <frexp@plt>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floorPow2>:
push   %rax
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
lea    0x4(%rsp),%rdi
call   1030 <frexp@plt>
mov    0x4(%rsp),%cl
add    $0xff,%cl
mov    $0x1,%eax
shl    %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @floorPow2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = uitofp i32 %4 to double
%6 = call i32 @frexp(double %5, i32* %3)
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @floorPow2(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = uitofp i32 %0 to double
%5 = call i32 @frexp(double %4, i32* %2)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
%8 = shl nuw i32 1, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ sendto(int, void const *, size_t, int, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
ssize_t send(int socket, const void *buffer, size_t length, int flags) {
  return sendto(socket, buffer, length, flags, NULL, 0);
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <sendto@plt>

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

LLVM IR (-O2):
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, i32* null, i32 0)
ret i32 %5
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, long);
long shim_ssetmask(long newmask) { return (long)shim_enosys(0, newmask); }


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

x86 assembly (clang, -O2):
<shim_ssetmask>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i64 @shim_ssetmask(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @shim_enosys(i32 0, i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @shim_ssetmask(i64 %0) {
%2 = tail call i64 @shim_enosys(i32 0, i64 %0)
ret i64 %2
}
/* Variables and functions */
int sync();
main(int argc, const char *argv[]) { return sync(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <sync@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @sync()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sync()
ret i32 %3
}
void eglChooseConfig(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglChooseConfig() {
ret void
}
int prn_lprintf(char *buffer) {
  bwx_DEBUG(__FUNCTION__);
  while (*buffer != '\0') {
    bwx_LPRINT(*buffer);
    buffer++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<prn_lprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <prn_lprintf+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1040 <bwx_LPRINT@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    113a <prn_lprintf+0x1a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prn_lprintf>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <bwx_DEBUG@plt>
mov    (%rbx),%al
test   %al,%al
je     1155 <prn_lprintf+0x35>
add    $0x1,%rbx
nopl   0x0(%rax)
movsbl %al,%edi
xor    %eax,%eax
call   1040 <bwx_LPRINT@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <prn_lprintf+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__FUNCTION__.prn_lprintf = [12 x i8] c"prn_lprintf\00"
define i32 @prn_lprintf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.prn_lprintf, i64 0, i64 0))
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @bwx_LPRINT to i32 (i32, ...)*)(i32 %12)
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@__FUNCTION__.prn_lprintf = [12 x i8] c"prn_lprintf\00"
define i32 @prn_lprintf(i8* nocapture %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.prn_lprintf, i64 0, i64 0))
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %11, %5 ], [ %3, %1 ]
%7 = phi i8* [ %10, %5 ], [ %0, %1 ]
%8 = sext i8 %6 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @bwx_LPRINT to i32 (i32, ...)*)(i32 %8)
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
ret i32 0
}
void gtk_text_buffer_get_insert() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_get_insert() {
ret void
}
int plus3(int a) { return a + 3; }


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

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

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

LLVM IR (-O2):
define i32 @plus3(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void swap(uint8_t *i, uint8_t *j) {
  uint8_t temp;
  temp = *i;
  *i = *j;
  *j = temp;
}


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

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

LLVM IR (-O0):
define void @swap(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aligned_free(int *);
int *aligned_malloc(int, int);
int /*<<< orphan*/ printf(char *, char *, int *);
int main(int argc, char *argv[]) {
  char **endptr;
  int *p = aligned_malloc(10, 4);
  printf("%s: %p\n", argv[1], p);
  aligned_free(p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    $0xa,%edi
mov    $0x4,%esi
call   1050 <aligned_malloc@plt>
mov    %rax,%rbx
mov    0x8(%r14),%rsi
lea    0xeac(%rip),%rdi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <aligned_free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* @aligned_malloc(i32 10, i32 4)
store i32* %8, i32** %7
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i32*, i32** %7
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %11, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @aligned_free(i32* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %p\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32* @aligned_malloc(i32 10, i32 4)
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, i32* %3)
%7 = tail call i32 @aligned_free(i32* %3)
ret i32 0
}
int convert0To5Rec(int num) {
  if (num == 0)
    return 0;
  int digit = num % 10;
  if (digit == 0)
    digit = 5;
  return convert0To5Rec(num / 10) * 10 + digit;
}


x86 assembly (clang, -O0):
<convert0To5Rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <convert0To5Rec+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116b <convert0To5Rec+0x5b>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1150 <convert0To5Rec+0x40>
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <convert0To5Rec@plt>
imul   $0xa,%eax,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert0To5Rec>:
test   %edi,%edi
je     114b <convert0To5Rec+0x3b>
push   %rbx
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%edi
mov    $0x5,%ebx
cmovne %edi,%ebx
mov    %eax,%edi
call   1030 <convert0To5Rec@plt>
lea    (%rax,%rax,4),%eax
lea    (%rbx,%rax,2),%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @convert0To5Rec(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %12, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = srem i32 %0, 10
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 5, i32 %6
%9 = sdiv i32 %0, 10
%10 = tail call i32 @convert0To5Rec(i32 %9)
%11 = mul nsw i32 %10, 10
%12 = add nsw i32 %11, %8
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_string(int, char const *);
void print_crit(const char *str) { __console_tx_string(2, str); }


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

x86 assembly (clang, -O2):
<print_crit>:
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <__console_tx_string@plt>

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

LLVM IR (-O2):
define void @print_crit(i8* %0) {
%2 = tail call i32 @__console_tx_string(i32 2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
char *strerror(int /*<<< orphan*/);
void unix_error(char *msg) {
  printf("LINUX ERROR: %s: %s\n", msg, strerror(errno));
  exit(0);
}


x86 assembly (clang, -O0):
<unix_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unix_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"LINUX ERROR: %s: %s\0A\00"
@errno = global i32 0
define void @unix_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"LINUX ERROR: %s: %s\0A\00"
@errno = global i32 0
define void @unix_error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double strtod(char const *, char **);
double atof(const char *str) { return strtod(str, (char **)0); }


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

x86 assembly (clang, -O2):
<atof>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @atof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @strtod(i8* %3, i8** null)
ret double %4
}

LLVM IR (-O2):
define double @atof(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i8** null)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printnum(int);
int g(int a, int b) {
  printnum(b);
  return b;
}


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

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
call   1030 <printnum@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 returned %1) {
%3 = tail call i32 @printnum(i32 %1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ kfork();
int do_kfork() { kfork(); }


x86 assembly (clang, -O0):
<do_kfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <kfork@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_kfork() {
%1 = alloca i32
%2 = call i32 (...) @kfork()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @do_kfork() {
%1 = tail call i32 (...) @kfork()
ret i32 undef
}
void caller_1_1_2_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_2_2_1_1_1() {
ret void
}
void g_option_context_get_help_enabled() {}


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

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

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

LLVM IR (-O2):
define void @g_option_context_get_help_enabled() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
float clamp_f(float x, float min, float max) {
  assert(min < max);
  if (x < min) {
    return min;
  } else if (x > max) {
    return max;
  } else {
    return x;
  }
}


x86 assembly (clang, -O0):
<clamp_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1163 <clamp_f+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118b <clamp_f+0x7b>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1181 <clamp_f+0x71>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118b <clamp_f+0x7b>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_f>:
sub    $0x38,%rsp
movaps %xmm2,(%rsp)
movaps %xmm1,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
xor    %edi,%edi
ucomiss %xmm1,%xmm2
seta   %dil
call   1030 <assert@plt>
movaps 0x20(%rsp),%xmm1
movaps (%rsp),%xmm2
minss  %xmm1,%xmm2
movaps 0x10(%rsp),%xmm3
cmpltss %xmm3,%xmm1
movaps %xmm1,%xmm0
andnps %xmm2,%xmm0
andps  %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define float @clamp_f(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %6
%9 = load float, float* %7
%10 = fcmp olt float %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = load float, float* %6
store float %17, float* %4
br label %26
18: ; preds = %3
%19 = load float, float* %5
%20 = load float, float* %7
%21 = fcmp ogt float %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load float, float* %7
store float %23, float* %4
br label %26
24: ; preds = %18
%25 = load float, float* %5
store float %25, float* %4
br label %26
26: ; preds = %24, %22, %16
%27 = load float, float* %4
ret float %27
}

LLVM IR (-O2):
define float @clamp_f(float %0, float %1, float %2) {
%4 = fcmp olt float %1, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fcmp olt float %0, %1
%8 = fcmp ogt float %0, %2
%9 = select i1 %8, float %2, float %0
%10 = select i1 %7, float %1, float %9
ret float %10
}
char DOS_convert_path_char(char byte) {
  if (byte == '/')
    return '\\';
  if (byte == '\\')
    return '/';
  return byte;
}


x86 assembly (clang, -O0):
<DOS_convert_path_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x2f,%eax
jne    1120 <DOS_convert_path_char+0x20>
movb   $0x5c,-0x1(%rbp)
jmp    113c <DOS_convert_path_char+0x3c>
movsbl -0x2(%rbp),%eax
cmp    $0x5c,%eax
jne    1136 <DOS_convert_path_char+0x36>
movb   $0x2f,-0x1(%rbp)
jmp    113c <DOS_convert_path_char+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DOS_convert_path_char>:
mov    %edi,%eax
cmp    $0x2f,%al
je     110d <DOS_convert_path_char+0xd>
cmp    $0x5c,%al
jne    110c <DOS_convert_path_char+0xc>
mov    $0x2f,%al
ret
mov    $0x5c,%al
ret

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

LLVM IR (-O2):
define signext i8 @DOS_convert_path_char(i8 signext %0) {
switch i8 %0, label %3 [
i8 47, label %4
i8 92, label %2
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %3, %2
%5 = phi i8 [ 47, %2 ], [ %0, %3 ], [ 92, %1 ]
ret i8 %5
}
void dev_pm_clear_wake_irq(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @dev_pm_clear_wake_irq(%struct.device* nocapture %0) {
ret void
}
void anc_max14744_force_charge(int disable) { return; }


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

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

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

LLVM IR (-O2):
define void @anc_max14744_force_charge(i32 %0) {
ret void
}
int security_task_setscheduler(struct task_struct *p, int policy,
                               struct sched_param *lp) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
%struct.sched_param = type opaque
define i32 @security_task_setscheduler(%struct.task_struct* nocapture readnone %0, i32 %1, %struct.sched_param* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_uvector(unsigned int *v, unsigned int nl, unsigned int nh) {
  free((void *)(v + nl));
}


x86 assembly (clang, -O0):
<free_uvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_uvector>:
mov    %esi,%eax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_uvector(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = bitcast i32* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_uvector(i32* nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}