xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ rfftf1(size_t, double *, double *, double *, size_t *);
void rfftf(size_t n, double r[], double wsave[]) {
  if (n != 1)
    rfftf1(n, r, wsave, wsave + n, (size_t *)(wsave + 2 * n));
}


x86 assembly (clang, -O0):
<rfftf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x8(%rbp)
je     1162 <rfftf+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x18(%rbp),%r8
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
shl    $0x3,%rax
add    %rax,%r8
call   1030 <rfftf1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfftf>:
cmp    $0x1,%rdi
jne    1117 <rfftf+0x7>
ret
lea    (%rdx,%rdi,8),%rcx
mov    %rdi,%r8
shl    $0x4,%r8
add    %rdx,%r8
jmp    1030 <rfftf1@plt>

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

LLVM IR (-O2):
define void @rfftf(i64 %0, double* %1, double* %2) {
%4 = icmp eq i64 %0, 1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = getelementptr inbounds double, double* %2, i64 %0
%7 = shl i64 %0, 1
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = bitcast double* %8 to i64*
%10 = tail call i32 @rfftf1(i64 %0, double* %1, double* %2, double* %6, i64* %9)
br label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
unsigned int entryList(char *, char *, char **, unsigned int *);
unsigned int entryIsPresent(char *fileName, char *entry) {
  char bdl[100][100];
  unsigned int ls = 0;
  unsigned int status = entryList(fileName, entry, bdl, &ls);
  if (status) {
  }
  return ls;
}


x86 assembly (clang, -O0):
<entryIsPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2730,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x2724(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x2720(%rbp),%rdx
lea    -0x2724(%rbp),%rcx
call   1030 <entryList@plt>
mov    %eax,-0x2728(%rbp)
cmpl   $0x0,-0x2728(%rbp)
je     1160 <entryIsPresent+0x50>
jmp    1160 <entryIsPresent+0x50>
mov    -0x2724(%rbp),%eax
add    $0x2730,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entryIsPresent>:
sub    $0x2728,%rsp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <entryList@plt>
mov    0xc(%rsp),%eax
add    $0x2728,%rsp
ret

LLVM IR (-O0):
define i32 @entryIsPresent(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [100 x [100 x i8]]
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %6
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %5, i64 0, i64 0
%11 = bitcast [100 x i8]* %10 to i8**
%12 = call i32 @entryList(i8* %8, i8* %9, i8** %11, i32* %6)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
br label %16
16: ; preds = %15, %2
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
define i32 @entryIsPresent(i8* %0, i8* %1) {
%3 = alloca [100 x [100 x i8]]
%4 = alloca i32
%5 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %3, i64 0, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = bitcast [100 x [100 x i8]]* %3 to i8**
%8 = call i32 @entryList(i8* %0, i8* %1, i8** %7, i32* %4)
%9 = load i32, i32* %4
ret i32 %9
}
extern void native_restore_fl(unsigned long flags) {
  asm volatile("push %0 ; popf" : : "g"(flags) : "memory", "cc");
}


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

x86 assembly (clang, -O2):
<native_restore_fl>:
mov    %rdi,-0x8(%rsp)
push   -0x8(%rsp)
popf
ret

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

LLVM IR (-O2):
define void @native_restore_fl(i64 %0) {
tail call void asm sideeffect "push $0 ; popf", "imr,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
scalar_t__ futrts_isnan32(float);
float fsignum32(float x) { return futrts_isnan32(x) ? x : (x > 0) - (x < 0); }


x86 assembly (clang, -O0):
<fsignum32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <futrts_isnan32@plt>
cmp    $0x0,%rax
je     1140 <fsignum32+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    116e <fsignum32+0x5e>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsignum32>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <futrts_isnan32@plt>
test   %rax,%rax
je     1129 <fsignum32+0x19>
movss  0x4(%rsp),%xmm0
pop    %rax
ret
xorps  %xmm0,%xmm0
xor    %eax,%eax
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fsignum32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @futrts_isnan32(float %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %2
br label %17
8: ; preds = %1
%9 = load float, float* %2
%10 = fcmp ogt float %9, 0.000000e+00
%11 = zext i1 %10 to i32
%12 = load float, float* %2
%13 = fcmp olt float %12, 0.000000e+00
%14 = zext i1 %13 to i32
%15 = sub nsw i32 %11, %14
%16 = sitofp i32 %15 to float
br label %17
17: ; preds = %8, %6
%18 = phi float [ %7, %6 ], [ %16, %8 ]
ret float %18
}

LLVM IR (-O2):
define float @fsignum32(float %0) {
%2 = tail call i64 @futrts_isnan32(float %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = fcmp ogt float %0, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = fcmp olt float %0, 0.000000e+00
%8 = sext i1 %7 to i32
%9 = add nsw i32 %8, %6
%10 = sitofp i32 %9 to float
br label %11
11: ; preds = %1, %4
%12 = phi float [ %10, %4 ], [ %0, %1 ]
ret float %12
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ XA_ATOM;
int x_set_property(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                   int, int /*<<< orphan*/ const *, int);
int x_set_atom_property(Window window, Atom property, const Atom *prop,
                        int nr) {
  return x_set_property(window, XA_ATOM, property, 32, prop, nr);
}


x86 assembly (clang, -O0):
<x_set_atom_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    $0x20,%ecx
call   1030 <x_set_property@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_set_atom_property>:
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %esi,%edx
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%ecx
jmp    1030 <x_set_property@plt>

LLVM IR (-O0):
@XA_ATOM = global i32 0
define i32 @x_set_atom_property(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* @XA_ATOM
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = call i32 @x_set_property(i32 %9, i32 %10, i32 %11, i32 32, i32* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@XA_ATOM = global i32 0
define i32 @x_set_atom_property(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = load i32, i32* @XA_ATOM
%6 = tail call i32 @x_set_property(i32 %0, i32 %5, i32 %1, i32 32, i32* %2, i32 %3)
ret i32 %6
}
int Kit_WordCountOnes(unsigned uWord) {
  uWord = (uWord & 0x55555555) + ((uWord >> 1) & 0x55555555);
  uWord = (uWord & 0x33333333) + ((uWord >> 2) & 0x33333333);
  uWord = (uWord & 0x0F0F0F0F) + ((uWord >> 4) & 0x0F0F0F0F);
  uWord = (uWord & 0x00FF00FF) + ((uWord >> 8) & 0x00FF00FF);
  return (uWord & 0x0000FFFF) + (uWord >> 16);
}


x86 assembly (clang, -O0):
<Kit_WordCountOnes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_WordCountOnes>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33333333,%ecx
shr    $0x2,%eax
and    $0x33333333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7070707,%ecx
shr    $0x4,%eax
and    $0x7070707,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf000f,%ecx
shr    $0x8,%eax
and    $0xf000f,%eax
add    %ecx,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Kit_WordCountOnes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1431655765
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = add i32 %4, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = lshr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add i32 %10, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = and i32 %15, 252645135
%17 = load i32, i32* %2
%18 = lshr i32 %17, 4
%19 = and i32 %18, 252645135
%20 = add i32 %16, %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = and i32 %21, 16711935
%23 = load i32, i32* %2
%24 = lshr i32 %23, 8
%25 = and i32 %24, 16711935
%26 = add i32 %22, %25
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 65535
%29 = load i32, i32* %2
%30 = lshr i32 %29, 16
%31 = add i32 %28, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @Kit_WordCountOnes(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 117901063
%11 = lshr i32 %9, 4
%12 = and i32 %11, 117901063
%13 = add nuw nsw i32 %12, %10
%14 = and i32 %13, 983055
%15 = lshr i32 %13, 8
%16 = and i32 %15, 983055
%17 = add nuw nsw i32 %16, %14
%18 = and i32 %17, 31
%19 = lshr i32 %17, 16
%20 = add nuw nsw i32 %18, %19
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_result(char operator, double operand, double akkumulator, double q) {
  if (operator!= 'q') {
    printf("result so far is %lf\n", akkumulator);
  } else
    printf("final result is %lf\n\n", akkumulator);
}


x86 assembly (clang, -O0):
<print_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x71,%eax
je     1150 <print_result+0x40>
movsd  -0x18(%rbp),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1161 <print_result+0x51>
movsd  -0x18(%rbp),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_result>:
movaps %xmm1,%xmm0
cmp    $0x71,%dil
lea    0xef8(%rip),%rax
lea    0xedb(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"result so far is %lf\0A\00"
@.str.1 = [22 x i8] c"final result is %lf\0A\0A\00"
define void @print_result(i8 signext %0, double %1, double %2, double %3) {
%5 = alloca i8
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i8 %0, i8* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 113
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load double, double* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %13)
br label %18
15: ; preds = %4
%16 = load double, double* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %16)
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"result so far is %lf\0A\00"
@.str.1 = [22 x i8] c"final result is %lf\0A\0A\00"
define void @print_result(i8 signext %0, double %1, double %2, double %3) {
%5 = icmp eq i8 %0, 113
%6 = select i1 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, double %2)
ret void
}
/* Variables and functions */
int close(int);
int tcpClose(int fd) {
  int ret;
  if ((ret = close(fd)) != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tcpClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     113b <tcpClose+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1142 <tcpClose+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpClose>:
push   %rax
call   1030 <close@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @tcpClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp ne i32 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void bmp_test_print_passed(const char *name) {
  printf("%s\t\tPASSED!\n", name);
}


x86 assembly (clang, -O0):
<bmp_test_print_passed>:
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):
<bmp_test_print_passed>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09\09PASSED!\0A\00"
define void @bmp_test_print_passed(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deinit_main();
int init_main(int, char **);
int main(int argc, char **argv) {
  int retv = 0;
  ;
  retv = init_main(argc, argv);
  ;
  if (retv != 0)
    goto fini_error;
fini_error:
  deinit_main();
  return retv;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <init_main@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115b <main+0x3b>
jmp    1160 <main+0x40>
jmp    1160 <main+0x40>
mov    $0x0,%al
call   1030 <deinit_main@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1040 <init_main@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <deinit_main@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
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
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @init_main(i32 %7, i8** %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %12
%15 = call i32 (...) @deinit_main()
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init_main(i32 %0, i8** %1)
%4 = tail call i32 (...) @deinit_main()
ret i32 %3
}
/* Variables and functions */
char *getenv(char const *);
int /*<<< orphan*/ strncpy_s(char *, char const *, int);
void getenv_s(const char *name, char *pval, const char *def) {
  const char *val = getenv(name);
  if (!val)
    strncpy_s(pval, def, (128 + 1));
  else
    strncpy_s(pval, val, (128 + 1));
}


x86 assembly (clang, -O0):
<getenv_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1163 <getenv_s+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x81,%edx
call   1040 <strncpy_s@plt>
jmp    1175 <getenv_s+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x81,%edx
call   1040 <strncpy_s@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_s>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <getenv@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     113c <getenv_s+0x1c>
mov    %rax,%rsi
jmp    113f <getenv_s+0x1f>
mov    %r14,%rsi
mov    $0x81,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncpy_s@plt>

LLVM IR (-O0):
define void @getenv_s(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = call i8* @getenv(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %16, label %12
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strncpy_s(i8* %13, i8* %14, i32 129)
br label %20
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = load i8*, i8** %7
%19 = call i32 @strncpy_s(i8* %17, i8* %18, i32 129)
br label %20
20: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
define void @getenv_s(i8* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i8* @getenv(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @strncpy_s(i8* %1, i8* %2, i32 129)
br label %10
8: ; preds = %3
%9 = tail call i32 @strncpy_s(i8* %1, i8* %4, i32 129)
br label %10
10: ; preds = %8, %6
ret void
}
unsigned int cpuid_ecx(unsigned value) {
  unsigned int res, dummy;
  asm volatile("cpuid" : "=c"(res), "=a"(dummy) : "a"(value) : "ebx", "edx");
  return res;
}


x86 assembly (clang, -O0):
<cpuid_ecx>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %ecx,-0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ecx>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_ecx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm sideeffect "cpuid", "={cx},={ax},{ax},~{ebx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_ecx(i32 %0) {
%2 = tail call { i32, i32 } asm sideeffect "cpuid", "={cx},={ax},{ax},~{ebx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ driveRaw(int, int, int, int);
void drive(int speedForward, int speedTurn, int speedStrafe) {
  int speedFL = speedForward + speedTurn + speedStrafe;
  int speedBL = speedForward + speedTurn - speedStrafe;
  int speedFR = speedForward - speedTurn - speedStrafe;
  int speedBR = speedForward - speedTurn + speedStrafe;
  driveRaw(speedFL, speedBL, speedFR, speedBR);
}


x86 assembly (clang, -O0):
<drive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <driveRaw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drive>:
lea    (%rsi,%rdi,1),%r9d
lea    (%r9,%rdx,1),%r8d
sub    %edx,%r9d
sub    %esi,%edi
lea    (%rdi,%rdx,1),%ecx
mov    %edi,%eax
sub    %edx,%eax
mov    %r8d,%edi
mov    %r9d,%esi
mov    %eax,%edx
jmp    1030 <driveRaw@plt>

LLVM IR (-O0):
define void @drive(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = sub nsw i32 %18, %19
store i32 %20, i32* %8
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = sub nsw i32 %21, %22
%24 = load i32, i32* %6
%25 = sub nsw i32 %23, %24
store i32 %25, i32* %9
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = sub nsw i32 %26, %27
%29 = load i32, i32* %6
%30 = add nsw i32 %28, %29
store i32 %30, i32* %10
%31 = load i32, i32* %7
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = load i32, i32* %10
%35 = call i32 @driveRaw(i32 %31, i32 %32, i32 %33, i32 %34)
ret void
}

LLVM IR (-O2):
define void @drive(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = sub nsw i32 %4, %2
%7 = sub nsw i32 %0, %1
%8 = sub nsw i32 %7, %2
%9 = add nsw i32 %7, %2
%10 = tail call i32 @driveRaw(i32 %5, i32 %6, i32 %8, i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int phSetRecLevel(int cid, int level) {
  char reqbuf[32];
  snprintf(reqbuf, sizeof(reqbuf), "SETLVL CID=%d L=%d", cid, level);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phSetRecLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x20,%esi
lea    0xebb(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phSetRecLevel>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%r8d
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"SETLVL CID=%d L=%d\00"
define i32 @phSetRecLevel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [32 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %6, i32 32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = call i32 @ph_rpc(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"SETLVL CID=%d L=%d\00"
define i32 @phSetRecLevel(i32 %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @ph_rpc(i8* %4)
ret i32 %6
}
/* Variables and functions */
scalar_t__ ft_islower(int);
scalar_t__ ft_isupper(int);
int ft_isalpha(int c) { return (ft_islower(c) || ft_isupper(c)); }


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_islower@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <ft_isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1040 <ft_isupper@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):
<ft_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_islower@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ft_isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <ft_isupper@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = tail call i64 @ft_islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ft_isupper(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int test_mul2OK(int x) {
  if ((x + x) / 2 != x)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<test_mul2OK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%eax
je     112a <test_mul2OK+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1131 <test_mul2OK+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_mul2OK(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int ntohs(int);
void put_unaligned_u16(uint16_t *p_, uint16_t x_) {
  uint8_t *p = (uint8_t *)p_;
  uint16_t x = ntohs(x_);
  p[0] = x >> 8;
  p[1] = x;
}


x86 assembly (clang, -O0):
<put_unaligned_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_unaligned_u16>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <ntohs@plt>
mov    %eax,%ecx
sar    $0x8,%ecx
mov    %ecx,(%rbx)
mov    %eax,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @put_unaligned_u16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = call i32 @ntohs(i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = ashr i32 %10, 8
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
%14 = load i32, i32* %6
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
ret void
}

LLVM IR (-O2):
define void @put_unaligned_u16(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @ntohs(i32 %1)
%4 = ashr i32 %3, 8
store i32 %4, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %5
ret void
}
void g_hook_find_data() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_find_data() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c;
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  c = 0;
  while (x > 0) {
    while (y > 0) {
      y = y - 1;
      c = c + 1;
    }
    x = x - 1;
    c = c + 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,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1181 <main+0x71>
jmp    1149 <main+0x39>
cmpl   $0x0,-0x10(%rbp)
jle    116a <main+0x5a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x39>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <main+0x2a>
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
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
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %4
store i32 0, i32* %2
br label %7
7: ; preds = %19, %0
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %7
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %11
19: ; preds = %11
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %7
24: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void help_and_exit() {
  printf("See man page for help.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<help_and_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help_and_exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"See man page for help.\0A\00"
define void @help_and_exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"See man page for help.\00"
define void @help_and_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
long max(long v1, long v2) { return v1 > v2 ? v1 : v2; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(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 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int INT64_MIN;
int64_t __hsail_rem_s64(int64_t dividend, int64_t divisor) {
  if (dividend == INT64_MIN && divisor == -1)
    return 0;
  else
    return dividend % divisor;
}


x86 assembly (clang, -O0):
<__hsail_rem_s64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed4(%rip),%rcx
cmp    (%rcx),%eax
jne    1132 <__hsail_rem_s64+0x32>
cmpl   $0xffffffff,-0xc(%rbp)
jne    1132 <__hsail_rem_s64+0x32>
movl   $0x0,-0x4(%rbp)
jmp    113c <__hsail_rem_s64+0x3c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_rem_s64>:
cmp    $0xffffffff,%esi
jne    1113 <__hsail_rem_s64+0x13>
mov    0x2edc(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
jne    1113 <__hsail_rem_s64+0x13>
ret
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
@INT64_MIN = global i32 0
define i32 @__hsail_rem_s64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* @INT64_MIN
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %3
br label %17
13: ; preds = %9, %2
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = srem i32 %14, %15
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@INT64_MIN = global i32 0
define i32 @__hsail_rem_s64(i32 %0, i32 %1) {
%3 = load i32, i32* @INT64_MIN
%4 = icmp eq i32 %3, %0
%5 = icmp eq i32 %1, -1
%6 = and i1 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = srem i32 %0, %1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ 0, %2 ]
ret i32 %10
}
void test11() {}


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

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

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

LLVM IR (-O2):
define void @test11() {
ret void
}
void RTLatin1CalcUtf16Len(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLatin1CalcUtf16Len() {
ret void
}
int _ioSetSocketAccess(int enable) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_ioSetSocketAccess(i32 %0) {
ret i32 1
}
void network_event_record(unsigned int type, void *data, unsigned int size) {}


x86 assembly (clang, -O0):
<network_event_record>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @network_event_record(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @network_event_record(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void xxerr(char *x) { write(2, x, strlen(x)); }


x86 assembly (clang, -O0):
<xxerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxerr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @xxerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @xxerr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
int isspace(int ch) {
  switch (ch) {
  case ' ':
  case '\f':
  case '\n':
  case '\r':
  case '\t':
  case '\v':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     112f <isspace+0x2f>
jmp    111e <isspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113b <isspace+0x3b>
jmp    112f <isspace+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1142 <isspace+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 32, label %5
i32 12, label %5
i32 10, label %5
i32 13, label %5
i32 9, label %5
i32 11, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 12, label %3
i32 10, label %3
i32 13, label %3
i32 9, label %3
i32 11, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ diminuto_fd_read_generic(int, void *, size_t, size_t);
ssize_t diminuto_ipc_stream_read_generic(int fd, void *buffer, size_t min,
                                         size_t max) {
  return diminuto_fd_read_generic(fd, buffer, min, max);
}


x86 assembly (clang, -O0):
<diminuto_ipc_stream_read_generic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <diminuto_fd_read_generic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_ipc_stream_read_generic>:
jmp    1030 <diminuto_fd_read_generic@plt>

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

LLVM IR (-O2):
define i32 @diminuto_ipc_stream_read_generic(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = tail call i32 @diminuto_fd_read_generic(i32 %0, i8* %1, i64 %2, i64 %3)
ret i32 %5
}
int HPCC_external_init(int argc, char *argv[], void *extdata) { return 0; }


x86 assembly (clang, -O0):
<HPCC_external_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @HPCC_external_init(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @HPCC_external_init(i32 %0, i8** nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ randval(int);
int xdx(int dice, int sides) {
  int n = 0;
  for (int i = 0; i < dice; i++)
    n += randval(sides) + 1;
  return n;
}


x86 assembly (clang, -O0):
<xdx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <xdx+0x4f>
mov    -0x8(%rbp),%edi
call   1030 <randval@plt>
mov    %rax,%rcx
add    $0x1,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112c <xdx+0x1c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdx>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1134 <xdx+0x24>
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
nop
mov    %r14d,%edi
call   1030 <randval@plt>
add    %eax,%ebx
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1120 <xdx+0x10>
jmp    1136 <xdx+0x26>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @xdx(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %5
6: ; preds = %2, %6
%7 = phi i32 [ %13, %6 ], [ 0, %2 ]
%8 = phi i32 [ %12, %6 ], [ 0, %2 ]
%9 = tail call i64 @randval(i32 %1)
%10 = trunc i64 %9 to i32
%11 = add i32 %8, 1
%12 = add i32 %11, %10
%13 = add nuw nsw i32 %7, 1
%14 = icmp eq i32 %13, %0
br i1 %14, label %4, label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void safe_fclose(FILE *file) {
  if (file != NULL)
    fclose(file);
}


x86 assembly (clang, -O0):
<safe_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <safe_fclose+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @safe_fclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @safe_fclose(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fclose(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
float convertir(int);
int /*<<< orphan*/ printf(char *, int, float);
main() {
  int nGradosCentigrados = 0;
  int incremento = 3;
  float GradosFahrenheit = 0;
  nGradosCentigrados = -50;
  while (nGradosCentigrados <= 50) {
    GradosFahrenheit = convertir(nGradosCentigrados);
    printf("%10d C %10.2f F\n", nGradosCentigrados, GradosFahrenheit);
    nGradosCentigrados += incremento;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0xffffffce,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jg     1185 <main+0x65>
mov    -0x8(%rbp),%edi
call   1030 <convertir@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
movss  -0x10(%rbp),%xmm0
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffcb,%ebx
lea    0xed0(%rip),%r14
add    $0x3,%ebx
mov    %ebx,%edi
call   1030 <convertir@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
cmp    $0x30,%ebx
jl     1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%10d C %10.2f F\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store i32 3, i32* %3
store float 0.000000e+00, float* %4
store i32 -50, i32* %2
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 50
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call float @convertir(i32 %9)
store float %10, float* %4
%11 = load i32, i32* %2
%12 = load float, float* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, float %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = add nsw i32 %15, %14
store i32 %16, i32* %2
br label %5
17: ; preds = %5
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [17 x i8] c"%10d C %10.2f F\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -50, %0 ], [ %5, %1 ]
%3 = tail call float @convertir(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, float %3)
%5 = add nsw i32 %2, 3
%6 = icmp slt i32 %2, 48
br i1 %6, label %1, label %7
7: ; preds = %1
ret i32 0
}