xunge/DecIR huggingface dataset:
int checkan(char ch) {
  if (ch >= 'a' && ch <= 'z')
    return 0;
  if (ch >= 'A' && ch <= 'Z')
    return 0;
  if (ch >= '0' && ch <= '9')
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<checkan>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <checkan+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <checkan+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1183 <checkan+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <checkan+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <checkan+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1183 <checkan+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     117c <checkan+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     117c <checkan+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    1183 <checkan+0x83>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkan>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xa5,%al
cmp    $0xe6,%al
setb   %al
add    $0xc6,%dil
cmp    $0xf6,%dil
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @checkan(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %2
br label %31
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 48
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 57
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 0, i32* %2
br label %31
30: ; preds = %25, %21
store i32 1, i32* %2
br label %31
31: ; preds = %30, %29, %20, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @checkan(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -91
%4 = icmp ult i8 %3, -26
%5 = add i8 %0, -58
%6 = icmp ult i8 %5, -10
%7 = and i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct iam_leaf {
  int dummy;
};
struct iam_key {
  int dummy;
};

/* Variables and functions */
int e_eq(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
char *kchar(struct iam_key const *);
int /*<<< orphan*/ n_cur(struct iam_leaf const *);
int /*<<< orphan*/ strlen(char const *);
int lvar_key_eq(const struct iam_leaf *l, const struct iam_key *k) {
  const char *name;
  name = kchar(k);
  return e_eq(n_cur(l), name, strlen(name));
}


x86 assembly (clang, -O0):
<lvar_key_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <kchar@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <n_cur@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1060 <e_eq@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvar_key_eq>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <kchar@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <n_cur@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <e_eq@plt>

LLVM IR (-O0):
%struct.iam_leaf = type { i32 }
%struct.iam_key = type { i32 }
define i32 @lvar_key_eq(%struct.iam_leaf* %0, %struct.iam_key* %1) {
%3 = alloca %struct.iam_leaf*
%4 = alloca %struct.iam_key*
%5 = alloca i8*
store %struct.iam_leaf* %0, %struct.iam_leaf** %3
store %struct.iam_key* %1, %struct.iam_key** %4
%6 = load %struct.iam_key*, %struct.iam_key** %4
%7 = call i8* @kchar(%struct.iam_key* %6)
store i8* %7, i8** %5
%8 = load %struct.iam_leaf*, %struct.iam_leaf** %3
%9 = call i32 @n_cur(%struct.iam_leaf* %8)
%10 = load i8*, i8** %5
%11 = load i8*, i8** %5
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @e_eq(i32 %9, i8* %10, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.iam_leaf = type { i32 }
%struct.iam_key = type { i32 }
define i32 @lvar_key_eq(%struct.iam_leaf* %0, %struct.iam_key* %1) {
%3 = tail call i8* @kchar(%struct.iam_key* %1)
%4 = tail call i32 @n_cur(%struct.iam_leaf* %0)
%5 = tail call i32 @strlen(i8* %3)
%6 = tail call i32 @e_eq(i32 %4, i8* %3, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ DecodeI_xxxxxxxxssmmmrrr();
int /*<<< orphan*/ DoBinOpAdd(int /*<<< orphan*/);
void DoCodeAddI(void) { DoBinOpAdd(DecodeI_xxxxxxxxssmmmrrr()); }


x86 assembly (clang, -O0):
<DoCodeAddI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DecodeI_xxxxxxxxssmmmrrr@plt>
mov    %eax,%edi
call   1040 <DoBinOpAdd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeAddI>:
push   %rax
xor    %eax,%eax
call   1030 <DecodeI_xxxxxxxxssmmmrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <DoBinOpAdd@plt>

LLVM IR (-O0):
define void @DoCodeAddI() {
%1 = call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = call i32 @DoBinOpAdd(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeAddI() {
%1 = tail call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = tail call i32 @DoBinOpAdd(i32 %1)
ret void
}
/* Variables and functions */
char *getusershell();
int /*<<< orphan*/ puts(char *);
int main() {
  char *c;
  while ((c = getusershell()))
    puts(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getusershell@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1152 <main+0x32>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getusershell@plt>
test   %rax,%rax
je     1146 <main+0x26>
mov    %rax,%rdi
call   1030 <puts@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @getusershell()
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i8* [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @puts(i8* %4)
%6 = tail call i8* (...) @getusershell()
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret i32 0
}
double cube(x)
double x;
{ return x * x * x; }


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

x86 assembly (clang, -O2):
<cube>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cube(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @cube(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xb1() {
  Assert_real((isupper(177) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              890, ("isupper should be 0 for 0xb1"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xb1\00"
define void @t_isupper_0xb1() {
%1 = tail call i64 @isupper(i32 177)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 890, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct fcb {
  int dummy;
};

/* Variables and functions */
int kf7_create_key(struct fcb *, char *, int);
int create_key(struct fcb *f, char id[], int fcb_lc) {
  int err;
  err = kf7_create_key(f, id, fcb_lc);
  return (err);
}


x86 assembly (clang, -O0):
<create_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <kf7_create_key@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_key>:
jmp    1030 <kf7_create_key@plt>

LLVM IR (-O0):
%struct.fcb = type { i32 }
define i32 @create_key(%struct.fcb* %0, i8* %1, i32 %2) {
%4 = alloca %struct.fcb*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.fcb* %0, %struct.fcb** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.fcb*, %struct.fcb** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @kf7_create_key(%struct.fcb* %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
%struct.fcb = type { i32 }
define i32 @create_key(%struct.fcb* %0, i8* %1, i32 %2) {
%4 = tail call i32 @kf7_create_key(%struct.fcb* %0, i8* %1, i32 %2)
ret i32 %4
}
double EXP(statlink, x)
int *statlink;
double x;
{ return (_exp(x)); }


x86 assembly (clang, -O0):
<EXP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <_exp@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EXP>:
push   %rax
mov    $0x1,%al
call   1030 <_exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @EXP(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
store i32* %0, i32** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call i32 (double, ...) bitcast (i32 (...)* @_exp to i32 (double, ...)*)(double %5)
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @EXP(i32* nocapture readnone %0, double %1) {
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @_exp to i32 (double, ...)*)(double %1)
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i = 0, x = 0, y = 0;
  int n;
  for (i = 0; 1; i++) {
    assert(x == 0);
  }
  assert(x != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    114a <main+0x3a>
jmp    1169 <main+0x59>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <main+0x2b>
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %2
br label %6
6: ; preds = %12, %0
br i1 true, label %7, label %15
7: ; preds = %6
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @assert(i32 1)
br label %1
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  void *mem = malloc(nmemb * size);
  memset(mem, 0, nmemb * size);
  return mem;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
int test_imm_F2uint8_mem(unsigned char *val) {
  return ((*val) & (-0xF2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F2uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 14
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double normal2(double a, double b) { return __builtin_copysign(a, b); }


x86 assembly (clang, -O0):
<normal2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal2>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @normal2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @normal2(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
int CHECK_TABLE(const unsigned int t[8], unsigned char v) {
  return (t[v >> 5] >> (v & 0x1f)) & 1;
}


x86 assembly (clang, -O0):
<CHECK_TABLE>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl -0x9(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
movzbl -0x9(%rbp),%ecx
and    $0x1f,%ecx
shr    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CHECK_TABLE>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%eax
and    $0xfffffffc,%eax
mov    (%rdi,%rax,1),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @CHECK_TABLE(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = ashr i32 %7, 5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %5, i64 %9
%11 = load i32, i32* %10
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = and i32 %13, 31
%15 = lshr i32 %11, %14
%16 = and i32 %15, 1
ret i32 %16
}

LLVM IR (-O2):
define i32 @CHECK_TABLE(i32* nocapture %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = lshr i32 %3, 5
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = and i32 %3, 31
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ partab_init();
int parityb(unsigned char x) {
  extern unsigned char Partab[256];
  extern int P_init;
  if (!P_init) {
    partab_init();
  }
  return Partab[x];
}


x86 assembly (clang, -O0):
<parityb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2eb3(%rip),%rax
cmpl   $0x0,(%rax)
jne    1135 <parityb+0x25>
mov    $0x0,%al
call   1030 <partab_init@plt>
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    0x2e9e(%rip),%rax
movzbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parityb>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
cmpl   $0x0,(%rax)
jne    1126 <parityb+0x16>
xor    %eax,%eax
call   1030 <partab_init@plt>
movzbl %bl,%eax
mov    0x2eb0(%rip),%rcx
movzbl (%rcx,%rax,1),%eax
pop    %rbx
ret

LLVM IR (-O0):
@P_init = external global i32
@Partab = external global [256 x i8]
define i32 @parityb(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @P_init
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (...) @partab_init()
br label %7
7: ; preds = %5, %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i64
%10 = getelementptr inbounds [256 x i8], [256 x i8]* @Partab, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@P_init = external global i32
@Partab = external global [256 x i8]
define i32 @parityb(i8 zeroext %0) {
%2 = load i32, i32* @P_init
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @partab_init()
br label %6
6: ; preds = %4, %1
%7 = zext i8 %0 to i64
%8 = getelementptr inbounds [256 x i8], [256 x i8]* @Partab, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
ret i32 %10
}
/* Variables and functions */
int EOF;
int getchar();
int endBlock() {
  int c;
  while ((c = getchar()) != EOF)
    if (c == '/')
      return 1;
    else
      return 0;
  return 0;
}


x86 assembly (clang, -O0):
<endBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ebf(%rip),%rcx
cmp    (%rcx),%eax
je     1153 <endBlock+0x43>
cmpl   $0x2f,-0x8(%rbp)
jne    1147 <endBlock+0x37>
movl   $0x1,-0x4(%rbp)
jmp    115a <endBlock+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    115a <endBlock+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endBlock>:
push   %rax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    0x2ec9(%rip),%rcx
cmp    $0x2f,%eax
sete   %al
cmpl   $0x2f,(%rcx)
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @endBlock() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 47
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %1
br label %13
11: ; preds = %7
store i32 0, i32* %1
br label %13
12: ; preds = %3
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11, %10
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @endBlock() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, 47
%4 = icmp ne i32 %2, 47
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int conf_begin(void) {
  static int seq = 0;
  return ++seq;
}


x86 assembly (clang, -O0):
<conf_begin>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_begin>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@conf_begin.seq = internal global i32 0
define i32 @conf_begin() {
%1 = load i32, i32* @conf_begin.seq
%2 = add nsw i32 %1, 1
store i32 %2, i32* @conf_begin.seq
ret i32 %2
}

LLVM IR (-O2):
@conf_begin.seq = internal unnamed_addr global i32 0
define i32 @conf_begin() {
%1 = load i32, i32* @conf_begin.seq
%2 = add nsw i32 %1, 1
store i32 %2, i32* @conf_begin.seq
ret i32 %2
}
int ext4_acl_chmod(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @ext4_acl_chmod(%struct.inode* nocapture readnone %0) {
ret i32 0
}
__attribute__((always_)) double clamp_double(double a, double b, double c) {
  return a < b ? b : a > c ? c : a;
}


x86 assembly (clang, -O0):
<clamp_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clamp_double+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1169 <clamp_double+0x69>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <clamp_double+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115f <clamp_double+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_double>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @clamp_double(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
br label %22
12: ; preds = %3
%13 = load double, double* %4
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load double, double* %6
br label %20
18: ; preds = %12
%19 = load double, double* %4
br label %20
20: ; preds = %18, %16
%21 = phi double [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi double [ %11, %10 ], [ %21, %20 ]
ret double %23
}

LLVM IR (-O2):
define double @clamp_double(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ outsl(unsigned int, void *, unsigned long);
void nsp_multi_write_4(unsigned int BaseAddr, unsigned int Register, void *buf,
                       unsigned long count) {
  outsl(BaseAddr + Register, buf, count);
}


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

x86 assembly (clang, -O2):
<nsp_multi_write_4>:
add    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <outsl@plt>

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

LLVM IR (-O2):
define void @nsp_multi_write_4(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = add i32 %1, %0
%6 = tail call i32 @outsl(i32 %5, i8* %2, i64 %3)
ret void
}
void ff_hevc_put_hevc_qpel_h64_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h64_8_avx2() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
scalar_t__ memcpy(void *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *s) {
  size_t len = strlen(s) + 1;
  void *newstring = malloc(len);
  if (newstring == NULL)
    return NULL;
  return (char *)memcpy(newstring, s, len);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <strdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    1188 <strdup+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <strdup+0x2f>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
jmp    1161 <strdup+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = tail call i64 @memcpy(i8* %5, i8* %0, i64 %4)
%9 = inttoptr i64 %8 to i8*
br label %10
10: ; preds = %1, %7
%11 = phi i8* [ %9, %7 ], [ null, %1 ]
ret i8* %11
}
void data_transfer(char *data, long size) {
  __asm__ volatile("mov %0, %%rbx;"
                   "mov %1, %%rcx;"
                   "mov "
                   "$3"
                   ", %%rax;"
                   "int "
                   "$42"
                   ";"
                   :
                   : "r"(data), "r"(size)
                   : "rax", "rbx", "rcx");
}


x86 assembly (clang, -O0):
<data_transfer>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
mov    %rdx,%rbx
mov    %rsi,%rcx
mov    $0x3,%rax
int    $0x2a
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_transfer>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rcx
mov    $0x3,%rax
int    $0x2a
pop    %rbx
ret

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

LLVM IR (-O2):
define void @data_transfer(i8* %0, i64 %1) {
tail call void asm sideeffect "mov $0, %rbx;mov $1, %rcx;mov $$3, %rax;int $$42;", "r,r,~{rax},~{rbx},~{rcx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i64 %1)
ret void
}
void pac207_setquality(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @pac207_setquality(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ null(int /*<<< orphan*/, ...);
void callnull(void) {
  null(0, 0);
  null(0, (char *)0);
  null(0, (void *)0);
  null(0, (int *)0);
}


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

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

LLVM IR (-O0):
define void @callnull() {
%1 = call i32 (i32, ...) @null(i32 0, i32 0)
%2 = call i32 (i32, ...) @null(i32 0, i8* null)
%3 = call i32 (i32, ...) @null(i32 0, i8* null)
%4 = call i32 (i32, ...) @null(i32 0, i32* null)
ret void
}

LLVM IR (-O2):
define void @callnull() {
%1 = tail call i32 (i32, ...) @null(i32 0, i32 0)
%2 = tail call i32 (i32, ...) @null(i32 0, i8* null)
%3 = tail call i32 (i32, ...) @null(i32 0, i8* null)
%4 = tail call i32 (i32, ...) @null(i32 0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo(int x, int y) {
  assert(x > 0);
  assert(y == 1);
  return x + y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
test   %ebp,%ebp
setg   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x1,%ebx
sete   %dil
call   1030 <assert@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @foo(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 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %1, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = add nsw i32 %1, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void failed(void) { puts("failed"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"failed\00"
define void @failed() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bar2(int *, int);
int f6b(int *p) { return !p ? bar2(p, 1) : bar2(p, 0); }


x86 assembly (clang, -O0):
<f6b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113d <f6b+0x2d>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <bar2@plt>
mov    %eax,-0xc(%rbp)
jmp    114b <f6b+0x3b>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <bar2@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6b>:
test   %rdi,%rdi
je     111c <f6b+0xc>
xor    %esi,%esi
jmp    1030 <bar2@plt>
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <bar2@plt>

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

LLVM IR (-O2):
define i32 @f6b(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @bar2(i32* null, i32 1)
br label %7
5: ; preds = %1
%6 = tail call i32 @bar2(i32* %0, i32 0)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
double Sleef_sqrt_u35(double x) { return __builtin_sqrt(x); }


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

x86 assembly (clang, -O2):
<Sleef_sqrt_u35>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <Sleef_sqrt_u35+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @Sleef_sqrt_u35(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int binary_search(int, int);
int firstBadVersion(int n) { return binary_search(1, n); }


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

x86 assembly (clang, -O2):
<firstBadVersion>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <binary_search@plt>

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

LLVM IR (-O2):
define i32 @firstBadVersion(i32 %0) {
%2 = tail call i32 @binary_search(i32 1, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ AutoInstallProtocol(char *, char *);
void AutoInstall(char *settingsFile) {
  AutoInstallProtocol(settingsFile, "xboard");
  AutoInstallProtocol(settingsFile, "uci");
}


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

x86 assembly (clang, -O2):
<AutoInstall>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <AutoInstallProtocol@plt>
lea    0xee0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <AutoInstallProtocol@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"xboard\00"
@.str.1 = [4 x i8] c"uci\00"
define void @AutoInstall(i8* %0) {
%2 = tail call i32 @AutoInstallProtocol(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @AutoInstallProtocol(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cwbit(const int *datastream, const int i) {
  int resultant = 0;
  if (datastream[(i / 8)] & (0x80 >> (i % 8))) {
    resultant = 1;
  }
  return resultant;
}


x86 assembly (clang, -O0):
<cwbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
mov    %edx,%ecx
mov    $0x80,%edx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115f <cwbit+0x5f>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwbit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
mov    (%rdi,%rax,4),%eax
and    $0x7,%cl
shl    %cl,%eax
movzbl %al,%eax
shr    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @cwbit(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 7
%8 = lshr i32 128, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const, char const);
void printcard(int c) {
  static const char ranks[] = "AKQJT98765432";
  static const char suits[] = "cdhs";
  printf("%c%c ", ranks[c >> 2], suits[c % 4]);
}


x86 assembly (clang, -O0):
<printcard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
movslq %eax,%rcx
lea    0xed5(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x5(%rbp),%dl
movslq %eax,%rcx
lea    0xec8(%rip),%rdi
lea    0xebc(%rip),%rax
movsbl %dl,%esi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printcard>:
mov    %edi,%eax
sar    $0x2,%eax
cltq
lea    0xee2(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffffc,%eax
sub    %eax,%edi
movslq %edi,%rax
lea    0xed5(%rip),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@printcard.ranks = internal constant [14 x i8] c"AKQJT98765432\00"
@printcard.suits = internal constant [5 x i8] c"cdhs\00"
@.str = [6 x i8] c"%c%c \00"
define void @printcard(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [14 x i8], [14 x i8]* @printcard.ranks, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = load i32, i32* %2
%9 = srem i32 %8, 4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i8], [5 x i8]* @printcard.suits, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %7, i8 signext %12)
ret void
}

LLVM IR (-O2):
@printcard.ranks = internal unnamed_addr constant [14 x i8] c"AKQJT98765432\00"
@printcard.suits = internal unnamed_addr constant [5 x i8] c"cdhs\00"
@.str = [6 x i8] c"%c%c \00"
define void @printcard(i32 %0) {
%2 = ashr i32 %0, 2
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [14 x i8], [14 x i8]* @printcard.ranks, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = srem i32 %0, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [5 x i8], [5 x i8]* @printcard.suits, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ shutdown(int /*<<< orphan*/, int /*<<< orphan*/);
int32_t aliyun_iot_network_shutdown(int32_t fd, int32_t how) {
  return shutdown(fd, how);
}


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

x86 assembly (clang, -O2):
<aliyun_iot_network_shutdown>:
jmp    1030 <shutdown@plt>

LLVM IR (-O0):
define i32 @aliyun_iot_network_shutdown(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 = call i32 @shutdown(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @aliyun_iot_network_shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int ans;
  ans = (7 * 9) + ((19 / 5) % 2);
  printf("ans = %i\n", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x40,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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    $0x40,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"ans = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 64)
ret i32 0
}
/* Variables and functions */
bool UT64_MUL_OVFCHK(unsigned long long a, unsigned long long b) {
  return (a > 0 && b > 0 && a > 0xFFFFFFFFFFFFFFFFULL / b);
}


x86 assembly (clang, -O0):
<UT64_MUL_OVFCHK>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jbe    1153 <UT64_MUL_OVFCHK+0x53>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1153 <UT64_MUL_OVFCHK+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UT64_MUL_OVFCHK>:
mov    %rsi,%rax
xor    %ecx,%ecx
mul    %rdi
seto   %cl
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @UT64_MUL_OVFCHK(i64 %0, i64 %1) {
%3 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%4 = extractvalue { i64, i1 } %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
void raio_bs_null_poll(struct raio_bs *dev) {}


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

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

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

LLVM IR (-O2):
%struct.raio_bs = type opaque
define void @raio_bs_null_poll(%struct.raio_bs* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t sum_hash(unsigned char c, uint32_t h) { return (h * 0x01000193) ^ c; }


x86 assembly (clang, -O0):
<sum_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x1000193,-0x8(%rbp),%eax
movzbl -0x1(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_hash>:
imul   $0x1000193,%esi,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @sum_hash(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 16777619
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @sum_hash(i8 zeroext %0, i32 %1) {
%3 = mul nsw i32 %1, 16777619
%4 = zext i8 %0 to i32
%5 = xor i32 %3, %4
ret i32 %5
}