xunge/DecIR huggingface dataset:
char lookupchar(int hex) {
  if (hex >= ' ' && hex <= '~') {
    return (char)hex;
  }
  return ' ';
}


x86 assembly (clang, -O0):
<lookupchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1126 <lookupchar+0x26>
cmpl   $0x7e,-0x8(%rbp)
jg     1126 <lookupchar+0x26>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
jmp    112a <lookupchar+0x2a>
movb   $0x20,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookupchar>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%eax
mov    $0x20,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lookupchar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %13
12: ; preds = %6, %1
store i8 32, i8* %2
br label %13
13: ; preds = %12, %9
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @lookupchar(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = trunc i32 %0 to i8
%5 = select i1 %3, i8 %4, i8 32
ret i8 %5
}
int bad_names(void) {
  int globals = 3;
  int myvars = 3;
  int P = 4;
  int A = 4;
  int B = 4;
  int R = 5;
  int L1_skip = 5;
  int L2_skip = 6;
  int L1_modify = 7;
  int L2_modify = 8;
  int adglobs_addr = 4;
  return globals + P + R + A + B + myvars + L1_skip + L2_skip + L1_modify +
         L2_modify + adglobs_addr;
}


x86 assembly (clang, -O0):
<bad_names>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
movl   $0x5,-0x1c(%rbp)
movl   $0x6,-0x20(%rbp)
movl   $0x7,-0x24(%rbp)
movl   $0x8,-0x28(%rbp)
movl   $0x4,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
add    -0x2c(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bad_names() {
ret i32 53
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char *argv[]) {
  for (unsigned i = 0; i < argc; ++i)
    printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1156 <main+0x46>
mov    -0x14(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1141 <main+0x31>
mov    %edi,%ebx
xor    %ebp,%ebp
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %14, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %6
%16 = add i32 %15, 1
store i32 %16, i32* %6
br label %7
17: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret i32 0
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %4, label %5
}
double media_ponderada(double v[]) {
  return (v[0] * 2 + v[1] * 3 + v[2] * 5) / 10;
}


x86 assembly (clang, -O0):
<media_ponderada>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0xef4(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
addsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xece(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<media_ponderada>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm2
mulsd  0xeef(%rip),%xmm2
addsd  %xmm1,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0xee6(%rip),%xmm0
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
divsd  0xede(%rip),%xmm0
ret

LLVM IR (-O0):
define double @media_ponderada(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = fmul double %8, 3.000000e+00
%10 = call double @llvm.fmuladd.f64(double %5, double 2.000000e+00, double %9)
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 2
%13 = load double, double* %12
%14 = call double @llvm.fmuladd.f64(double %13, double 5.000000e+00, double %10)
%15 = fdiv double %14, 1.000000e+01
ret double %15
}

LLVM IR (-O2):
define double @media_ponderada(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, 3.000000e+00
%6 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double 5.000000e+00, double %6)
%10 = fdiv double %9, 1.000000e+01
ret double %10
}
/* Variables and functions */
double DaylightSavingTA(double);
double LocalTZA();
double LocalTime(double utc) {
  return utc + LocalTZA() + DaylightSavingTA(utc);
}


x86 assembly (clang, -O0):
<LocalTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <LocalTZA@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <DaylightSavingTA@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LocalTime>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <LocalTZA@plt>
movapd %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
call   1040 <DaylightSavingTA@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @LocalTime(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double (...) @LocalTZA()
%5 = fadd double %3, %4
%6 = load double, double* %2
%7 = call double @DaylightSavingTA(double %6)
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @LocalTime(double %0) {
%2 = tail call double (...) @LocalTZA()
%3 = fadd double %2, %0
%4 = tail call double @DaylightSavingTA(double %0)
%5 = fadd double %3, %4
ret double %5
}
/* Variables and functions */
char *_crypt_blowfish_rn(char const *, char const *, char *, int);
char *crypt_rn(const char *key, const char *setting, void *data, int size) {
  return _crypt_blowfish_rn(key, setting, (char *)data, size);
}


x86 assembly (clang, -O0):
<crypt_rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <_crypt_blowfish_rn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_rn>:
jmp    1030 <_crypt_blowfish_rn@plt>

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

LLVM IR (-O2):
define i8* @crypt_rn(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @_crypt_blowfish_rn(i8* %0, i8* %1, i8* %2, i32 %3)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __mode_t;
typedef int /*<<< orphan*/ __dev_t;

/* Variables and functions */
int __xmknodat(int, int, char const *, int /*<<< orphan*/,
               int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int
softboundmpx___xmknodat(int __ver, int __fd, const char *__path,
                        __mode_t __mode, __dev_t *__dev) {
  return __xmknodat(__ver, __fd, __path, __mode, __dev);
}


x86 assembly (clang, -O0):
<softboundmpx___xmknodat>:
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    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <__xmknodat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx___xmknodat>:
jmp    1030 <__xmknodat@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx___xmknodat(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4) {
%6 = tail call i32 @__xmknodat(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4)
ret i32 %6
}
void setRegHi(int *context, int reg_hi) { *(context + 5) = reg_hi; }


x86 assembly (clang, -O0):
<setRegHi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setRegHi>:
mov    %esi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @setRegHi(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 5
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @setRegHi(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int log2f(float);
float testimg_val_to_log(const float val) {
  return 1.0f - log2f(1.0f / val) / 15;
}


x86 assembly (clang, -O0):
<testimg_val_to_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
call   1030 <log2f@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
movss  0xebd(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testimg_val_to_log>:
push   %rax
movss  0xee7(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <log2f@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x3,%eax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0xeb3(%rip),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @testimg_val_to_log(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 1.000000e+00, %3
%5 = call i32 @log2f(float %4)
%6 = sdiv i32 %5, 15
%7 = sitofp i32 %6 to float
%8 = fsub float 1.000000e+00, %7
ret float %8
}

LLVM IR (-O2):
define float @testimg_val_to_log(float %0) {
%2 = fdiv float 1.000000e+00, %0
%3 = tail call i32 @log2f(float %2)
%4 = sdiv i32 %3, 15
%5 = sitofp i32 %4 to float
%6 = fsub float 1.000000e+00, %5
ret float %6
}
void SPIDataGet(unsigned long ulBase, unsigned long *pulData) {
  while (!((*((volatile unsigned long *)(ulBase + 0x00000130))) & 0x00000001)) {
  }
  *pulData = (*((volatile unsigned long *)(ulBase + 0x0000013C)));
}


x86 assembly (clang, -O0):
<SPIDataGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x130(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1131 <SPIDataGet+0x31>
jmp    1136 <SPIDataGet+0x36>
jmp    110c <SPIDataGet+0xc>
mov    -0x8(%rbp),%rax
mov    0x13c(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIDataGet>:
testq  $0x1,0x130(%rdi)
je     1100 <SPIDataGet>
mov    0x13c(%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @SPIDataGet(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
br label %5
5: ; preds = %13, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 304
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 1
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i64, i64* %3
%16 = add i64 %15, 316
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = load i64*, i64** %4
store i64 %18, i64* %19
ret void
}

LLVM IR (-O2):
define void @SPIDataGet(i64 %0, i64* nocapture writeonly %1) {
%3 = add i64 %0, 304
%4 = inttoptr i64 %3 to i64*
br label %5
5: ; preds = %5, %2
%6 = load volatile i64, i64* %4
%7 = and i64 %6, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = add i64 %0, 316
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
store i64 %12, i64* %1
ret void
}
int fun870() { return 870; }


x86 assembly (clang, -O0):
<fun870>:
push   %rbp
mov    %rsp,%rbp
mov    $0x366,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun870() {
ret i32 870
}

LLVM IR (-O2):
define i32 @fun870() {
ret i32 870
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned char);
void _check_err(unsigned char res_val, char *func_name) {
  if (res_val) {
    printf("[test-ERROR] error code from %s: %d\n", func_name, res_val);
  } else {
  }
  return;
}


x86 assembly (clang, -O0):
<_check_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1145 <_check_err+0x35>
mov    -0x10(%rbp),%rsi
lea    0xec9(%rip),%rdi
movzbl -0x1(%rbp),%edx
call   1030 <printf@plt>
jmp    114a <_check_err+0x3a>
jmp    114a <_check_err+0x3a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_err>:
test   %edi,%edi
je     1124 <_check_err+0x14>
movzbl %dil,%edx
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [37 x i8] c"[test-ERROR] error code from %s: %d\0A\00"
define void @_check_err(i8 zeroext %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 = icmp ne i8 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %8, i8 zeroext %9)
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"[test-ERROR] error code from %s: %d\0A\00"
define void @_check_err(i8 zeroext %0, i8* %1) {
%3 = icmp eq i8 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1, i8 zeroext %0)
br label %6
6: ; preds = %2, %4
ret void
}
int proov(int x) {
  int a;
  a = 0;
  switch (x) {
  case 1:
    a++;
    break;
  case 2:
    a += 2;
    break;
  case 3:
    a += 7;
    break;
  default:
    a--;
  }
  return a;
}


x86 assembly (clang, -O0):
<proov>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1144 <proov+0x44>
jmp    1122 <proov+0x22>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1152 <proov+0x52>
jmp    1133 <proov+0x33>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1160 <proov+0x60>
jmp    116e <proov+0x6e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1177 <proov+0x77>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1177 <proov+0x77>
mov    -0x8(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x8(%rbp)
jmp    1177 <proov+0x77>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proov>:
add    $0xffffffff,%edi
mov    $0xffffffff,%eax
cmp    $0x2,%edi
ja     111a <proov+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.proov = [3 x i32] [i32 1, i32 2, i32 7]
define i32 @proov(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.proov, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t alignsize(uint64_t sz, uint32_t align) {
  return (sz + (align - 1)) & ~(align - 1);
}


x86 assembly (clang, -O0):
<alignsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignsize>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
neg    %esi
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @alignsize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = add nsw i32 %5, %7
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = xor i32 %10, -1
%12 = and i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @alignsize(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %4, %5
ret i32 %6
}
int modify_x(int *ip) {
  *ip = 2;
  return *ip / 2;
}


x86 assembly (clang, -O0):
<modify_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<modify_x>:
movl   $0x2,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @modify_x(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 2, i32* %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @modify_x(i32* nocapture writeonly %0) {
store i32 2, i32* %0
ret i32 1
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *allocateZero(size_t size, size_t num) { return calloc(num, size); }


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

x86 assembly (clang, -O2):
<allocateZero>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @allocateZero(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %1, i64 %0)
ret i8* %3
}
const char *filestress00_get_title(void) { return "File stress test 00"; }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"File stress test 00\00"
define i8* @filestress00_get_title() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [20 x i8] c"File stress test 00\00"
define i8* @filestress00_get_title() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void fatal(char *str) {
  perror(str);
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int read_array_size(void *, int /*<<< orphan*/);
int read_array_size_new(void *array) { return read_array_size(array, 0); }


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

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

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

LLVM IR (-O2):
define i32 @read_array_size_new(i8* %0) {
%2 = tail call i32 @read_array_size(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errprintf(char *, char const *, char *);
int /*<<< orphan*/ exit(int);
char *strerror(int /*<<< orphan*/);
void fatal_error(const char *syscall) {
  char *errmsg = strerror(errno);
  errprintf("Error: (%s) %s\n", syscall, errmsg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rdi
call   1030 <errprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@errno = global i32 0
@.str = [16 x i8] c"Error: (%s) %s\0A\00"
define void @fatal_error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @errprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
char *create_string(int length, char init) {
  char *str = (char *)malloc(sizeof(char) * (length + 1));
  int i;
  for (i = 0; i < length; i++) {
    str[i] = init;
  }
  str[length] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<create_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1167 <create_string+0x57>
mov    -0x5(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <create_string+0x2f>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_string>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1145 <create_string+0x25>
mov    %ebx,%edx
movzbl %bpl,%esi
mov    %r14,%rdi
call   1030 <memset@plt>
movslq %ebx,%rax
movb   $0x0,(%r14,%rax,1)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @create_string(i32 %0, i8 signext %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %7, %2
%10 = sext i32 %0 to i64
%11 = getelementptr inbounds i8, i8* %5, i64 %10
store i8 0, i8* %11
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_addLn() {
  CALC_appendString("ln");
  CALC_appendString("(");
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"ln\00"
@.str.1 = [2 x i8] c"(\00"
define void @CALC_addLn() {
%1 = call i32 @CALC_appendString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ln\00"
@.str.1 = [2 x i8] c"(\00"
define void @CALC_addLn() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sscanf(char const *, char *, double *);
int iupStrToDouble(const char *str, double *d) {
  if (!str)
    return 0;
  if (sscanf(str, "%lf", d) != 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<iupStrToDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <iupStrToDouble+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1167 <iupStrToDouble+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeba(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1160 <iupStrToDouble+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1167 <iupStrToDouble+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrToDouble>:
test   %rdi,%rdi
je     1134 <iupStrToDouble+0x24>
push   %rax
mov    %rsi,%rdx
lea    0xee0(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @iupStrToDouble(i8* %0, double* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ kfree(void *, unsigned int);
void mfree(void *ptr, unsigned int size) { kfree(ptr, size); }


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

x86 assembly (clang, -O2):
<mfree>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
define void @mfree(i8* %0, i32 %1) {
%3 = tail call i32 @kfree(i8* %0, i32 %1)
ret void
}
void atomic_max(double *data, double val) {
  if (*data >= val)
    return;
  union {
    double dv;
    long lv;
  } old;
  union {
    double dv;
    long lv;
  } new;
  while (1) {
    old.lv = *(volatile long *)data;
    new.dv = val;
    if (__sync_bool_compare_and_swap(((volatile long *)data), (old.lv),
                                     (new.lv)))
      break;
  }
  return;
}


x86 assembly (clang, -O0):
<atomic_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1125 <atomic_max+0x25>
jmp    1172 <atomic_max+0x72>
jmp    112a <atomic_max+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
mov    %rax,%rcx
sete   %al
test   $0x1,%al
jne    1163 <atomic_max+0x63>
jmp    1168 <atomic_max+0x68>
jmp    116d <atomic_max+0x6d>
jmp    112a <atomic_max+0x2a>
jmp    1172 <atomic_max+0x72>
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_max>:
movsd  (%rdi),%xmm1
ucomisd %xmm0,%xmm1
jae    111a <atomic_max+0x1a>
movq   %xmm0,%rcx
nop
mov    (%rdi),%rax
lock cmpxchg %rcx,(%rdi)
jne    1110 <atomic_max+0x10>
ret

LLVM IR (-O0):
%union.anon = type { double }
%union.anon.0 = type { double }
define void @atomic_max(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
%5 = alloca %union.anon
%6 = alloca %union.anon.0
store double* %0, double** %3
store double %1, double* %4
%7 = load double*, double** %3
%8 = load double, double* %7
%9 = load double, double* %4
%10 = fcmp oge double %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
br label %31
12: ; preds = %2
br label %13
13: ; preds = %12, %29
%14 = load double*, double** %3
%15 = bitcast double* %14 to i64*
%16 = load volatile i64, i64* %15
%17 = bitcast %union.anon* %5 to i64*
store i64 %16, i64* %17
%18 = load double, double* %4
%19 = bitcast %union.anon.0* %6 to double*
store double %18, double* %19
%20 = load double*, double** %3
%21 = bitcast double* %20 to i64*
%22 = bitcast %union.anon* %5 to i64*
%23 = load i64, i64* %22
%24 = bitcast %union.anon.0* %6 to i64*
%25 = load i64, i64* %24
%26 = cmpxchg i64* %21, i64 %23, i64 %25 seq_cst seq_cst
%27 = extractvalue { i64, i1 } %26, 1
br i1 %27, label %28, label %29
28: ; preds = %13
br label %30
29: ; preds = %13
br label %13
30: ; preds = %28
br label %31
31: ; preds = %30, %11
ret void
}

LLVM IR (-O2):
define void @atomic_max(double* %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ult double %3, %1
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = bitcast double* %0 to i64*
%7 = bitcast double %1 to i64
br label %8
8: ; preds = %5, %8
%9 = load volatile i64, i64* %6
%10 = cmpxchg i64* %6, i64 %9, i64 %7 seq_cst seq_cst
%11 = extractvalue { i64, i1 } %10, 1
br i1 %11, label %12, label %8
12: ; preds = %8, %2
ret void
}
void gdk_x11_ungrab_server() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_ungrab_server() {
ret void
}
void SteamAPI_vr_void_AttachToWindow(void *self, void *hWnd) {
  xlogf("%s(self = %p, hWnd = %p)\n", __func__, self, hWnd);
}


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

x86 assembly (clang, -O2):
<SteamAPI_vr_void_AttachToWindow>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xef6(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"%s(self = %p, hWnd = %p)\0A\00"
@__func__.SteamAPI_vr_void_AttachToWindow = [32 x i8] c"SteamAPI_vr_void_AttachToWindow\00"
define void @SteamAPI_vr_void_AttachToWindow(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @__func__.SteamAPI_vr_void_AttachToWindow, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s(self = %p, hWnd = %p)\0A\00"
@__func__.SteamAPI_vr_void_AttachToWindow = [32 x i8] c"SteamAPI_vr_void_AttachToWindow\00"
define void @SteamAPI_vr_void_AttachToWindow(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @__func__.SteamAPI_vr_void_AttachToWindow, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ encoder_preinit();
int encoder_init(void) {
  encoder_preinit();
  return -1;
}


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

x86 assembly (clang, -O2):
<encoder_init>:
push   %rax
xor    %eax,%eax
call   1030 <encoder_preinit@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @encoder_init() {
%1 = tail call i32 (...) @encoder_preinit()
ret i32 -1
}
int sb_any_quota_suspended(struct super_block *sb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @sb_any_quota_suspended(%struct.super_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void handler(int sig) { exit(8); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x8,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    $0x8,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 8)
unreachable
}

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 @exit(i32 8)
unreachable
}
void capturingPosahead2CAPTURING_POSAHEAD() {}


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

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

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

LLVM IR (-O2):
define void @capturingPosahead2CAPTURING_POSAHEAD() {
ret void
}
/* Variables and functions */
unsigned long geti();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test567(int, unsigned long);
void test7(void) {
  unsigned long seed;
  printf("Beginning malloc test 7\n");
  printf("Enter random seed: ");
  seed = geti();
  test567(7, seed);
}


x86 assembly (clang, -O0):
<test7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <geti@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x7,%edi
call   1030 <test567@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <geti@plt>
mov    $0x7,%edi
mov    %rax,%rsi
pop    %rax
jmp    1040 <test567@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Beginning malloc test 7\0A\00"
@.str.1 = [20 x i8] c"Enter random seed: \00"
define void @test7() {
%1 = alloca i64
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i64 (...) @geti()
store i64 %4, i64* %1
%5 = load i64, i64* %1
%6 = call i32 @test567(i32 7, i64 %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"Enter random seed: \00"
@str = [24 x i8] c"Beginning malloc test 7\00"
define void @test7() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 (...) @geti()
%4 = tail call i32 @test567(i32 7, i64 %3)
ret void
}
/* Variables and functions */
int api3(int, int, int, int);
int scroll_surface(int sid, int cx, int cy) { return api3(1007, sid, cx, cy); }


x86 assembly (clang, -O0):
<scroll_surface>:
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
mov    $0x3ef,%edi
call   1030 <api3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scroll_surface>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x3ef,%edi
jmp    1030 <api3@plt>

LLVM IR (-O0):
define i32 @scroll_surface(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 @api3(i32 1007, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @scroll_surface(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @api3(i32 1007, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void fill_buffer(void *buffer, int c, size_t len) { memset(buffer, c, len); }


x86 assembly (clang, -O0):
<fill_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_buffer>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @fill_buffer(i8* %0, i32 %1, i64 %2) {
%4 = tail call i32 @memset(i8* %0, i32 %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int);
scalar_t__ isprint(int);
int /*<<< orphan*/ isspace(int);
int ispunct(int ch) { return (isprint(ch) && !isalnum(ch) && !isspace(ch)); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%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):
<ispunct>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <isprint@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115a <ispunct+0x2a>
mov    %ebp,%edi
call   1030 <isalnum@plt>
test   %eax,%eax
jne    115a <ispunct+0x2a>
mov    %ebp,%edi
call   1040 <isspace@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isprint(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isalnum(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @isspace(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @isalnum(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @isspace(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_ia64_bsp();
uintptr_t get_bsp(void) { return (uintptr_t)__builtin_ia64_bsp(); }


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

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

LLVM IR (-O0):
define i64 @get_bsp() {
%1 = call i32 (...) @__builtin_ia64_bsp()
%2 = sext i32 %1 to i64
ret i64 %2
}

LLVM IR (-O2):
define i64 @get_bsp() {
%1 = tail call i32 (...) @__builtin_ia64_bsp()
%2 = sext i32 %1 to i64
ret i64 %2
}
char *RCSid() {
  return RCSid("$Id: unset.c,v 1.149.2.3 2013/09/11 23:38:38 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"$Id: unset.c,v 1.149.2.3 2013/09/11 23:38:38 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int main(void) { f1(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
ret i32 0
}