xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void disp_name_array(char **name_array) {
  while (*name_array)
    printf(" %s\n", *name_array++);
}


x86 assembly (clang, -O0):
<disp_name_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <disp_name_array+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    111c <disp_name_array+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_name_array>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1144 <disp_name_array+0x34>
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <disp_name_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c" %s\0A\00"
define void @disp_name_array(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %7, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8**, i8*** %2
%9 = getelementptr inbounds i8*, i8** %8, i32 1
store i8** %9, i8*** %2
%10 = load i8*, i8** %8
%11 = ptrtoint i8* %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" %s\0A\00"
define void @disp_name_array(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %11, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = ptrtoint i8* %5 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprint(char *);
void kps(char *str) { kprint(str); }


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

x86 assembly (clang, -O2):
<kps>:
jmp    1030 <kprint@plt>

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

LLVM IR (-O2):
define void @kps(i8* %0) {
%2 = tail call i32 @kprint(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ReverseGPIOP__1__In__clr();
void ReverseGPIOP__1__Out__set(void) { ReverseGPIOP__1__In__clr(); }


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

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

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

LLVM IR (-O2):
define void @ReverseGPIOP__1__Out__set() {
%1 = tail call i32 (...) @ReverseGPIOP__1__In__clr()
ret void
}
void bar_char(void) { foo_char(2 - 3i); }


x86 assembly (clang, -O0):
<bar_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0xfffffffd,-0x4(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <foo_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_char>:
movabs $0xfffffffd00000002,%rdi
ff ff ff
xor    %eax,%eax
jmp    1030 <foo_char@plt>

LLVM IR (-O0):
define void @bar_char() {
%1 = alloca { i32, i32 }
%2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 1
store i32 2, i32* %2
store i32 -3, i32* %3
%4 = bitcast { i32, i32 }* %1 to i64*
%5 = load i64, i64* %4
%6 = call i32 (i64, ...) bitcast (i32 (...)* @foo_char to i32 (i64, ...)*)(i64 %5)
ret void
}

LLVM IR (-O2):
define void @bar_char() {
%1 = tail call i32 (i64, ...) bitcast (i32 (...)* @foo_char to i32 (i64, ...)*)(i64 -12884901886)
ret void
}
char FR_popcnt(const char n) {
  return ((n & 4) >> 2) + ((n & 2) >> 1) + (n & 1);
}


x86 assembly (clang, -O0):
<FR_popcnt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x4,%eax
sar    $0x2,%eax
movsbl -0x1(%rbp),%ecx
and    $0x2,%ecx
sar    $0x1,%ecx
add    %ecx,%eax
movsbl -0x1(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FR_popcnt>:
mov    %edi,%ecx
shr    $0x2,%cl
and    $0x1,%cl
mov    %edi,%eax
shr    %al
and    $0x1,%al
and    $0x1,%dil
add    %dil,%al
add    %cl,%al
ret

LLVM IR (-O0):
define signext i8 @FR_popcnt(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 4
%6 = ashr i32 %5, 2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = and i32 %8, 2
%10 = ashr i32 %9, 1
%11 = add nsw i32 %6, %10
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = and i32 %13, 1
%15 = add nsw i32 %11, %14
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @FR_popcnt(i8 signext %0) {
%2 = lshr i8 %0, 2
%3 = and i8 %2, 1
%4 = lshr i8 %0, 1
%5 = and i8 %4, 1
%6 = and i8 %0, 1
%7 = add nuw nsw i8 %5, %6
%8 = add nuw nsw i8 %7, %3
ret i8 %8
}
/* Variables and functions */
int isCharacter(const char *ccp_input, const size_t i_offset) {
  return (ccp_input[i_offset] > 32 && ccp_input[i_offset] < 127) ? 0 : -1;
}


x86 assembly (clang, -O0):
<isCharacter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
jle    113b <isCharacter+0x3b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7f,%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    $0xffffffff,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCharacter>:
mov    (%rdi,%rsi,1),%al
add    $0x81,%al
cmp    $0xa2,%al
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isCharacter(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 32
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp slt i32 %16, 127
br label %18
18: ; preds = %11, %2
%19 = phi i1 [ false, %2 ], [ %17, %11 ]
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 0, i32 -1
ret i32 %21
}

LLVM IR (-O2):
define i32 @isCharacter(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = add i8 %4, -127
%6 = icmp ult i8 %5, -94
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  printf("%d\n", m + n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int another(int a) {
  if (a > 10)
    return 20;
  return 0;
}


x86 assembly (clang, -O0):
<another>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    111d <another+0x1d>
movl   $0x14,-0x4(%rbp)
jmp    1124 <another+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<another>:
xor    %ecx,%ecx
cmp    $0xb,%edi
mov    $0x14,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @another(i32 %0) {
%2 = icmp sgt i32 %0, 10
%3 = select i1 %2, i32 20, i32 0
ret i32 %3
}
/* Variables and functions */
int sqrt(double);
double getR(double b, double h) {
  return b * h / (b + 2 * sqrt(b * b / 4 + h * h));
}


x86 assembly (clang, -O0):
<getR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
shl    $0x1,%eax
cvtsi2sd %eax,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getR>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm0,%xmm0
mulsd  0xecc(%rip),%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @getR(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 = fmul double %5, %6
%8 = load double, double* %3
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = fdiv double %11, 4.000000e+00
%13 = load double, double* %4
%14 = load double, double* %4
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double %12)
%16 = call i32 @sqrt(double %15)
%17 = mul nsw i32 2, %16
%18 = sitofp i32 %17 to double
%19 = fadd double %8, %18
%20 = fdiv double %7, %19
ret double %20
}

LLVM IR (-O2):
define double @getR(double %0, double %1) {
%3 = fmul double %0, %1
%4 = fmul double %0, %0
%5 = fmul double %4, 2.500000e-01
%6 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %5)
%7 = tail call i32 @sqrt(double %6)
%8 = shl nsw i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = fadd double %9, %0
%11 = fdiv double %3, %10
ret double %11
}
/* Variables and functions */
char *malloc(int);
char *mj_new_object(int numbytes) {
  char *object = malloc(numbytes);
  int i;
  for (i = 0; i < numbytes; i++)
    object[i] = 0;
  return object;
}


x86 assembly (clang, -O0):
<mj_new_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <mj_new_object+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <mj_new_object+0x1e>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @mj_new_object(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
long str_findc(char const *, char const *);
char *str_pfindc(const char *in, const char *what) {
  long index = str_findc(in, what);
  if (index != -1)
    return (char *)in + index;
  return NULL;
}


x86 assembly (clang, -O0):
<str_pfindc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <str_findc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffffff,-0x20(%rbp)
je     114d <str_pfindc+0x3d>
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <str_pfindc+0x45>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_pfindc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <str_findc@plt>
add    %rax,%rbx
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
cmovne %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @str_pfindc(i8* %0, i8* %1) {
%3 = tail call i64 @str_findc(i8* %0, i8* %1)
%4 = icmp eq i64 %3, -1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = select i1 %4, i8* null, i8* %5
ret i8* %6
}
/* Variables and functions */
int a_to_i(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int n;
  char s[] = "-12345";
  n = a_to_i(s);
  printf("%d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0x1b(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x17(%rbp)
mov    0xeb6(%rip),%al
mov    %al,-0x15(%rbp)
lea    -0x1b(%rbp),%rdi
call   1040 <a_to_i@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x353433,0x3(%rsp)
movl   $0x3332312d,(%rsp)
mov    %rsp,%rdi
call   1040 <a_to_i@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.s = [7 x i8] c"-12345\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%5 = call i32 @a_to_i(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
unsigned int __sw_hweight32(unsigned int);
unsigned int __arch_hweight32(unsigned int w) { return __sw_hweight32(w); }


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

x86 assembly (clang, -O2):
<__arch_hweight32>:
jmp    1030 <__sw_hweight32@plt>

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

LLVM IR (-O2):
define i32 @__arch_hweight32(i32 %0) {
%2 = tail call i32 @__sw_hweight32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int B_date(int x, int y, int z) {
  printf("My Birth Date Is :%d-%d-%d\n", x, y, z);
  return 0;
}


x86 assembly (clang, -O0):
<B_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B_date>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [28 x i8] c"My Birth Date Is :%d-%d-%d\0A\00"
define i32 @B_date(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret i32 0
}
int get_var_cell_header_size(int wide_circ_ids) {
  return wide_circ_ids ? 7 : 7 - 2;
}


x86 assembly (clang, -O0):
<get_var_cell_header_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x5,%eax
mov    $0x7,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_var_cell_header_size>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
add    %eax,%eax
add    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @get_var_cell_header_size(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 5, i32 7
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x5c() {
  Assert_real((isspace(92) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              465, ("isspace should be 0 for 0x5c"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x5c\00"
define void @t_isspace_0x5c() {
%1 = tail call i64 @isspace(i32 92)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long __attribute__((no)) lmulv(long a, long b) { return a * b; }


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

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

LLVM IR (-O0):
define i64 @lmulv(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 = mul nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @lmulv(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ game_loop();
int /*<<< orphan*/ generate_mines(int);
int /*<<< orphan*/ init_field();
int /*<<< orphan*/ print_field();
main(void) {
  init_field();
  generate_mines(1);
  print_field();
  game_loop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <init_field@plt>
mov    $0x1,%edi
call   1040 <generate_mines@plt>
mov    $0x0,%al
call   1060 <print_field@plt>
mov    $0x0,%al
call   1030 <game_loop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init_field@plt>
mov    $0x1,%edi
call   1040 <generate_mines@plt>
xor    %eax,%eax
call   1060 <print_field@plt>
xor    %eax,%eax
call   1030 <game_loop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_field()
%3 = call i32 @generate_mines(i32 1)
%4 = call i32 (...) @print_field()
%5 = call i32 (...) @game_loop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_field()
%2 = tail call i32 @generate_mines(i32 1)
%3 = tail call i32 (...) @print_field()
%4 = tail call i32 (...) @game_loop()
ret i32 0
}
/* Variables and functions */
double fabs(double);
double SDL_fabs(double x) { return fabs(x); }


x86 assembly (clang, -O0):
<SDL_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_fabs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @SDL_fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @SDL_fabs(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ chip_reset();
int /*<<< orphan*/ disable_interrupts();
int /*<<< orphan*/ enable_interrupts();
int /*<<< orphan*/ serial_puts(char *);
void gpio_0_irq_handler(void *data) {
  disable_interrupts();
  unsigned long *cold_heart_status = 0x49001ffc;
  serial_puts("Power Key");
  *cold_heart_status = 0x5a5a5a5a;
  chip_reset();
  enable_interrupts();
}


x86 assembly (clang, -O0):
<gpio_0_irq_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <disable_interrupts@plt>
mov    $0x49001ffc,%eax
mov    %rax,-0x10(%rbp)
lea    0xe9d(%rip),%rdi
call   1040 <serial_puts@plt>
mov    -0x10(%rbp),%rax
movq   $0x5a5a5a5a,(%rax)
mov    $0x0,%al
call   1030 <chip_reset@plt>
mov    $0x0,%al
call   1060 <enable_interrupts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_0_irq_handler>:
push   %rax
xor    %eax,%eax
call   1050 <disable_interrupts@plt>
lea    0xeb1(%rip),%rdi
call   1040 <serial_puts@plt>
movq   $0x5a5a5a5a,0x49001ffc
49 5a 5a 5a 5a
xor    %eax,%eax
call   1030 <chip_reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <enable_interrupts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Power Key\00"
define void @gpio_0_irq_handler(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = call i32 (...) @disable_interrupts()
store i64* inttoptr (i64 1224744956 to i64*), i64** %3
%5 = call i32 @serial_puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = load i64*, i64** %3
store i64 1515870810, i64* %6
%7 = call i32 (...) @chip_reset()
%8 = call i32 (...) @enable_interrupts()
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Power Key\00"
define void @gpio_0_irq_handler(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @disable_interrupts()
%3 = tail call i32 @serial_puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i64 1515870810, i64* inttoptr (i64 1224744956 to i64*)
%4 = tail call i32 (...) @chip_reset()
%5 = tail call i32 (...) @enable_interrupts()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(-errno);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
mov    0x2e8a(%rip),%rax
sub    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
xor    %edi,%edi
sub    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void msm_jtag_etm_save_state(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_jtag_etm_save_state() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int *p1, *p2;
  p1 = (int *)malloc(1);
  p2 = (int *)malloc(1);
  printf("%p %p\n", p1, p2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1040 <malloc@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%p %p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 1)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i64 @malloc(i32 1)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %6)
ret i32 0
}
void gdk_draw_layout_with_colors() {}


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

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

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

LLVM IR (-O2):
define void @gdk_draw_layout_with_colors() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void print_usage(FILE *stream, char *progname) {
  fprintf(stream,
          "Usage: %s [-d directory directory2 ...] [-e exclude] [-l list] [-t "
          "timeout]"
          " [-x xml-filename] [-h] [ptest1 ptest2 ...]\n",
          progname);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [120 x i8] c"Usage: %s [-d directory directory2 ...] [-e exclude] [-l list] [-t timeout] [-x xml-filename] [-h] [ptest1 ptest2 ...]\0A\00"
define void @print_usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [120 x i8] c"Usage: %s [-d directory directory2 ...] [-e exclude] [-l list] [-t timeout] [-x xml-filename] [-h] [ptest1 ptest2 ...]\0A\00"
define void @print_usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
void *ft_mem_set(void *, int /*<<< orphan*/, unsigned long);
scalar_t__ malloc(unsigned long);
void *ft_mem_malloc(unsigned long size) {
  void *mem;
  if (!(mem = (void *)malloc(size * sizeof(*mem))))
    return (NULL);
  mem = ft_mem_set(mem, 0, size);
  return (mem);
}


x86 assembly (clang, -O0):
<ft_mem_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x0,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1154 <ft_mem_malloc+0x34>
movq   $0x0,-0x8(%rbp)
jmp    116f <ft_mem_malloc+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <ft_mem_set@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_mem_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     113c <ft_mem_malloc+0x1c>
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <ft_mem_set@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_mem_malloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i8*
%6 = tail call i8* @ft_mem_set(i8* %5, i32 0, i64 %0)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ line_reversal(void *, int, int, int);
void rgb888_line_reversal(void *p888, int w, int h) {
  line_reversal(p888, w, h, 24);
}


x86 assembly (clang, -O0):
<rgb888_line_reversal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x18,%ecx
call   1030 <line_reversal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb888_line_reversal>:
mov    $0x18,%ecx
jmp    1030 <line_reversal@plt>

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

LLVM IR (-O2):
define void @rgb888_line_reversal(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @line_reversal(i8* %0, i32 %1, i32 %2, i32 24)
ret void
}
/* Variables and functions */
int printf(char *, long);
int print_long(long v) { return printf("%ld", v); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @print_long(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 %2
}
void ff_thread_flush() {}


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

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

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

LLVM IR (-O2):
define void @ff_thread_flush() {
ret void
}
void recurse() { recurse(); }


x86 assembly (clang, -O0):
<recurse>:
push   %rbp
mov    %rsp,%rbp
call   1030 <recurse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse>:
jmp    1100 <recurse>

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

LLVM IR (-O2):
define void @recurse() {
br label %1
1: ; preds = %1, %0
br label %1
}
void g_array_new() {}


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

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

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

LLVM IR (-O2):
define void @g_array_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *me) {
  fprintf(stderr, "usage: %s [-i init_file]\n", me);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"usage: %s [-i init_file]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"usage: %s [-i init_file]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int init_hotplug_sock();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ recv(int, char **, int, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int hotplug_sock = init_hotplug_sock();
  while (1) {
    char buf[2048 * 2] = {0};
    recv(hotplug_sock, &buf, sizeof(buf), 0);
    printf("SnoTest---------------%s\n", buf);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init_hotplug_sock@plt>
mov    %eax,-0x14(%rbp)
lea    -0x1020(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1060 <memset@plt>
mov    -0x14(%rbp),%edi
lea    -0x1020(%rbp),%rsi
mov    $0x1000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
lea    -0x1020(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1050 <printf@plt>
jmp    1163 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1000,%rsp
xor    %eax,%eax
call   1040 <init_hotplug_sock@plt>
mov    %eax,%ebp
mov    %rsp,%rbx
lea    0xea2(%rip),%r14
xchg   %ax,%ax
mov    $0x1000,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [26 x i8] c"SnoTest---------------%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [4096 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @init_hotplug_sock()
store i32 %8, i32* %6
br label %9
9: ; preds = %2, %9
%10 = bitcast [4096 x i8]* %7 to i8*
%11 = load i32, i32* %6
%12 = bitcast [4096 x i8]* %7 to i8**
%13 = call i32 @recv(i32 %11, i8** %12, i32 4096, i32 0)
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %9
}

LLVM IR (-O2):
@.str = [26 x i8] c"SnoTest---------------%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4096 x i8]
%4 = tail call i32 (...) @init_hotplug_sock()
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%6 = bitcast [4096 x i8]* %3 to i8**
br label %7
7: ; preds = %7, %2
%8 = call i32 @recv(i32 %4, i8** %6, i32 4096, i32 0)
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ Buffer2Stg(char *, char *, int, int, int);
char *ecvt(double, int, int *, int *);
void Dbl2Stg(char *lps, double factor, int prec) {
  int decimal, sign, precision;
  char *buffer;
  if (prec)
    precision = prec;
  else
    precision = 16;
  buffer = ecvt(factor, precision, &decimal, &sign);
  Buffer2Stg(lps, buffer, decimal, sign, precision);
}


x86 assembly (clang, -O0):
<Dbl2Stg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1149 <Dbl2Stg+0x29>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1150 <Dbl2Stg+0x30>
movl   $0x10,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <ecvt@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1030 <Buffer2Stg@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dbl2Stg>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
mov    $0x10,%ebp
cmovne %esi,%ebp
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    %ebp,%edi
call   1040 <ecvt@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%r8d
call   1030 <Buffer2Stg@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Dbl2Stg(i8* %0, double %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = icmp eq i32 %2, 0
%9 = select i1 %8, i32 16, i32 %2
%10 = call i8* @ecvt(double %1, i32 %9, i32* %4, i32* %5)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @Buffer2Stg(i8* %0, i8* %10, i32 %11, i32 %12, i32 %9)
ret void
}
/* Variables and functions */
scalar_t__ stb__wildmatch_raw(char *, char *, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int stb_wildmatch(char *expr, char *candidate) {
  return stb__wildmatch_raw(expr, candidate, 0, 0) >= 0;
}


x86 assembly (clang, -O0):
<stb_wildmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <stb__wildmatch_raw@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_wildmatch>:
push   %rax
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <stb__wildmatch_raw@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stb_wildmatch(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 i64 @stb__wildmatch_raw(i8* %5, i8* %6, i32 0, i32 0)
%8 = icmp sge i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @stb_wildmatch(i8* %0, i8* %1) {
%3 = tail call i64 @stb__wildmatch_raw(i8* %0, i8* %1, i32 0, i32 0)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;
struct timespec {
  int member_0;
  int member_1;
};

/* Variables and functions */
scalar_t__ nanosleep(struct timespec *, struct timespec *);
void msleep(uint32_t msec) {
  struct timespec req = {msec / 1000, 1000000 * (msec % 1000)};
  while (nanosleep(&req, &req))
    ;
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
je     1158 <msleep+0x48>
jmp    113d <msleep+0x2d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
push   %rbx
sub    $0x10,%rsp
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,0x8(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <nanosleep@plt>
test   %rax,%rax
jne    1150 <msleep+0x40>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000
store i32 %6, i32* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%8 = load i32, i32* %2
%9 = srem i32 %8, 1000
%10 = mul nsw i32 1000000, %9
store i32 %10, i32* %7
br label %11
11: ; preds = %14, %1
%12 = call i64 @nanosleep(%struct.timespec* %3, %struct.timespec* %3)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
br label %11
15: ; preds = %11
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = sdiv i32 %0, 1000
store i32 %5, i32* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%7 = srem i32 %0, 1000
%8 = mul nsw i32 %7, 1000000
store i32 %8, i32* %6
br label %9
9: ; preds = %9, %1
%10 = call i64 @nanosleep(%struct.timespec* %2, %struct.timespec* %2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %9
12: ; preds = %9
ret void
}