xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t binary_str_to_64_integer(char *binary_string) {
  char *start = &binary_string[0];
  uint64_t total = 0;
  while (*start) {
    total <<= 1;
    if (*start++ == '1')
      total ^= 1;
  }
  return total;
}


x86 assembly (clang, -O0):
<binary_str_to_64_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <binary_str_to_64_integer+0x56>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    1151 <binary_str_to_64_integer+0x51>
mov    -0x14(%rbp),%eax
xor    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <binary_str_to_64_integer+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_str_to_64_integer>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <binary_str_to_64_integer+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x31,%cl
sete   %dl
lea    (%rdx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <binary_str_to_64_integer+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @binary_str_to_64_integer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8* %6, i8** %3
store i32 0, i32* %4
br label %7
7: ; preds = %22, %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i32, i32* %4
%13 = shl i32 %12, 1
store i32 %13, i32* %4
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 49
br i1 %18, label %19, label %22
19: ; preds = %11
%20 = load i32, i32* %4
%21 = xor i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %19, %11
br label %7
23: ; preds = %7
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @binary_str_to_64_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = icmp eq i8 %5, 49
%11 = zext i1 %10 to i32
%12 = or i32 %8, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
/* Variables and functions */
double pow(double, double);
double getNextRadius(double r, double additionalVolume) {
  double currentVolume = r * r * r * 3.141592653589793 * 4.0 / 3.0;
  double nextVolume = currentVolume + additionalVolume;
  double nextRadiusCubed = nextVolume * 3.0 / (4.0 * 3.141592653589793);
  double nextRadius = pow(nextRadiusCubed, 1.0 / 3.0);
  return nextRadius;
}


x86 assembly (clang, -O0):
<getNextRadius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe9f(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe8a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe6c(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextRadius>:
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xedc(%rip),%xmm0
mulsd  0xedc(%rip),%xmm0
movsd  0xedc(%rip),%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
divsd  0xed0(%rip),%xmm0
movsd  0xed0(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @getNextRadius(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
store double %1, double* %4
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = load double, double* %3
%13 = fmul double %11, %12
%14 = fmul double %13, 0x400921FB54442D18
%15 = fmul double %14, 4.000000e+00
%16 = fdiv double %15, 3.000000e+00
store double %16, double* %5
%17 = load double, double* %5
%18 = load double, double* %4
%19 = fadd double %17, %18
store double %19, double* %6
%20 = load double, double* %6
%21 = fmul double %20, 3.000000e+00
%22 = fdiv double %21, 0x402921FB54442D18
store double %22, double* %7
%23 = load double, double* %7
%24 = call double @pow(double %23, double 0x3FD5555555555555)
store double %24, double* %8
%25 = load double, double* %8
ret double %25
}

LLVM IR (-O2):
define double @getNextRadius(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fmul double %3, %0
%5 = fmul double %4, 0x400921FB54442D18
%6 = fmul double %5, 4.000000e+00
%7 = fdiv double %6, 3.000000e+00
%8 = fadd double %7, %1
%9 = fmul double %8, 3.000000e+00
%10 = fdiv double %9, 0x402921FB54442D18
%11 = tail call double @pow(double %10, double 0x3FD5555555555555)
ret double %11
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_i_N(int32_t number) { printf("%d\n", number); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_i_N(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void clear_bit(uint8_t *x, int bit_num) { *x &= ~(1 << bit_num); }


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @clear_bit(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 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = and i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @clear_bit(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load i32, i32* %0
%6 = and i32 %5, %4
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int create_file_descriptor(char *filename) {
  int file = 0;
  if ((file = open(filename, O_RDWR)) < -1)
    return 1;
  return file;
}


x86 assembly (clang, -O0):
<create_file_descriptor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jge    114d <create_file_descriptor+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1153 <create_file_descriptor+0x43>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_file_descriptor>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
cmp    $0xffffffff,%eax
mov    $0x1,%ecx
cmovl  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @create_file_descriptor(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, -1
%5 = select i1 %4, i32 1, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putsSPI2(int, unsigned int *);
void write_latch(unsigned int len) {
  unsigned int txData[3];
  len = (len + 31) / 32;
  txData[0] = 0x0;
  len = 2;
  while (len > 0) {
    putsSPI2(1, txData);
    len--;
  }
}


x86 assembly (clang, -O0):
<write_latch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f,%eax
shr    $0x5,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    115b <write_latch+0x4b>
lea    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <putsSPI2@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <write_latch+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_latch>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <putsSPI2@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <putsSPI2@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @write_latch(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 31
%6 = udiv i32 %5, 32
store i32 %6, i32* %2
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 0, i32* %7
store i32 2, i32* %2
br label %8
8: ; preds = %11, %1
%9 = load i32, i32* %2
%10 = icmp ugt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%13 = call i32 @putsSPI2(i32 1, i32* %12)
%14 = load i32, i32* %2
%15 = add i32 %14, -1
store i32 %15, i32* %2
br label %8
16: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @write_latch(i32 %0) {
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 0, i32* %4
%5 = call i32 @putsSPI2(i32 1, i32* %4)
%6 = call i32 @putsSPI2(i32 1, i32* %4)
ret void
}
R0A1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (r0 <= (*((unsigned int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
ja     1134 <R0A1+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <R0A1+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0A1>:
xor    %eax,%eax
cmp    %edi,0xa98ac7
setae  %al
ret

LLVM IR (-O0):
define i32 @R0A1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %8
%15 = load i32, i32* inttoptr (i64 11111111 to i32*)
%16 = icmp ule i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %7
br label %19
18: ; preds = %6
store i32 0, i32* %7
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @R0A1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = load i32, i32* inttoptr (i64 11111111 to i32*)
%8 = icmp uge i32 %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int errno;
int mknod(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ os_makedev(unsigned int, unsigned int);
int do_mknod(const char *file, int mode, unsigned int major,
             unsigned int minor) {
  int err;
  err = mknod(file, mode, os_makedev(major, minor));
  if (err)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<do_mknod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <os_makedev@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    %eax,%edx
call   1040 <mknod@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     117c <do_mknod+0x5c>
xor    %eax,%eax
mov    0x2e6e(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <do_mknod+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mknod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,%edi
mov    %ecx,%esi
call   1030 <os_makedev@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <mknod@plt>
mov    0x2e9c(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovne %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @do_mknod(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @os_makedev(i32 %2, i32 %3)
%6 = tail call i32 @mknod(i8* %0, i32 %1, i32 %5)
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_info(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/org_fix.c",
            386, "[ INFO ] at %s:%d ,info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/org_fix.c",
            386, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x182,%r8d
lea    0xf66(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_info>:
mov    %rdi,%r9
lea    0xf80(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x182,%esi
mov    $0x182,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/org_fix.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 386, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 386, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/org_fix.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 386, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 386, i8* %0)
ret void
}
void set_bit(unsigned char *b, unsigned int off) { b[0] |= (1 << off); }


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %al,(%rdi)
ret

LLVM IR (-O0):
define void @set_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = or i32 %10, %6
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
ret void
}

LLVM IR (-O2):
define void @set_bit(i8* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i8, i8* %0
%5 = trunc i32 %3 to i8
%6 = or i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ PWM_ClearSharedMemory();
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void System_Shutdown(void) {
  PWM_ClearSharedMemory();
  syslog(LOG_NOTICE, "System shutting down");
  closelog();
}


x86 assembly (clang, -O0):
<System_Shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <PWM_ClearSharedMemory@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<System_Shutdown>:
push   %rax
xor    %eax,%eax
call   1040 <PWM_ClearSharedMemory@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1050 <syslog@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [21 x i8] c"System shutting down\00"
define void @System_Shutdown() {
%1 = call i32 (...) @PWM_ClearSharedMemory()
%2 = load i32, i32* @LOG_NOTICE
%3 = call i32 @syslog(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [21 x i8] c"System shutting down\00"
define void @System_Shutdown() {
%1 = tail call i32 (...) @PWM_ClearSharedMemory()
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @closelog()
ret void
}
int ls30(unsigned int a) { return (a >> 30) != 0; }


x86 assembly (clang, -O0):
<ls30>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1e,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls30>:
xor    %eax,%eax
cmp    $0x40000000,%edi
setae  %al
ret

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

LLVM IR (-O2):
define i32 @ls30(i32 %0) {
%2 = icmp ugt i32 %0, 1073741823
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int mySqrt(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("%d == %d\n", 46340, mySqrt(2147483647));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7fffffff,%edi
call   1030 <mySqrt@plt>
mov    %eax,%edx
lea    0xebe(%rip),%rdi
mov    $0xb504,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7fffffff,%edi
call   1030 <mySqrt@plt>
lea    0xece(%rip),%rdi
mov    $0xb504,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d == %d\0A\00"
define i32 @main() {
%1 = tail call i32 @mySqrt(i32 2147483647)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 46340, i32 %1)
ret i32 0
}
void clr_bit(unsigned int *bitmap, const int bitn) {
  bitmap[bitn >> 5] &= ~(1 << (bitn & 0x1F));
}


x86 assembly (clang, -O0):
<clr_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_bit>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
sar    $0x5,%ecx
movslq %ecx,%rcx
and    %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @clr_bit(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 = and i32 %5, 31
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = ashr i32 %10, 5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = and i32 %14, %8
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @clr_bit(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = xor i32 %4, -1
%6 = ashr i32 %1, 5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = and i32 %9, %5
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *func1(void *arg) {
  int i = 0;
  for (i = 0; i < 3; i++) {
    printf("in func1\n");
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1168 <func1+0x48>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <func1+0x1a>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1040 <sleep@plt>

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

LLVM IR (-O2):
@str = [9 x i8] c"in func1\00"
define noalias i8* @func1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @sleep(i32 1)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void memwrap_free(void *ptr, const char *file, int line) {
  (void)file;
  (void)line;
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<memwrap_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <memwrap_free+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memwrap_free>:
test   %rdi,%rdi
je     111a <memwrap_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @memwrap_free(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
int lastIndexOf(const char *p_string, char p_search, int start_point) {
  int loop;
  for (loop = start_point - 1; loop >= 0; --loop) {
    if (p_string[loop] == p_search) {
      return loop;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<lastIndexOf>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     115a <lastIndexOf+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <lastIndexOf+0x47>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <lastIndexOf+0x61>
jmp    114c <lastIndexOf+0x4c>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <lastIndexOf+0x1a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastIndexOf>:
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1121 <lastIndexOf+0x21>
add    $0xffffffffffffffff,%rax
mov    %eax,%ecx
cmp    %sil,(%rdi,%rcx,1)
jne    1110 <lastIndexOf+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @lastIndexOf(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = zext i32 %2 to i64
br label %5
5: ; preds = %10, %3
%6 = phi i64 [ %7, %10 ], [ %4, %3 ]
%7 = add nsw i64 %6, -1
%8 = trunc i64 %6 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = and i64 %7, 4294967295
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, %1
br i1 %14, label %15, label %5
15: ; preds = %10
%16 = trunc i64 %7 to i32
br label %17
17: ; preds = %5, %15
%18 = phi i32 [ %16, %15 ], [ -1, %5 ]
ret i32 %18
}
void swapv1(int *a, int *b) {
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<swapv1>:
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):
<swapv1>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swapv1(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 @swapv1(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
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ pr_indent(int /*<<< orphan*/ *, int);
int pr_title(FILE *fp, int indent, char *title) {
  (void)pr_indent(fp, indent);
  (void)fprintf(fp, "%s:\n", title);
  return (indent + 3);
}


x86 assembly (clang, -O0):
<pr_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <pr_indent@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_title>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <pr_indent@plt>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <fprintf@plt>
add    $0x3,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s:\0A\00"
define i32 @pr_title(i32* %0, i32 %1, i8* %2) {
%4 = tail call i32 @pr_indent(i32* %0, i32 %1)
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = add nsw i32 %1, 3
ret i32 %6
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 "
         "REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 "
         "CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Thu "
         "Dec 13 10:37:34 KST 2012 BUILD=DEBUG CPU=ux500 USING_UMP=1 "
         "USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 "
         "USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= "
         "MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

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

LLVM IR (-O0):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Thu Dec 13 10:37:34 KST 2012 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Thu Dec 13 10:37:34 KST 2012 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_dup(int /*<<< orphan*/ const *);
struct stack_st_OPENSSL_CSTRING *
sk_OPENSSL_CSTRING_dup(const struct stack_st_OPENSSL_CSTRING *sk) {
  return (struct stack_st_OPENSSL_CSTRING *)OPENSSL_sk_dup(
      (const OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_dup>:
jmp    1030 <OPENSSL_sk_dup@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define %struct.stack_st_OPENSSL_CSTRING* @sk_OPENSSL_CSTRING_dup(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_CSTRING*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %2
%3 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_CSTRING* %3 to i32*
%5 = call i64 @OPENSSL_sk_dup(i32* %4)
%6 = inttoptr i64 %5 to %struct.stack_st_OPENSSL_CSTRING*
ret %struct.stack_st_OPENSSL_CSTRING* %6
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define %struct.stack_st_OPENSSL_CSTRING* @sk_OPENSSL_CSTRING_dup(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%3 = tail call i64 @OPENSSL_sk_dup(i32* %2)
%4 = inttoptr i64 %3 to %struct.stack_st_OPENSSL_CSTRING*
ret %struct.stack_st_OPENSSL_CSTRING* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  void *x;
  int y = 8;
  x = &y;
  int *temp = (int *)x;
  printf("%d \n", *temp);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ term_control_seq_exec_api(char const *);
void term_clear_screen() {
  const char clr[] = {27, '[', '2', 'J', '\0'};
  term_control_seq_exec_api(clr);
}


x86 assembly (clang, -O0):
<term_clear_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <term_control_seq_exec_api@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_clear_screen>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x4a325b1b,(%rsp)
mov    %rsp,%rdi
call   1030 <term_control_seq_exec_api@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.term_clear_screen.clr = [5 x i8] c"\1B[2J\00"
define void @term_clear_screen() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @term_control_seq_exec_api(i8* %3)
ret void
}

LLVM IR (-O2):
@__const.term_clear_screen.clr = [5 x i8] c"\1B[2J\00"
define void @term_clear_screen() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @term_control_seq_exec_api(i8* %2)
ret void
}
/* Variables and functions */
int syscall(int, int, char const *, unsigned int);
int open_tree(int dfd, const char *filename, unsigned int flags) {
  return syscall(428, dfd, filename, flags);
}


x86 assembly (clang, -O0):
<open_tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1ac,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_tree>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1ac,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @open_tree(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 428, i32 %0, i8* %1, i32 %2)
ret i32 %4
}
int sys$hiber(void) {
  return ({
    unsigned long resultvar;
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(15)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$hiber>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%rax
int    $0x81
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$hiber>:
mov    $0xf,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$hiber"() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 15)
store i64 %3, i64* %1
%4 = load i64, i64* %1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @"sys$hiber"() {
%1 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 15)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int custom_strcmp(const char *str1, const char *str2) {
  return strcmp(str1, str2);
}


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

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

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

LLVM IR (-O2):
define i32 @custom_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void __attribute__((weak)) can1_tx_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<can1_tx_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<can1_tx_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.can1_tx_isr = [12 x i8] c"can1_tx_isr\00"
define weak void @can1_tx_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.can1_tx_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.can1_tx_isr = [12 x i8] c"can1_tx_isr\00"
define weak void @can1_tx_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.can1_tx_isr, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int get_nbits(uint32_t v) {
  int c;
  v = v - ((v >> 1) & (((uint32_t) ~(uint32_t)0) / 3));
  v = (v & (((uint32_t) ~(uint32_t)0) / 15 * 3)) +
      ((v >> 2) & (((uint32_t) ~(uint32_t)0) / 15 * 3));
  v = (v + (v >> 4)) & (((uint32_t) ~(uint32_t)0) / 255 * 15);
  c = (uint32_t)(v * (((uint32_t) ~(uint32_t)0) / 255)) >>
      ((sizeof(uint32_t) - 1) * 8);
  return c;
}


x86 assembly (clang, -O0):
<get_nbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x0,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x0,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x0,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0x0,%eax
mov    %eax,-0x4(%rbp)
imul   $0x0,-0x4(%rbp),%eax
sar    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_nbits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = and i32 %6, 0
%8 = sub nsw i32 %4, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 0
%11 = load i32, i32* %2
%12 = ashr i32 %11, 2
%13 = and i32 %12, 0
%14 = add nsw i32 %10, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = ashr i32 %16, 4
%18 = add nsw i32 %15, %17
%19 = and i32 %18, 0
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = mul nsw i32 %20, 0
%22 = ashr i32 %21, 24
store i32 %22, i32* %3
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_nbits(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void debugLog(char *logLine) {
  int x;
  printf("*DEBUG LOG* %s\n", logLine);
  x = 0;
}


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

x86 assembly (clang, -O2):
<debugLog>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"*DEBUG LOG* %s\0A\00"
define void @debugLog(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ lua_check_number(int, char *);
scalar_t__ lua_getparam(int);
int lua_opt_number(int numArg, int def, char *funcname) {
  return (lua_getparam(numArg) == 0) ? def
                                     : (int)lua_check_number(numArg, funcname);
}


x86 assembly (clang, -O0):
<lua_opt_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <lua_getparam@plt>
cmp    $0x0,%rax
jne    114f <lua_opt_number+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    115e <lua_opt_number+0x3e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <lua_check_number@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_opt_number>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <lua_getparam@plt>
test   %rax,%rax
je     1142 <lua_opt_number+0x22>
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <lua_check_number@plt>
mov    %rax,%rbx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lua_opt_number(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i64 @lua_getparam(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %17
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %6
%15 = call i64 @lua_check_number(i32 %13, i8* %14)
%16 = trunc i64 %15 to i32
br label %17
17: ; preds = %12, %10
%18 = phi i32 [ %11, %10 ], [ %16, %12 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @lua_opt_number(i32 %0, i32 %1, i8* %2) {
%4 = tail call i64 @lua_getparam(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i64 @lua_check_number(i32 %0, i8* %2)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %8, %6 ], [ %1, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ low_initialise();
void bcm8544_init() { low_initialise(); }


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

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

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

LLVM IR (-O2):
define void @bcm8544_init() {
%1 = tail call i32 (...) @low_initialise()
ret void
}