xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clrscr() {
  printf("\033[2J");
  printf("\033[1;1H");
}


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

x86 assembly (clang, -O2):
<clrscr>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[1;1H\00"
define void @clrscr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[1;1H\00"
define void @clrscr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
                                   struct sk_buff *skb) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.batadv_priv = type opaque
%struct.sk_buff = type opaque
define i32 @batadv_bla_check_bcast_duplist(%struct.batadv_priv* nocapture readnone %0, %struct.sk_buff* nocapture readnone %1) {
ret i32 0
}
void free_2d_double(double **arr, int row) {
  int i;
  for (i = 0; i < row; i++)
    free(arr[i]);
  free(arr);
}


x86 assembly (clang, -O0):
<free_2d_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_2d_double+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_2d_double+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2d_double>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_2d_double+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2d_double+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_2d_double(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
%5 = alloca i32
store double** %0, double*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load double**, double*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double*, double** %11, i64 %13
%15 = load double*, double** %14
%16 = bitcast double* %15 to i8*
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load double**, double*** %3
%22 = bitcast double** %21 to i8*
ret void
}

LLVM IR (-O2):
define void @free_2d_double(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HidExit();
void USBThermoExit(void) { HidExit(); }


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

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

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

LLVM IR (-O2):
define void @USBThermoExit() {
%1 = tail call i32 (...) @HidExit()
ret void
}
/* Variables and functions */
int __libc_current_sigrtmax_private();
int __libc_current_sigrtmax(void) { return __libc_current_sigrtmax_private(); }


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

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

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

LLVM IR (-O2):
define i32 @__libc_current_sigrtmax() {
%1 = tail call i32 (...) @__libc_current_sigrtmax_private()
ret i32 %1
}
unsigned long int ROL(unsigned long int x, unsigned long int n) {
  return (((x) << (n)) | ((x) >> (32 - (n))));
}


x86 assembly (clang, -O0):
<ROL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    %cl,%rax
mov    -0x8(%rbp),%rdx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shr    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL>:
mov    %rsi,%rcx
mov    %rdi,%rax
shl    %cl,%rax
lea    0x20(%rsi),%rcx
neg    %rcx
shr    %cl,%rdi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ROL(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = shl i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = sub i64 32, %9
%11 = lshr i64 %8, %10
%12 = or i64 %7, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @ROL(i64 %0, i64 %1) {
%3 = shl i64 %0, %1
%4 = sub i64 32, %1
%5 = lshr i64 %0, %4
%6 = or i64 %5, %3
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ O(int);
w() { O(11); }


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

x86 assembly (clang, -O2):
<w>:
mov    $0xb,%edi
jmp    1030 <O@plt>

LLVM IR (-O0):
define i32 @w() {
%1 = alloca i32
%2 = call i32 @O(i32 11)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @w() {
%1 = tail call i32 @O(i32 11)
ret i32 undef
}
/* Variables and functions */
char *getenv(char *);
const char *tmp_dir() {
  const char *dir = "/tmp";
  if (getenv("TMPDIR")) {
    dir = getenv("TMPDIR");
  }
  return dir;
}


x86 assembly (clang, -O0):
<tmp_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1149 <tmp_dir+0x39>
lea    0xec5(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmp_dir>:
push   %rax
lea    0xeed(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xed9(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"/tmp\00"
@.str.1 = [7 x i8] c"TMPDIR\00"
define i8* @tmp_dir() {
%1 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %1
br label %6
6: ; preds = %4, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"/tmp\00"
@.str.1 = [7 x i8] c"TMPDIR\00"
define i8* @tmp_dir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1
ret i8* %3
}
long getpc(tcp)
struct tcb *tcp;
{
}


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i64 @getpc(%struct.tcb* %0) {
%2 = alloca i64
%3 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %3
%4 = load i64, i64* %2
ret i64 %4
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i64 @getpc(%struct.tcb* nocapture readnone %0) {
ret i64 undef
}
void __attribute__((destructor)) finalize3() {
  printf(__func__);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<finalize3>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__func__.finalize3 = [10 x i8] c"finalize3\00"
@.str = [2 x i8] c"\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @finalize3, i8* null }]
define void @finalize3() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.finalize3, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.finalize3 = [10 x i8] c"finalize3\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @finalize3, i8* null }]
define void @finalize3() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.finalize3, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
void zero(double *z, int n) {
  int nn;
  for (nn = 0; nn < n; nn++) {
    z[nn] = 0.0;
  }
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <zero+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
test   %esi,%esi
jle    1126 <zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @zero(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @zero(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
float min(float x, float y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <min+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef scalar_t__ ulBase;

/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int PWMGenValid(unsigned long);
void PWMGenDisable(unsigned long ulBase, unsigned long ulGen) {
  DEBUG_ASSERT((ulBase == 0x40028000) || (ulBase == 0x40029000));
  DEBUG_ASSERT(PWMGenValid(ulGen));
  (*((volatile unsigned long *)(((ulBase) + (+ulGen)) + 0x00000000))) &=
      ~(0x00000001);
}


x86 assembly (clang, -O0):
<PWMGenDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x40028000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     1151 <PWMGenDisable+0x31>
cmpq   $0x40029000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <PWMGenValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40028000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,%rdi
call   1040 <PWMGenValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
andq   $0xfffffffffffffffe,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PWMGenDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073905664
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1073909760
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = call i32 @PWMGenValid(i64 %14)
%16 = call i32 @DEBUG_ASSERT(i32 %15)
%17 = load i64, i64* %3
%18 = load i64, i64* %4
%19 = add i64 %17, %18
%20 = add i64 %19, 0
%21 = inttoptr i64 %20 to i64*
%22 = load volatile i64, i64* %21
%23 = and i64 %22, -2
store volatile i64 %23, i64* %21
ret void
}

LLVM IR (-O2):
define void @PWMGenDisable(i64 %0, i64 %1) {
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073905664
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = tail call i32 @PWMGenValid(i64 %1)
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = add i64 %1, %0
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -2
store volatile i64 %12, i64* %10
ret void
}
void RSA_public_decrypt(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_public_decrypt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IF_fctD_1(int /*<<< orphan*/);
int /*<<< orphan*/ y1;
void IF_y1(void) { IF_fctD_1(y1); }


x86 assembly (clang, -O0):
<IF_y1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <IF_fctD_1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_y1>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <IF_fctD_1@plt>

LLVM IR (-O0):
@y1 = global i32 0
define void @IF_y1() {
%1 = load i32, i32* @y1
%2 = call i32 @IF_fctD_1(i32 %1)
ret void
}

LLVM IR (-O2):
@y1 = global i32 0
define void @IF_y1() {
%1 = load i32, i32* @y1
%2 = tail call i32 @IF_fctD_1(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void bail(char *s) {
  fputs(s, stderr);
  fputc('\n', stderr);
}


x86 assembly (clang, -O0):
<bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bail>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
pop    %rbx
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @bail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputc(i8 signext 10, i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @bail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputc(i8 signext 10, i32 %4)
ret void
}
int test_imm_A4uint32_mem(unsigned int *val) {
  return ((*val) & (0xA4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A4uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xa4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A4uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 164
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo041(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo041(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ isgraph(int);
int is_string_part(int ch) { return (ch == ' ' || isgraph(ch)); }


x86 assembly (clang, -O0):
<is_string_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113c <is_string_part+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <isgraph@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_string_part>:
mov    $0x1,%eax
cmp    $0x20,%edi
je     112f <is_string_part+0x1f>
push   %rax
call   1030 <isgraph@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @is_string_part(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i64 @isgraph(i32 %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ true, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_string_part(i32 %0) {
%2 = icmp eq i32 %0, 32
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @isgraph(i32 %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
const char *g_quark_to_string(uintptr_t q) { return (const char *)(size_t)q; }


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

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

LLVM IR (-O0):
define i8* @g_quark_to_string(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @g_quark_to_string(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Variables and functions */
int syscall(int, int, char const *, void const *, size_t, int);
int fsetxattr(int filedes, const char *name, const void *value, size_t size,
              int flags) {
  return syscall(228, filedes, name, value, size, flags);
}


x86 assembly (clang, -O0):
<fsetxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0xe4,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsetxattr>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xe4,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @fsetxattr(i32 %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load i32, i32* %10
%16 = call i32 @syscall(i32 228, i32 %11, i8* %12, i8* %13, i64 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @fsetxattr(i32 %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = tail call i32 @syscall(i32 228, i32 %0, i8* %1, i8* %2, i64 %3, i32 %4)
ret i32 %6
}
void breakme() {}


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

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

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

LLVM IR (-O2):
define void @breakme() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  int range;
  i = __VERIFIER_nondet_int();
  range = 20;
  while (0 <= i && i <= range) {
    if (!(0 == i && i == range)) {
      if (i == range) {
        i = 0;
        range = range - 1;
      } else {
        i = i + 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     114c <main+0x3c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115c <main+0x4c>
jmp    11a7 <main+0x97>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1173 <main+0x63>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11a2 <main+0x92>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1194 <main+0x84>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119d <main+0x8d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a2 <main+0x92>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
store i32 20, i32* %3
br label %5
5: ; preds = %32, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 0, %6
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp sle i32 %9, %10
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %33
14: ; preds = %12
%15 = load i32, i32* %2
%16 = icmp eq i32 0, %15
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = icmp eq i32 %18, %19
br i1 %20, label %32, label %21
21: ; preds = %17, %14
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %21
store i32 0, i32* %2
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %3
br label %31
28: ; preds = %21
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %31
31: ; preds = %28, %25
br label %32
32: ; preds = %31, %17
br label %5
33: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t h265hvcc_get_avg_frame_rate(const uint8_t *p) {
  return (p[18] << 8) | p[19];
}


x86 assembly (clang, -O0):
<h265hvcc_get_avg_frame_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_get_avg_frame_rate>:
mov    0x48(%rdi),%eax
shl    $0x8,%eax
or     0x4c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @h265hvcc_get_avg_frame_rate(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 18
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 19
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @h265hvcc_get_avg_frame_rate(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 18
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 19
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
int utf8_strlen(const char *s) {
  int cnt = 0;
  while (*s) {
    if ((*s & 0xc0) != 0x80)
      cnt += 1;
    s += 1;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <utf8_strlen+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     113c <utf8_strlen+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <utf8_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_strlen>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <utf8_strlen+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0xc0,%cl
xor    %edx,%edx
cmp    $0x80,%cl
setne  %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <utf8_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @utf8_strlen(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 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = and i8 %5, -64
%9 = icmp ne i8 %8, -128
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
Strlen(s) unsigned short *s;
{
  int i;
  for (i = 0; *s; i++, s++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<Strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpw   $0x0,(%rax)
je     113c <Strlen+0x3c>
jmp    1122 <Strlen+0x22>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <Strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strlen>:
cmpw   $0x0,(%rdi)
je     111d <Strlen+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpw   $0x0,0x2(%rdi,%rax,2)
lea    0x1(%rax),%rax
jne    1110 <Strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Strlen(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp eq i16 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i16* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i16, i16* %6, i64 1
%9 = load i16, i16* %8
%10 = icmp eq i16 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
unsigned int f92(unsigned int x, int y __attribute__((unused))) {
  return (x << 1) + (x >> (8 * sizeof(unsigned int) - 1));
}


x86 assembly (clang, -O0):
<f92>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f92>:
mov    %edi,%eax
rol    %eax
ret

LLVM IR (-O0):
define i32 @f92(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = lshr i32 %7, 31
%9 = add i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f92(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ ConfigureOscillator();
int /*<<< orphan*/ InitApp();
int16_t main(void) {
  ConfigureOscillator();
  InitApp();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ConfigureOscillator@plt>
mov    $0x0,%al
call   1030 <InitApp@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <ConfigureOscillator@plt>
xor    %eax,%eax
call   1030 <InitApp@plt>
nop
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ConfigureOscillator()
%3 = call i32 (...) @InitApp()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ConfigureOscillator()
%2 = tail call i32 (...) @InitApp()
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ Error(int, char *, char *);
scalar_t__ calloc(size_t, unsigned int);
void *Pcalloc(size_t Number, unsigned int Size) {
  void *p = 0;
  if (!Number || (p = (void *)calloc(Number, Size))) {
    return p;
  }
  Error(8, "", "");
  return 0;
}


x86 assembly (clang, -O0):
<Pcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <Pcalloc+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1169 <Pcalloc+0x49>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <Pcalloc+0x65>
mov    $0x8,%edi
lea    0xe8b(%rip),%rdx
mov    %rdx,%rsi
call   1030 <Error@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pcalloc>:
push   %rax
test   %rdi,%rdi
je     1146 <Pcalloc+0x26>
call   1040 <calloc@plt>
test   %rax,%rax
je     1132 <Pcalloc+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdx
mov    $0x8,%edi
mov    %rdx,%rsi
call   1030 <Error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @Pcalloc(i64 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %4
store i32 %1, i32* %5
store i8* null, i8** %6
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i64, i64* %4
%11 = load i32, i32* %5
%12 = call i64 @calloc(i64 %10, i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %9, %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %19
17: ; preds = %9
%18 = call i32 @Error(i32 8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %19
19: ; preds = %17, %15
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @Pcalloc(i64 %0, i32 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i64 @calloc(i64 %0, i32 %1)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @Error(i32 8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %2, %4, %8
%11 = phi i8* [ null, %8 ], [ %6, %4 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double rnd(void) { return (double)rand() / RAND_MAX; }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rnd() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rnd() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
double convertToVoltage(int /*<<< orphan*/);
int /*<<< orphan*/ readVoltageRawFromChannel(unsigned int);
double readVoltageFromChannel(unsigned int channel) {
  return convertToVoltage(readVoltageRawFromChannel(channel));
}


x86 assembly (clang, -O0):
<readVoltageFromChannel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <readVoltageRawFromChannel@plt>
mov    %eax,%edi
call   1030 <convertToVoltage@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @readVoltageFromChannel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @readVoltageRawFromChannel(i32 %3)
%5 = call double @convertToVoltage(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @readVoltageFromChannel(i32 %0) {
%2 = tail call i32 @readVoltageRawFromChannel(i32 %0)
%3 = tail call double @convertToVoltage(i32 %2)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ sign;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ stdout;
void rolling_sign() {
  static char sign[] = "|/-\\";
  static int n = 0;
  printf("%c\r", sign[n]);
  fflush(stdout);
  if (++n == sizeof(sign) - 1)
    n = 0;
}


x86 assembly (clang, -O0):
<rolling_sign>:
push   %rbp
mov    %rsp,%rbp
movslq 0x2f11(%rip),%rcx
lea    0xece(%rip),%rdi
lea    0x2ef7(%rip),%rax
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ee6(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2edd(%rip)
cltq
cmp    $0x4,%rax
jne    1175 <rolling_sign+0x55>
movl   $0x0,0x2ec7(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rolling_sign>:
push   %rax
movslq 0x2f0c(%rip),%rax
lea    0xed1(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ee1(%rip),%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x4,%eax
cmovne %eax,%ecx
mov    %ecx,0x2ed0(%rip)
pop    %rax
ret

LLVM IR (-O0):
@rolling_sign.sign = internal global [5 x i8] c"|/-\\\00"
@rolling_sign.n = internal global i32 0
@.str = [4 x i8] c"%c\0D\00"
@stdout = global i32 0
define void @rolling_sign() {
%1 = load i32, i32* @rolling_sign.n
%2 = sext i32 %1 to i64
%3 = getelementptr inbounds [5 x i8], [5 x i8]* @rolling_sign.sign, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = load i32, i32* @rolling_sign.n
%9 = add nsw i32 %8, 1
store i32 %9, i32* @rolling_sign.n
%10 = sext i32 %9 to i64
%11 = icmp eq i64 %10, 4
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 0, i32* @rolling_sign.n
br label %13
13: ; preds = %12, %0
ret void
}

LLVM IR (-O2):
@rolling_sign.sign = internal unnamed_addr constant [5 x i8] c"|/-\\\00"
@rolling_sign.n = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%c\0D\00"
@stdout = global i32 0
define void @rolling_sign() {
%1 = load i32, i32* @rolling_sign.n
%2 = sext i32 %1 to i64
%3 = getelementptr inbounds [5 x i8], [5 x i8]* @rolling_sign.sign, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = load i32, i32* @rolling_sign.n
%9 = add nsw i32 %8, 1
%10 = icmp eq i32 %9, 4
%11 = select i1 %10, i32 0, i32 %9
store i32 %11, i32* @rolling_sign.n
ret void
}
double double_min1(double a, double b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<double_min1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <double_min1+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <double_min1+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_min1>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @double_min1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @double_min1(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int kernel_config_check() {
  const char *prefix = "/boot/config-";
  system("uname -r");
  return 0;
}


x86 assembly (clang, -O0):
<kernel_config_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xee4(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_config_check>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/boot/config-\00"
@.str.1 = [9 x i8] c"uname -r\00"
define i32 @kernel_config_check() {
%1 = alloca i8*
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"uname -r\00"
define i32 @kernel_config_check() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void print_backtrace(FILE *file) { ((void)(file)); }


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

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

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

LLVM IR (-O2):
define void @print_backtrace(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ xlog(char *, int);
int main(int argc, char *argv[]) {
  int cnt = 0;
  while (1) {
    xlog("tick #%d", ++cnt);
    sleep(1);
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x18(%rbp)
mov    %esi,-0x14(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <xlog@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <xlog@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0x1,%ebx
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [9 x i8] c"tick #%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %2, %7
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = call i32 @xlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @sleep(i32 1)
br label %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"tick #%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 @xlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @sleep(i32 1)
br label %3
}
/* Variables and functions */
char tolower(char);
void minuscola(char *s) {
  for (; *s; ++s)
    *s = tolower(*s);
}


x86 assembly (clang, -O0):
<minuscola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <minuscola+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <minuscola+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minuscola>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <minuscola+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <minuscola+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @minuscola(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
void writeToFile(char frame) {
  FILE *file;
  file = fopen("results.log", "a+");
  fprintf(file, "%c", frame);
  fclose(file);
}


x86 assembly (clang, -O0):
<writeToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xebb(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeToFile>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"results.log\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [3 x i8] c"%c\00"
define void @writeToFile(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i8, i8* %2
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"results.log\00"
@.str.1 = [3 x i8] c"a+\00"
define void @writeToFile(i8 signext %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = sext i8 %0 to i32
%4 = tail call i32 @fputc(i32 %3, i32* %2)
%5 = tail call i32 @fclose(i32* %2)
ret void
}