xunge/DecIR huggingface dataset:
struct node *dequeue(struct node **q, int *front, int *rear) {
  *front = *front + 1;
  return q[*front - 1];
}


x86 assembly (clang, -O0):
<dequeue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dequeue>:
movslq (%rsi),%rax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
mov    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @dequeue(%struct.node** %0, i32* %1, i32* %2) {
%4 = alloca %struct.node**
%5 = alloca i32*
%6 = alloca i32*
store %struct.node** %0, %struct.node*** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
%10 = load i32*, i32** %5
store i32 %9, i32* %10
%11 = load %struct.node**, %struct.node*** %4
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds %struct.node*, %struct.node** %11, i64 %15
%17 = load %struct.node*, %struct.node** %16
ret %struct.node* %17
}

LLVM IR (-O2):
%struct.node = type opaque
define %struct.node* @dequeue(%struct.node** nocapture %0, i32* nocapture %1, i32* nocapture readnone %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds %struct.node*, %struct.node** %0, i64 %6
%8 = load %struct.node*, %struct.node** %7
ret %struct.node* %8
}
int cmp_int(const void *a, const void *b) {
  int *x = (int *)a;
  int *y = (int *)b;
  return *x - *y;
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
char *scout_path_rootless(char const *);
const char *scout_path_absolute(const char *c) {
  const char *p = NULL;
  p = c++;
  c = scout_path_rootless(c);
  if (c != NULL)
    p = c;
  return p;
}


x86 assembly (clang, -O0):
<scout_path_absolute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <scout_path_rootless@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <scout_path_absolute+0x47>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scout_path_absolute>:
push   %rbx
mov    %rdi,%rbx
add    $0x1,%rdi
call   1030 <scout_path_rootless@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @scout_path_absolute(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i8* @scout_path_rootless(i8* %2)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* %0, i8* %3
ret i8* %5
}
/* Variables and functions */
int yuiStrEqual(char const *, char const *);
int yuiStrEqual0(const char *str1, const char *str2) {
  if (!str1 || !str2) {
    return str1 == str2;
  }
  return yuiStrEqual(str1, str2);
}


x86 assembly (clang, -O0):
<yuiStrEqual0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <yuiStrEqual0+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    114e <yuiStrEqual0+0x3e>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <yuiStrEqual0+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <yuiStrEqual@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yuiStrEqual0>:
test   %rdi,%rdi
je     111f <yuiStrEqual0+0xf>
test   %rsi,%rsi
je     111f <yuiStrEqual0+0xf>
jmp    1030 <yuiStrEqual@plt>
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @yuiStrEqual0(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = icmp eq i8* %0, %1
%8 = zext i1 %7 to i32
br label %11
9: ; preds = %2
%10 = tail call i32 @yuiStrEqual(i8* %0, i8* %1)
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %10, %9 ], [ %8, %6 ]
ret i32 %12
}
/* Variables and functions */
int sv_init(char *, int, int, int);
int vox_init(char *dev, int freq, int channels, int flags) {
  return sv_init(dev, freq, channels, flags);
}


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

x86 assembly (clang, -O2):
<vox_init>:
jmp    1030 <sv_init@plt>

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

