xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ digit(char);
bool hex(char c) { return digit(c) || ((c >= 'A') && (c <= 'F')); }


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <digit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115e <hex+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1158 <hex+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
push   %rbx
mov    %edi,%ebx
call   1030 <digit@plt>
test   %rax,%rax
setne  %al
lea    -0x41(%rbx),%ecx
cmp    $0x6,%cl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @digit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 65
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 70
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @hex(i8 signext %0) {
%2 = tail call i64 @digit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 6
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
char *fcvt(double, int, int *, int *);
char *c_fcvt(double arg0, int arg1, int *arg2, int *arg3) {
  return fcvt(arg0, arg1, arg2, arg3);
}


x86 assembly (clang, -O0):
<c_fcvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <fcvt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fcvt>:
jmp    1030 <fcvt@plt>

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

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

/* Variables and functions */
unsigned char *haval256_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_haval256(unsigned char *out, FILE *fp) {
  return haval256_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_haval256>:
jmp    1030 <haval256_file@plt>

LLVM IR (-O0):
define i8* @hash_file_haval256(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 i8* @haval256_file(i8* %5, i32* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @hash_file_haval256(i8* %0, i32* %1) {
%3 = tail call i8* @haval256_file(i8* %0, i32* %1)
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap32_b(uint32_t in) {
  uint32_t a;
  a = (in << 16) | (in >> 16);
  a = ((a & 0x00ff00ff) << 8) | ((a & 0xff00ff00) >> 8);
  return a;
}


x86 assembly (clang, -O0):
<swap32_b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32_b>:
mov    %edi,%eax
shl    $0x10,%eax
sar    $0x10,%edi
or     %edi,%eax
bswap  %eax
ror    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @swap32_b(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = or i32 %5, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = and i32 %9, 16711935
%11 = shl i32 %10, 8
%12 = load i32, i32* %3
%13 = and i32 %12, -16711936
%14 = lshr i32 %13, 8
%15 = or i32 %11, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @swap32_b(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr i32 %0, 16
%4 = or i32 %2, %3
%5 = shl i32 %4, 8
%6 = and i32 %5, -16711936
%7 = lshr i32 %4, 8
%8 = and i32 %7, 16711935
%9 = or i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ MD5(unsigned char const *, size_t, unsigned char *);
int crypto_md5_generate(unsigned char *hash, const unsigned char *text,
                        size_t len) {
  if (!MD5(text, len, hash)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<crypto_md5_generate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <MD5@plt>
cmp    $0x0,%eax
jne    114a <crypto_md5_generate+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <crypto_md5_generate+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_md5_generate>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <MD5@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @crypto_md5_generate(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @MD5(i8* %1, i64 %2, i8* %0)
%5 = icmp eq i32 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
int am_close_index_scan(int scandesc) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @am_close_index_scan(i32 %0) {
ret i32 -1
}
long double test_fminl(long double x, long double y) {
  return __builtin_fminl(x, y);
}


x86 assembly (clang, -O0):
<test_fminl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fminl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fminl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <fminl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @test_fminl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @llvm.minnum.f80(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @test_fminl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @llvm.minnum.f80(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
void TOSH_wait_250ns(void) {
  asm("nop");
  asm("nop");
  asm("nop");
  asm("nop");
}


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

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

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

LLVM IR (-O2):
define void @TOSH_wait_250ns() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ toupper(int);
char *uppercase(char *s) {
  while (*s) {
    *s = (char)toupper((int)*s);
    s++;
  }
  return s;
}


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

x86 assembly (clang, -O2):
<uppercase>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <uppercase+0x26>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uppercase+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @uppercase(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @toupper(i32 %7)
%9 = trunc i64 %8 to i8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
void RTPathAbsExDup(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathAbsExDup() {
ret void
}
double area(double radius) { return 3.1416 * radius * radius; }


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @area(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.141600e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @area(double %0) {
%2 = fmul double %0, 3.141600e+00
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
int main() {
  float x;
  float y;
  float z;
  scanf("%f%f%f", &x, &y, &z);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%f%f%f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tempnam(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  tempnam(NULL, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <tempnam@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @tempnam(i32* null, i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @tempnam(i32* null, i32* null)
ret i32 0
}
int bytes_needed(int bit_len) {
  int cnt;
  if (bit_len <= 28)
    cnt = (bit_len - 1) / 7 + 1;
  else
    cnt = (bit_len - 1) / 8 + 2;
  return cnt;
}


x86 assembly (clang, -O0):
<bytes_needed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1c,-0x4(%rbp)
jg     112a <bytes_needed+0x2a>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <bytes_needed+0x3e>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_needed>:
lea    -0x1(%rdi),%eax
cmp    $0x1c,%edi
jg     1126 <bytes_needed+0x26>
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0x1,%eax
ret
shr    $0x3,%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @bytes_needed(i32 %0) {
%2 = icmp slt i32 %0, 29
%3 = add nsw i32 %0, -1
br i1 %2, label %4, label %7
4: ; preds = %1
%5 = sdiv i32 %3, 7
%6 = add nsw i32 %5, 1
br label %10
7: ; preds = %1
%8 = lshr i32 %3, 3
%9 = add nuw nsw i32 %8, 2
br label %10
10: ; preds = %7, %4
%11 = phi i32 [ %6, %4 ], [ %9, %7 ]
ret i32 %11
}
int level_to_pers(int level) {
  switch (level) {
  case (-4):
    return 7UL;
  case -3:
    return 6UL;
  case -2:
    return 5UL;
  case (-1):
    return 1UL;
  case 0:
    return 2UL;
  case 1:
    return 3UL;
  case 4:
  case 5:
    return 4UL;
  }
  return 0UL;
}


x86 assembly (clang, -O0):
<level_to_pers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     1184 <level_to_pers+0x84>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x7,-0x4(%rbp)
jmp    118b <level_to_pers+0x8b>
movl   $0x6,-0x4(%rbp)
jmp    118b <level_to_pers+0x8b>
movl   $0x5,-0x4(%rbp)
jmp    118b <level_to_pers+0x8b>
movl   $0x1,-0x4(%rbp)
jmp    118b <level_to_pers+0x8b>
movl   $0x2,-0x4(%rbp)
jmp    118b <level_to_pers+0x8b>
movl   $0x3,-0x4(%rbp)
jmp    118b <level_to_pers+0x8b>
movl   $0x4,-0x4(%rbp)
jmp    118b <level_to_pers+0x8b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<level_to_pers>:
add    $0x4,%edi
xor    %eax,%eax
cmp    $0x9,%edi
ja     1117 <level_to_pers+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.level_to_pers = [10 x i32] [i32 7, i32 6, i32 5, i32 1, i32 2, i32 3, i32 0, i32 0, i32 4, i32 4]
define i32 @level_to_pers(i32 %0) {
%2 = add i32 %0, 4
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.level_to_pers, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
void myStrCpy(char *pDstStr, char *pSrcStr) {
  while (*pSrcStr)
    *pDstStr++ = *pSrcStr++;
  *pDstStr = '\0';
}


x86 assembly (clang, -O0):
<myStrCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <myStrCpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <myStrCpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<myStrCpy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <myStrCpy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <myStrCpy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @myStrCpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
int delete_buffer(char **buffer) {
  int i;
  for (i = 0; i < 200; i++) {
    free(buffer[i]);
  }
  free(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<delete_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xc8,-0xc(%rbp)
jge    114f <delete_buffer+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <delete_buffer+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    $0xc8,%rbx
jne    1120 <delete_buffer+0x10>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @delete_buffer(i8** nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %6, %2 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = add nuw nsw i64 %3, 1
%7 = icmp eq i64 %6, 200
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = bitcast i8** %0 to i8*
tail call void @free(i8* %9)
ret i32 0
}
/* Variables and functions */
char *config_item(char *, char *);
int /*<<< orphan*/ unlink(char const *);
void cleanup_pid_file(void) {
  const char *pid_file = config_item("global", "pidfile");
  if (pid_file)
    unlink(pid_file);
}


x86 assembly (clang, -O0):
<cleanup_pid_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1040 <config_item@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <cleanup_pid_file+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_pid_file>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <config_item@plt>
test   %rax,%rax
je     1142 <cleanup_pid_file+0x22>
mov    %rax,%rdi
pop    %rax
jmp    1030 <unlink@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"global\00"
@.str.1 = [8 x i8] c"pidfile\00"
define void @cleanup_pid_file() {
%1 = alloca i8*
%2 = call i8* @config_item(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @unlink(i8* %6)
br label %8
8: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"global\00"
@.str.1 = [8 x i8] c"pidfile\00"
define void @cleanup_pid_file() {
%1 = tail call i8* @config_item(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @unlink(i8* %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ discard_table();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ finish();
void graceful_finish() {
  discard_table();
  finish();
  exit(0);
}


x86 assembly (clang, -O0):
<graceful_finish>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <discard_table@plt>
mov    $0x0,%al
call   1030 <finish@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<graceful_finish>:
push   %rax
xor    %eax,%eax
call   1040 <discard_table@plt>
xor    %eax,%eax
call   1030 <finish@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @graceful_finish() {
%1 = call i32 (...) @discard_table()
%2 = call i32 (...) @finish()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @graceful_finish() {
%1 = tail call i32 (...) @discard_table()
%2 = tail call i32 (...) @finish()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(char);
void outindright() { outbyte(']'); }


x86 assembly (clang, -O0):
<outindright>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5d,%edi
call   1030 <outbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<outindright>:
mov    $0x5d,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define void @outindright() {
%1 = call i32 @outbyte(i8 signext 93)
ret void
}

LLVM IR (-O2):
define void @outindright() {
%1 = tail call i32 @outbyte(i8 signext 93)
ret void
}
int oscar_get_cookie(struct s_oscar_connection *const c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.s_oscar_connection = type opaque
define i32 @oscar_get_cookie(%struct.s_oscar_connection* nocapture readnone %0) {
ret i32 0
}
void outw_p(unsigned short int value, unsigned short int port) {
  __asm__ __volatile__("outw %w0,%w1\noutb %%al,$0x80"
                       :
                       : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
out    %al,$0x80
ret

LLVM IR (-O0):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}\0Aoutb %al,$$0x80", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit1(int);
int /*<<< orphan*/ write(int, char *, int);
void __start(void) {
  write(1, "Hello, World!\n", 14);
  exit1(42);
}


x86 assembly (clang, -O0):
<__start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
mov    $0x2a,%edi
call   1040 <exit1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__start>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0xe,%edx
call   1030 <write@plt>
mov    $0x2a,%edi
pop    %rax
jmp    1040 <exit1@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define void @__start() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%2 = call i32 @exit1(i32 42)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define void @__start() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%2 = tail call i32 @exit1(i32 42)
ret void
}
int of_device_is_compatible(const struct device_node *device,
                            const char *compat) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_device_is_compatible(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int is_in_bound(int *arr, int size, int *ptr) {
  return ptr > arr || (arr + size - 1) < ptr ? 0 : 1;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x1,%al
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
ja     113f <is_in_bound+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0xfffffffffffffffc,%rax
cmp    -0x18(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
cmp    %rdi,%rdx
setbe  %al
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
add    $0xfffffffffffffffc,%rcx
cmp    %rdx,%rcx
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_in_bound(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** %6
%8 = load i32*, i32** %4
%9 = icmp ugt i32* %7, %8
br i1 %9, label %18, label %10
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = getelementptr inbounds i32, i32* %14, i64 -1
%16 = load i32*, i32** %6
%17 = icmp ult i32* %15, %16
br label %18
18: ; preds = %10, %3
%19 = phi i1 [ true, %3 ], [ %17, %10 ]
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 0, i32 1
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp ule i32* %2, %0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = getelementptr inbounds i32, i32* %6, i64 -1
%8 = icmp uge i32* %7, %2
%9 = select i1 %4, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int fail(char *file, int line) {
  fprintf(stderr, "Test failure: %s line %d\n", file, line);
  exit(EXIT_FAILURE);
  return 0;
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Test failure: %s line %d\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @fail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Test failure: %s line %d\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @fail(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int are_parallel(l1, l2) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @are_parallel(i32 %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i;
  scanf("%d", &i);
  (i == 1 ? printf("Amit") : printf("All and sundry"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <main+0x46>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"Amit\00"
@.str.2 = [15 x i8] c"All and sundry\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"Amit\00"
@.str.2 = [15 x i8] c"All and sundry\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
unsigned long get_real_time(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @get_real_time() {
ret i64 0
}

LLVM IR (-O2):
define i64 @get_real_time() {
ret i64 0
}
/* Variables and functions */
size_t quad_idx(size_t a, size_t b) {
  enum { xx = 0, yy, zz, xy, xz, yz };
  static const size_t idx[] = {xx, xy, xz, xy, yy, yz, xz, yz, zz};
  return idx[a * 3 + b];
}


x86 assembly (clang, -O0):
<quad_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x3,-0x8(%rbp),%rcx
add    -0x10(%rbp),%rcx
lea    0xee4(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quad_idx>:
lea    (%rdi,%rdi,2),%rax
add    %rsi,%rax
lea    0xef2(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@quad_idx.idx = internal constant [9 x i64] [i64 0, i64 3, i64 4, i64 3, i64 1, i64 5, i64 4, i64 5, i64 2]
define i64 @quad_idx(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 = mul i64 %5, 3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
%9 = getelementptr inbounds [9 x i64], [9 x i64]* @quad_idx.idx, i64 0, i64 %8
%10 = load i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
@quad_idx.idx = internal unnamed_addr constant [9 x i64] [i64 0, i64 3, i64 4, i64 3, i64 1, i64 5, i64 4, i64 5, i64 2]
define i64 @quad_idx(i64 %0, i64 %1) {
%3 = mul i64 %0, 3
%4 = add i64 %3, %1
%5 = getelementptr inbounds [9 x i64], [9 x i64]* @quad_idx.idx, i64 0, i64 %4
%6 = load i64, i64* %5
ret i64 %6
}
/* Variables and functions */
char *bmake_malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *make_str(const char *ptr, int len) {
  char *new_ptr;
  new_ptr = bmake_malloc(len + 1);
  memcpy(new_ptr, ptr, len);
  new_ptr[len] = 0;
  return new_ptr;
}


x86 assembly (clang, -O0):
<make_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <bmake_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_str>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1030 <bmake_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @make_str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @bmake_malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @make_str(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @bmake_malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
double rnd(double number) {
  srand(time(NULL));
  return rand() % (int)number;
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cvttsd2si -0x8(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cvttsd2si (%rsp),%ecx
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rnd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = load double, double* %2
%7 = fptosi double %6 to i32
%8 = srem i32 %5, %7
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @rnd(double %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = fptosi double %0 to i32
%6 = srem i32 %4, %5
%7 = sitofp i32 %6 to double
ret double %7
}
int factorial_func(value)
int value;
{
  if (value > 1) {
    value *= factorial_func(value - 1);
  }
  array_func();
  return (value);
}


x86 assembly (clang, -O0):
<factorial_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1147 <factorial_func+0x27>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial_func@plt>
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <array_func@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial_func>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1135 <factorial_func+0x15>
lea    -0x1(%rbx),%edi
call   1030 <factorial_func@plt>
imul   %ebx,%eax
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <array_func@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @factorial_func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i32 @factorial_func(i32 %7)
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %5, %1
%12 = call i32 (...) @array_func()
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @factorial_func(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @factorial_func(i32 %4)
%6 = mul nsw i32 %5, %0
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ %6, %3 ], [ %0, %1 ]
%9 = tail call i32 (...) @array_func()
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void app_main(void) { printf("Hello World!\n"); }


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

x86 assembly (clang, -O2):
<app_main>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @app_main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @app_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_greetings_unpatched() { printf("Resolved IFUNC to UNPATCHED\n"); }


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

x86 assembly (clang, -O2):
<print_greetings_unpatched>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Resolved IFUNC to UNPATCHED\0A\00"
define void @print_greetings_unpatched() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Resolved IFUNC to UNPATCHED\00"
define void @print_greetings_unpatched() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  int b;
  int comma;
  comma = (a = 5, b = a, a);
  printf("%d", comma);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int ENOTSUP;
int /*<<< orphan*/ asprintf(char **, char *, char const *);
int error_dupped_option(const char *__restrict o, char **msg) {
  if (msg)
    asprintf(msg, "option \"%s\" got passed twice", o);
  return -ENOTSUP;
}


x86 assembly (clang, -O0):
<error_dupped_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113f <error_dupped_option+0x2f>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec6(%rip),%rsi
call   1030 <asprintf@plt>
xor    %eax,%eax
mov    0x2ea0(%rip),%rcx
sub    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_dupped_option>:
push   %rax
test   %rsi,%rsi
je     112b <error_dupped_option+0x1b>
mov    %rdi,%rdx
lea    0xee0(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <asprintf@plt>
mov    0x2eb6(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"option \22%s\22 got passed twice\00"
@ENOTSUP = global i32 0
define i32 @error_dupped_option(i8* noalias %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = icmp ne i8** %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %3
%10 = call i32 @asprintf(i8** %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7, %2
%12 = load i32, i32* @ENOTSUP
%13 = sub nsw i32 0, %12
ret i32 %13
}

LLVM IR (-O2):
@.str = [29 x i8] c"option \22%s\22 got passed twice\00"
@ENOTSUP = global i32 0
define i32 @error_dupped_option(i8* noalias %0, i8** %1) {
%3 = icmp eq i8** %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %2
%7 = load i32, i32* @ENOTSUP
%8 = sub nsw i32 0, %7
ret i32 %8
}
int InitSocketLibrary(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @InitSocketLibrary() {
ret i32 0
}

LLVM IR (-O2):
define i32 @InitSocketLibrary() {
ret i32 0
}