LLVM IR (-O2):
define i32 @vox_init(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @sv_init(i8* %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
uintptr_t ffi_reinterpret_uintptr_t(void *result) { return (uintptr_t)result; }


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

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

LLVM IR (-O0):
define i64 @ffi_reinterpret_uintptr_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @ffi_reinterpret_uintptr_t(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
main() {
  execlp("cal", "cal", "2012", NULL);
  printf("This statement is not executed if execlp succeeds.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
lea    0xed2(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1040 <execlp@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1040 <execlp@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cal\00"
@.str.1 = [5 x i8] c"2012\00"
@.str.2 = [52 x i8] c"This statement is not executed if execlp succeeds.\0A\00"
define i32 @main() {
%1 = call i32 @execlp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cal\00"
@.str.1 = [5 x i8] c"2012\00"
@str = [51 x i8] c"This statement is not executed if execlp succeeds.\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void XNullHandler(void *NullParameter) { (void)NullParameter; }


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

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

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

LLVM IR (-O2):
define void @XNullHandler(i8* nocapture %0) {
ret void
}
/* Variables and functions */
bool ST64_DIV_OVFCHK(unsigned long long a, unsigned long long b) {
  return (!b || (a == 0x8000000000000000ULL && b == 0xFFFFFFFFFFFFFFFFULL));
}


x86 assembly (clang, -O0):
<ST64_DIV_OVFCHK>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1146 <ST64_DIV_OVFCHK+0x46>
xor    %eax,%eax
movabs $0x8000000000000000,%rcx
cmp    %rcx,-0x8(%rbp)
mov    %al,-0x12(%rbp)
jne    1140 <ST64_DIV_OVFCHK+0x40>
cmpq   $0xffffffffffffffff,-0x10(%rbp)
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ST64_DIV_OVFCHK>:
test   %rsi,%rsi
sete   %al
movabs $0x8000000000000000,%rcx
xor    %rdi,%rcx
not    %rsi
or     %rcx,%rsi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ST64_DIV_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* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, -9223372036854775808
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i64, i64* %4
%12 = icmp eq i64 %11, -1
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
br label %15
15: ; preds = %13, %2
%16 = phi i1 [ true, %2 ], [ %14, %13 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @ST64_DIV_OVFCHK(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = icmp eq i64 %0, -9223372036854775808
%5 = icmp eq i64 %1, -1
%6 = and i1 %4, %5
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
extern int add(const int num1, const int num2) { return num1 + num2; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "cat [FILE]...\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"cat [FILE]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"cat [FILE]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ A;

/* Variables and functions */
int /*<<< orphan*/ fourSum(int *, int, int, int *);
int main(int argc, char **argv) {
  int A[] = {1, -2, -5, -4, -3, 3, 3, 5};
  int ret = 0;
  fourSum(A, sizeof(A) / sizeof(int), -11, &ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
mov    $0xfffffff5,%edx
lea    -0x34(%rbp),%rcx
call   1030 <fourSum@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
mov    $0x8,%esi
mov    $0xfffffff5,%edx
call   1030 <fourSum@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [8 x i32] [i32 1, i32 -2, i32 -5, i32 -4, i32 -3, i32 3, i32 3, i32 5]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [8 x i32]* %6 to i8*
store i32 0, i32* %7
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %6, i64 0, i64 0
%10 = call i32 @fourSum(i32* %9, i32 8, i32 -11, i32* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [8 x i32] [i32 1, i32 -2, i32 -5, i32 -4, i32 -3, i32 3, i32 3, i32 5]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = alloca i32
%5 = bitcast [8 x i32]* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 @fourSum(i32* %7, i32 8, i32 -11, i32* %4)
ret i32 0
}
int pv__isdigit(char c) { return ((c >= '0') && (c <= '9')); }


x86 assembly (clang, -O0):
<pv__isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <pv__isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pv__isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @pv__isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @pv__isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ non_existent(struct S *, int);
void hooray3(struct S *p) { non_existent(p, 2); }


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

x86 assembly (clang, -O2):
<hooray3>:
mov    $0x2,%esi
jmp    1030 <non_existent@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @hooray3(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = load %struct.S*, %struct.S** %2
%4 = call i32 @non_existent(%struct.S* %3, i32 2)
ret void
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @hooray3(%struct.S* %0) {
%2 = tail call i32 @non_existent(%struct.S* %0, i32 2)
ret void
}
/* Variables and functions */
int smtp_read(int, char *);
int smtp_okay(int fd, char *response) {
  return ((smtp_read(fd, response) == 2) ? 1 : 0);
}


x86 assembly (clang, -O0):
<smtp_okay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <smtp_read@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x2,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_okay>:
push   %rax
call   1030 <smtp_read@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @smtp_okay(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @smtp_read(i32 %5, i8* %6)
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @smtp_okay(i32 %0, i8* %1) {
%3 = tail call i32 @smtp_read(i32 %0, i8* %1)
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}
int audiohw_transfers_done() { return 1; }


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

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

LLVM IR (-O0):
define i32 @audiohw_transfers_done() {
ret i32 1
}

LLVM IR (-O2):
define i32 @audiohw_transfers_done() {
ret i32 1
}
/* Variables and functions */
int do_bio_get_host_ip_tests();
int do_bio_get_port_tests();
int main(int argc, char **argv) {
  int ret = 0;
  ret |= do_bio_get_host_ip_tests();
  ret |= do_bio_get_port_tests();
  return (ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <do_bio_get_host_ip_tests@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <do_bio_get_port_tests@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (...) @do_bio_get_host_ip_tests()
%8 = load i32, i32* %6
%9 = or i32 %8, %7
store i32 %9, i32* %6
%10 = call i32 (...) @do_bio_get_port_tests()
%11 = load i32, i32* %6
%12 = or i32 %11, %10
store i32 %12, i32* %6
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_bio_get_host_ip_tests()
%4 = tail call i32 (...) @do_bio_get_port_tests()
%5 = or i32 %4, %3
ret i32 %5
}
void write_cr0(unsigned long cr0) {
  asm volatile("mov %0, %%cr0" : : "r"(cr0));
}


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

x86 assembly (clang, -O2):
<write_cr0>:
mov    %rdi,%cr0
ret

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

LLVM IR (-O2):
define void @write_cr0(i64 %0) {
tail call void asm sideeffect "mov $0, %cr0", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sender(void *);
void *sender_t(void *data) {
  sender(data);
  return 0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sender_t(i8* %0) {
%2 = tail call i32 @sender(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ BpfClose();
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, ...);
void Exit(int sig) {
  if (sig > 0)
    syslog(LOG_ERR, "going down on signal %d", sig);
  else
    syslog(LOG_ERR, "going down with fatal error");
  BpfClose();
  exit(1);
}


x86 assembly (clang, -O0):
<Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1164 <Exit+0x34>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1030 <syslog@plt>
jmp    117b <Exit+0x4b>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1030 <syslog@plt>
mov    $0x0,%al
call   1050 <BpfClose@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Exit>:
push   %rax
mov    %edi,%edx
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
test   %edx,%edx
jle    1150 <Exit+0x20>
lea    0xeb9(%rip),%rsi
xor    %eax,%eax
call   1030 <syslog@plt>
jmp    115e <Exit+0x2e>
lea    0xec1(%rip),%rsi
xor    %eax,%eax
call   1030 <syslog@plt>
xor    %eax,%eax
call   1050 <BpfClose@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [24 x i8] c"going down on signal %d\00"
@.str.1 = [28 x i8] c"going down with fatal error\00"
define void @Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @LOG_ERR
%7 = load i32, i32* %2
%8 = call i32 (i32, i8*, ...) @syslog(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* @LOG_ERR
%11 = call i32 (i32, i8*, ...) @syslog(i32 %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %5
%13 = call i32 (...) @BpfClose()
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [24 x i8] c"going down on signal %d\00"
@.str.1 = [28 x i8] c"going down with fatal error\00"
define void @Exit(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = load i32, i32* @LOG_ERR
br i1 %2, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i32, i8*, ...) @syslog(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 (i32, i8*, ...) @syslog(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = tail call i32 (...) @BpfClose()
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strnchr(char const *, int, size_t);
size_t strcnlen(const char *string, int stop, size_t maxlen) {
  const char *end = strnchr(string, stop, maxlen);
  return end ? (size_t)(end - string) : maxlen;
}


x86 assembly (clang, -O0):
<strcnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <strnchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1156 <strcnlen+0x46>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    115e <strcnlen+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strnchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @strcnlen(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i64, i64* %6
%11 = call i8* @strnchr(i8* %8, i32 %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %20
14: ; preds = %3
%15 = load i8*, i8** %7
%16 = load i8*, i8** %4
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
br label %22
20: ; preds = %3
%21 = load i64, i64* %6
br label %22
22: ; preds = %20, %14
%23 = phi i64 [ %19, %14 ], [ %21, %20 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @strcnlen(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @strnchr(i8* %0, i32 %1, i64 %2)
%5 = icmp eq i8* %4, null
%6 = ptrtoint i8* %4 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = select i1 %5, i64 %2, i64 %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int length;
  float basicWeight;
  length = 170;
  basicWeight = (length - 100) * 0.9;
  printf("%.1f\n", basicWeight);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xaa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x64,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 170, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 100
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 9.000000e-01
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 6.300000e+01)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, char const *, int);
int strlen(char const *);
void ConvertCToPStr255(const char *pSrc, unsigned char *pDest) {
  int nLen = strlen(pSrc);
  if (nLen > 255)
    nLen = 255;
  memcpy(pDest + 1, pSrc, nLen);
  *pDest = (unsigned char)nLen;
}


x86 assembly (clang, -O0):
<ConvertCToPStr255>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
jle    1150 <ConvertCToPStr255+0x30>
movl   $0xff,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertCToPStr255>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0xff,%eax
mov    $0xff,%ebp
cmovl  %eax,%ebp
lea    0x1(%r14),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %bpl,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ConvertCToPStr255(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, 255
%5 = select i1 %4, i32 %3, i32 255
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i32 %5)
%8 = trunc i32 %5 to i8
store i8 %8, i8* %1
ret void
}
void translate_path(char *path) {}


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

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

LLVM IR (-O0):
define void @translate_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @translate_path(i8* nocapture %0) {
ret void
}
void iwl_tm_gnl_remove(struct iwl_trans *trans) {}


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

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

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

LLVM IR (-O2):
%struct.iwl_trans = type opaque
define void @iwl_tm_gnl_remove(%struct.iwl_trans* nocapture %0) {
ret void
}
int xmlUCSIsBengali(int code) {
  return (((code >= 0x0980) && (code <= 0x09FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsBengali>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x980,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsBengali+0x26>
cmpl   $0x9ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsBengali>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x980,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsBengali(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 2432
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2559
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsBengali(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 2432
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void display_file(int fd) {
  char buffer;
  while (read(fd, &buffer, 1) != 0)
    write(1, &buffer, 1);
}


x86 assembly (clang, -O0):
<display_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
je     115b <display_file+0x3b>
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    112b <display_file+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_file>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
je     1166 <display_file+0x46>
lea    0x7(%rsp),%rbx
xchg   %ax,%ax
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
jne    1140 <display_file+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @display_file(i32 %0) {
%2 = alloca i8
%3 = call i64 @read(i32 %0, i8* %2, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1, %5
%6 = call i32 @write(i32 1, i8* %2, i32 1)
%7 = call i64 @read(i32 %0, i8* %2, i32 1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %1
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *xmalloc(size_t size) { return (malloc(size)); }


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

x86 assembly (clang, -O2):
<xmalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ replaceExt(char *, char *);
FILE *fopenTex(char *file, char *mode) {
  FILE *fl;
  fl = fopen(file, mode);
  if (fl != NULL)
    return fl;
  replaceExt(file, ".tex");
  fl = fopen(file, mode);
  return fl;
}


x86 assembly (clang, -O0):
<fopenTex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <fopenTex+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <fopenTex+0x62>
mov    -0x10(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <replaceExt@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopenTex>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <fopen@plt>
test   %rax,%rax
je     113c <fopenTex+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
call   1040 <replaceExt@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c".tex\00"
define noalias i32* @fopenTex(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @replaceExt(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32* @fopen(i8* %0, i8* %1)
br label %8
8: ; preds = %2, %5
%9 = phi i32* [ %7, %5 ], [ %3, %2 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ e_addri(int, int);
int /*<<< orphan*/ e_leave();
int /*<<< orphan*/ e_popr(int);
int /*<<< orphan*/ e_ret();
int /*<<< orphan*/ e_xorrr(int /*<<< orphan*/, int /*<<< orphan*/);
void co_halt(void) {
  e_xorrr(0, 0);
  e_addri(4, 12);
  e_popr(7);
  e_popr(6);
  e_popr(3);
  e_leave();
  e_ret();
}


x86 assembly (clang, -O0):
<co_halt>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1040 <e_xorrr@plt>
mov    $0x4,%edi
mov    $0xc,%esi
call   1050 <e_addri@plt>
mov    $0x7,%edi
call   1060 <e_popr@plt>
mov    $0x6,%edi
call   1060 <e_popr@plt>
mov    $0x3,%edi
call   1060 <e_popr@plt>
mov    $0x0,%al
call   1030 <e_leave@plt>
mov    $0x0,%al
call   1070 <e_ret@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_halt>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <e_xorrr@plt>
mov    $0x4,%edi
mov    $0xc,%esi
call   1050 <e_addri@plt>
mov    $0x7,%edi
call   1060 <e_popr@plt>
mov    $0x6,%edi
call   1060 <e_popr@plt>
mov    $0x3,%edi
call   1060 <e_popr@plt>
xor    %eax,%eax
call   1030 <e_leave@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <e_ret@plt>

LLVM IR (-O0):
define void @co_halt() {
%1 = call i32 @e_xorrr(i32 0, i32 0)
%2 = call i32 @e_addri(i32 4, i32 12)
%3 = call i32 @e_popr(i32 7)
%4 = call i32 @e_popr(i32 6)
%5 = call i32 @e_popr(i32 3)
%6 = call i32 (...) @e_leave()
%7 = call i32 (...) @e_ret()
ret void
}

LLVM IR (-O2):
define void @co_halt() {
%1 = tail call i32 @e_xorrr(i32 0, i32 0)
%2 = tail call i32 @e_addri(i32 4, i32 12)
%3 = tail call i32 @e_popr(i32 7)
%4 = tail call i32 @e_popr(i32 6)
%5 = tail call i32 @e_popr(i32 3)
%6 = tail call i32 (...) @e_leave()
%7 = tail call i32 (...) @e_ret()
ret void
}
int main() {
  double arr1[] = {-1, 4, -3};
  char arr2[] = {(char)-1, (char)5, (char)-3};
  int sum = 0;
  int i = 0;
  for (; i < 3; i++) {
    sum += (int)arr1[i];
    sum += arr2[i];
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xee5(%rip),%ax
mov    %ax,-0x23(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x21(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    1185 <main+0x85>
movslq -0x2c(%rbp),%rax
cvttsd2si -0x20(%rbp,%rax,8),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
movslq -0x2c(%rbp),%rax
movsbl -0x23(%rbp,%rax,1),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114e <main+0x4e>
mov    -0x28(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr1 = [3 x double] [double -1.000000e+00, double 4.000000e+00, double -3.000000e+00]
@__const.main.arr2 = [3 x i8] c"\FF\05\FD"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x double]
%3 = alloca [3 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [3 x double]* %2 to i8*
%7 = bitcast [3 x i8]* %3 to i8*
store i32 0, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %26, %0
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 %13
%15 = load double, double* %14
%16 = fptosi double %15 to i32
%17 = load i32, i32* %4
%18 = add nsw i32 %17, %16
store i32 %18, i32* %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i32, i32* %4
%25 = add nsw i32 %24, %23
store i32 %25, i32* %4
br label %26
26: ; preds = %11
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %8
29: ; preds = %8
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
IR0I1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x21,(%rax)
ja     1131 <IR0I1+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <IR0I1+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0I1>:
xor    %eax,%eax
cmpl   $0x22,(%r8)
setb   %al
ret

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

LLVM IR (-O2):
define i32 @IR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = icmp ult i32 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fputsn(int, char *, int);
char *print_to_base(int, char *, int, int *);
int print_dec(int fd, int n) {
  int count;
  char buffer[20] = {0};
  char *str;
  str = print_to_base(n, buffer, 10, &count);
  fputsn(fd, str, count);
  return count;
}


x86 assembly (clang, -O0):
<print_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
lea    -0xc(%rbp),%rcx
call   1050 <print_to_base@plt>
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <fputsn@plt>
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dec>:
push   %rbx
sub    $0x30,%rsp
mov    %esi,%eax
mov    %edi,%ebx
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
mov    %eax,%edi
mov    $0xa,%edx
call   1040 <print_to_base@plt>
mov    0xc(%rsp),%edx
mov    %ebx,%edi
mov    %rax,%rsi
call   1030 <fputsn@plt>
mov    0xc(%rsp),%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @print_dec(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [20 x i8]
%7 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = bitcast [20 x i8]* %6 to i8*
%9 = load i32, i32* %4
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%11 = call i8* @print_to_base(i32 %9, i8* %10, i32 10, i32* %5)
store i8* %11, i8** %7
%12 = load i32, i32* %3
%13 = load i8*, i8** %7
%14 = load i32, i32* %5
%15 = call i32 @fputsn(i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @print_dec(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca [20 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = call i8* @print_to_base(i32 %1, i8* %6, i32 10, i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @fputsn(i32 %0, i8* %7, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}
/* Variables and functions */
int __WORDSIZE;
void clear_bit(int nr, volatile unsigned long *addr) {
  *(addr + ((nr) / __WORDSIZE)) &= ~(1UL << ((nr) % __WORDSIZE));
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed3(%rip),%rcx
cltd
idivl  (%rcx)
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%rsi
xor    $0xffffffffffffffff,%rsi
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eae(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
and    %rsi,%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
cltd
idivl  (%rcx)
mov    %edx,%ecx
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
cltq
and    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
@__WORDSIZE = global i32 0
define void @clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @__WORDSIZE
%7 = srem i32 %5, %6
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
%10 = xor i64 %9, -1
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = load i32, i32* @__WORDSIZE
%14 = sdiv i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %11, i64 %15
%17 = load volatile i64, i64* %16
%18 = and i64 %17, %10
store volatile i64 %18, i64* %16
ret void
}

LLVM IR (-O2):
@__WORDSIZE = global i32 0
define void @clear_bit(i32 %0, i64* %1) {
%3 = load i32, i32* @__WORDSIZE
%4 = srem i32 %0, %3
%5 = zext i32 %4 to i64
%6 = shl nuw i64 1, %5
%7 = xor i64 %6, -1
%8 = sdiv i32 %0, %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %1, i64 %9
%11 = load volatile i64, i64* %10
%12 = and i64 %11, %7
store volatile i64 %12, i64* %10
ret void
}
int O(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @O() {
ret i32 0
}
/* Variables and functions */
int call_drv_init_test_env(unsigned int);
int initialize_test_environment(unsigned int print_level) {
  return call_drv_init_test_env(print_level);
}


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

x86 assembly (clang, -O2):
<initialize_test_environment>:
jmp    1030 <call_drv_init_test_env@plt>

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

LLVM IR (-O2):
define i32 @initialize_test_environment(i32 %0) {
%2 = tail call i32 @call_drv_init_test_env(i32 %0)
ret i32 %2
}
void INT_Excep_PERIA_INTA209(void) {}


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

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

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

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