xunge/DecIR huggingface dataset:
/* Variables and functions */
bool nv01_pgraph_is_solid_class(int cls) { return cls >= 8 && cls <= 0xc; }


x86 assembly (clang, -O0):
<nv01_pgraph_is_solid_class>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <nv01_pgraph_is_solid_class+0x20>
cmpl   $0xc,-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):
<nv01_pgraph_is_solid_class>:
add    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0x5,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @nv01_pgraph_is_solid_class(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 8
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 12
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 @nv01_pgraph_is_solid_class(i32 %0) {
%2 = add i32 %0, -8
%3 = icmp ult i32 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}
int Operand_uimm4x16_decode(unsigned int *valp) {
  unsigned uimm4x16_0, op2_0;
  op2_0 = *valp & 0xf;
  uimm4x16_0 = op2_0 << 4;
  *valp = uimm4x16_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_uimm4x16_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_uimm4x16_decode>:
mov    (%rdi),%eax
shl    $0x4,%eax
movzbl %al,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_uimm4x16_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 15
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 4
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_uimm4x16_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 4
%4 = and i32 %3, 240
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
char *getenv_int(const char *name) { return getenv(name); }


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

x86 assembly (clang, -O2):
<getenv_int>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @getenv_int(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
size_t gcd(size_t n1, size_t n2) {
  while (n1 != n2) {
    if (n1 > n2)
      n1 = n1 - n2;
    else
      n2 = n2 - n1;
  }
  return n1;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     114a <gcd+0x4a>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1139 <gcd+0x39>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1145 <gcd+0x45>
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
cmp    %rsi,%rdi
je     112e <gcd+0x2e>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rsi
mov    $0x0,%edx
cmovb  %rsi,%rdx
mov    %rax,%rdi
cmovb  %rcx,%rdi
sub    %rdx,%rax
sub    %rdi,%rsi
cmp    %rsi,%rax
jne    1110 <gcd+0x10>
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ %1, %2 ]
%6 = phi i64 [ %9, %4 ], [ %0, %2 ]
%7 = icmp ult i64 %5, %6
%8 = select i1 %7, i64 %5, i64 0
%9 = sub i64 %6, %8
%10 = select i1 %7, i64 0, i64 %6
%11 = sub i64 %5, %10
%12 = icmp eq i64 %9, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i64 [ %0, %2 ], [ %9, %4 ]
ret i64 %14
}
void nseel_asm_and_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_and_end() {
ret void
}
/* Variables and functions */
char tolower(int /*<<< orphan*/);
void strToLower(char *s) {
  char *p = s;
  ;
  if (s == NULL) {
    return;
  }
  while ((*p++ = tolower(*s++)) != '\0') {
  }
}


x86 assembly (clang, -O0):
<strToLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <strToLower+0x24>
jmp    1172 <strToLower+0x62>
jmp    1139 <strToLower+0x29>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1172 <strToLower+0x62>
jmp    1139 <strToLower+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strToLower>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1135 <strToLower+0x25>
mov    %rdi,%rbx
nopl   0x0(%rax)
lea    0x1(%rbx),%r14
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
mov    %r14,%rbx
test   %al,%al
jne    1120 <strToLower+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strToLower(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %5, %3 ], [ %0, %1 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = tail call signext i8 @tolower(i32 %7)
store i8 %8, i8* %4
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
ret void
}
int my_stat(name, buf)
char *name;
struct stat *buf;
{
  return stat(name, buf);
}


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

x86 assembly (clang, -O2):
<my_stat>:
xor    %eax,%eax
jmp    1030 <stat@plt>

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @my_stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 (i8*, %struct.stat*, ...) bitcast (i32 (...)* @stat to i32 (i8*, %struct.stat*, ...)*)(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @my_stat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 (i8*, %struct.stat*, ...) bitcast (i32 (...)* @stat to i32 (i8*, %struct.stat*, ...)*)(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int strlen(char *s) {
  int i;
  i = 0;
  while (s[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xd3() {
  Assert_real((isdigit(211) == 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_isdigit.c",
              1060, ("isdigit should be 0 for 0xd3"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xd3>:
push   %rax
mov    $0xd3,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x424,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xd3\00"
define void @t_isdigit_0xd3() {
%1 = call i64 @isdigit(i32 211)
%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 1060, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xd3\00"
define void @t_isdigit_0xd3() {
%1 = tail call i64 @isdigit(i32 211)
%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 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool enableReusePort(int socket, bool enable) { return true; }


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

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

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

LLVM IR (-O2):
define i32 @enableReusePort(i32 %0, i32 %1) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fread(void *, int, int, int /*<<< orphan*/ *);
void read_from_file(void *ptr, int len, const char *name) {
  FILE *f = fopen(name, "rb");
  if (!fread(ptr, len, 1, f))
    ((void)0);
  fclose(f);
}


x86 assembly (clang, -O0):
<read_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x0,%eax
jne    117a <read_from_file+0x4a>
jmp    117a <read_from_file+0x4a>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_from_file>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
mov    %rdx,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fclose@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define void @read_from_file(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fread(i8* %0, i32 %1, i32 1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void btjpg_gcfree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<btjpg_gcfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @btjpg_gcfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int console_putchar(int);
int putchar(int c) { return console_putchar(c); }


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

x86 assembly (clang, -O2):
<putchar>:
jmp    1030 <console_putchar@plt>

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

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = tail call i32 @console_putchar(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ftl_app -i <ingest uri> -s <stream_key> - v "
         "<h264_annex_b_file> -a <opus in ogg container>\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [99 x i8] c"Usage: ftl_app -i <ingest uri> -s <stream_key> - v <h264_annex_b_file> -a <opus in ogg container>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [98 x i8] c"Usage: ftl_app -i <ingest uri> -s <stream_key> - v <h264_annex_b_file> -a <opus in ogg container>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_DEint16_reg(short val) {
  return ((val) & (0xDE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DEint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xde,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DEint16_reg>:
test   $0xde,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DEint16_reg(i16 signext %0) {
%2 = and i16 %0, 222
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void throw(char *message) {
  printf("%s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<throw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @throw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @throw(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int gettimeofday(struct timeval *__restrict __p, void *__restrict __tz) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @gettimeofday(%struct.timeval* noalias nocapture readnone %0, i8* noalias nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct region {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ region_free(struct region *);
size_t region_used(struct region *);
void region_free_after(struct region *region, size_t after) {
  if (region_used(region) > after)
    region_free(region);
}


x86 assembly (clang, -O0):
<region_free_after>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <region_used@plt>
cmp    -0x10(%rbp),%rax
jbe    114c <region_free_after+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <region_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<region_free_after>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <region_used@plt>
cmp    %r14,%rax
jbe    1143 <region_free_after+0x23>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <region_free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.region = type { i32 }
define void @region_free_after(%struct.region* %0, i64 %1) {
%3 = alloca %struct.region*
%4 = alloca i64
store %struct.region* %0, %struct.region** %3
store i64 %1, i64* %4
%5 = load %struct.region*, %struct.region** %3
%6 = call i64 @region_used(%struct.region* %5)
%7 = load i64, i64* %4
%8 = icmp ugt i64 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load %struct.region*, %struct.region** %3
%11 = call i32 @region_free(%struct.region* %10)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.region = type { i32 }
define void @region_free_after(%struct.region* %0, i64 %1) {
%3 = tail call i64 @region_used(%struct.region* %0)
%4 = icmp ugt i64 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @region_free(%struct.region* %0)
br label %7
7: ; preds = %5, %2
ret void
}
unsigned short int f21(unsigned short int x, int y) {
  return (x >> ((-y) & (8 * 2 - 1))) ^ (x << y);
}


x86 assembly (clang, -O0):
<f21>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0xf,%ecx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f21>:
mov    %esi,%ecx
neg    %cl
and    $0xf,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f21(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = and i32 %8, 15
%10 = ashr i32 %6, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i32, i32* %4
%14 = shl i32 %12, %13
%15 = xor i32 %10, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @f21(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub nsw i32 0, %1
%5 = and i32 %4, 15
%6 = lshr i32 %3, %5
%7 = shl i32 %3, %1
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
int cmduser(int usern) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @cmduser(i32 %0) {
ret i32 -1
}
void XtSetErrorHandler() {}


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

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

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

LLVM IR (-O2):
define void @XtSetErrorHandler() {
ret void
}
void f3() {
  for (int i = 0; i < 10; i++) {
    ;
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <f3+0x28>
jmp    111a <f3+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f3+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f3() {
ret void
}
int sum(char x[], int i) {
  if (x[i] == 0)
    return 0;
  else
    return x[i] + sum(x, i + 1);
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1140 <sum+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1168 <sum+0x58>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1030 <sum@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%cl
test   %cl,%cl
je     1131 <sum+0x31>
lea    (%rax,%rdi,1),%rdx
add    $0x1,%rdx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <sum+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %12, %7 ], [ %3, %2 ]
%9 = phi i8 [ %15, %7 ], [ %5, %2 ]
%10 = phi i32 [ %13, %7 ], [ 0, %2 ]
%11 = sext i8 %9 to i32
%12 = add i64 %8, 1
%13 = add nsw i32 %10, %11
%14 = getelementptr inbounds i8, i8* %0, i64 %12
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %2
%18 = phi i32 [ 0, %2 ], [ %13, %7 ]
ret i32 %18
}
void *test_anti_range_91(int n) {
  extern void *alloc_anti_range_91(int) __attribute__((alloc_size(1)));
  if (0x7fffffff - 2 <= n && n <= 0x7fffffff - 1)
    n = 0x7fffffff - 2 - 1;
  return alloc_anti_range_91(n);
}


x86 assembly (clang, -O0):
<test_anti_range_91>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7ffffffd,%eax
cmp    -0x4(%rbp),%eax
jg     113d <test_anti_range_91+0x2d>
cmpl   $0x7ffffffe,-0x4(%rbp)
jg     113d <test_anti_range_91+0x2d>
movl   $0x7ffffffc,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_91@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_91>:
lea    -0x7ffffffd(%rdi),%eax
cmp    $0x2,%eax
mov    $0x7ffffffc,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_91@plt>

LLVM IR (-O0):
define i8* @test_anti_range_91(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 2147483645, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2147483646
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 2147483644, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_91(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_91(i32 %0) {
%2 = add i32 %0, -2147483645
%3 = icmp ult i32 %2, 2
%4 = select i1 %3, i32 2147483644, i32 %0
%5 = tail call i8* @alloc_anti_range_91(i32 %4)
ret i8* %5
}
/* Type definitions */
struct coder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct coder *);
void Ptngc_coder_deinit(struct coder *coder_inst) { free(coder_inst); }


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

x86 assembly (clang, -O2):
<Ptngc_coder_deinit>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.coder = type { i32 }
define void @Ptngc_coder_deinit(%struct.coder* nocapture %0) {
%2 = tail call i32 @free(%struct.coder* %0)
ret void
}
int test_imm_CDint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xCD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CDint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xcd,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_CDint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 205
%7 = icmp ne i64 %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_CDint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13434880
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int streamOpenID(char const *, char const *, int, int);
int streamOpen(const char *filename, const char *filemode, int filetype) {
  return streamOpenID(filename, filemode, filetype, -1);
}


x86 assembly (clang, -O0):
<streamOpen>:
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
mov    $0xffffffff,%ecx
call   1030 <streamOpenID@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streamOpen>:
mov    $0xffffffff,%ecx
jmp    1030 <streamOpenID@plt>

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

LLVM IR (-O2):
define i32 @streamOpen(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @streamOpenID(i8* %0, i8* %1, i32 %2, i32 -1)
ret i32 %4
}
/* Variables and functions */
float length(int /*<<< orphan*/);
int /*<<< orphan*/ vec2(float, float);
float fOpPipe(float a, float b, float r) { return length(vec2(a, b)) - r; }


x86 assembly (clang, -O0):
<fOpPipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <vec2@plt>
mov    %eax,%edi
call   1030 <length@plt>
subss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fOpPipe>:
push   %rax
movss  %xmm2,0x4(%rsp)
call   1040 <vec2@plt>
mov    %eax,%edi
call   1030 <length@plt>
subss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fOpPipe(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = call i32 @vec2(float %7, float %8)
%10 = call float @length(i32 %9)
%11 = load float, float* %6
%12 = fsub float %10, %11
ret float %12
}

LLVM IR (-O2):
define float @fOpPipe(float %0, float %1, float %2) {
%4 = tail call i32 @vec2(float %0, float %1)
%5 = tail call float @length(i32 %4)
%6 = fsub float %5, %2
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ newline(int /*<<< orphan*/ *);
void dots(FILE *stream, int num) {
  for (; num; num--)
    fputc('.', stream);
  newline(stream);
}


x86 assembly (clang, -O0):
<dots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1155 <dots+0x35>
mov    -0x8(%rbp),%rsi
mov    $0x2e,%edi
call   1040 <fputc@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <dots+0xf>
mov    -0x8(%rbp),%rdi
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dots>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
je     1142 <dots+0x22>
mov    %esi,%ebp
nopl   0x0(%rax)
mov    $0x2e,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
add    $0xffffffff,%ebp
jne    1130 <dots+0x10>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <newline@plt>

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

LLVM IR (-O2):
define void @dots(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @fputc(i8 signext 46, i32* %0)
%7 = add nsw i32 %5, -1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = tail call i32 @newline(i32* %0)
ret void
}
__attribute__((always_)) void __change_bit(int nr,
                                           volatile unsigned long *addr) {
  __asm__ __volatile__("btcl %1,%0"
                       : "=m"((*(volatile long *)addr))
                       : "Ir"(nr));
}


x86 assembly (clang, -O0):
<__change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btc    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__change_bit>:
btc    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @__change_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btcl $1,$0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void printNumCoresInfo(const char *cmd) {
  (void)cmd;
  output("Total number of processor cores\t0\t0\t\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Total number of processor cores\090\090\09\0A\00"
define void @printNumCoresInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Total number of processor cores\090\090\09\0A\00"
define void @printNumCoresInfo(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
void REMR3BreakpointClear(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3BreakpointClear() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ request;
};
typedef TYPE_1__ XMappingEvent;

/* Variables and functions */
int get_XMappingEvent_request(void *_p) {
  return (int)((XMappingEvent *)_p)->request;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XMappingEvent_request(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XMappingEvent_request(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void dimensions(int x[]) {
  x[0] = 2;
  x[1] = 2;
  x[2] = 2;
  x[3] = 2;
}


x86 assembly (clang, -O0):
<dimensions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dimensions>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @dimensions(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %2
ret void
}
unsigned int fnv_hash(const char *str, unsigned int len) {
  unsigned int hash;
  unsigned int c;
  hash = 0;
  c = 0;
  while ((c = (unsigned int)*str++)) {
    hash *= 0x811C9DC5;
    hash ^= (c);
  }
  return hash;
}


x86 assembly (clang, -O0):
<fnv_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114f <fnv_hash+0x4f>
imul   $0x811c9dc5,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <fnv_hash+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnv_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <fnv_hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x811c9dc5,%eax,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <fnv_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fnv_hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = mul i32 %7, -2128831035
%12 = xor i32 %11, %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
#define EACCES 131
#define ENOENT 130
#define ENOMEM 129
#define ENOSPC 128
int errno;
int find_error() {
  switch (errno) {
  case EACCES:
    return 2;
  case ENOMEM:
    return 3;
  case ENOSPC:
    return 3;
  case ENOENT:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<find_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1163 <find_error+0x63>
mov    -0x10(%rbp),%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x4(%rbp)
jmp    116a <find_error+0x6a>
movl   $0x3,-0x4(%rbp)
jmp    116a <find_error+0x6a>
movl   $0x3,-0x4(%rbp)
jmp    116a <find_error+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    116a <find_error+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_error>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
add    $0xffffff80,%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
ja     1120 <find_error+0x20>
movslq %ecx,%rax
lea    0xee3(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @find_error() {
%1 = alloca i32
%2 = load i32, i32* @errno
switch i32 %2, label %7 [
i32 131, label %3
i32 129, label %4
i32 128, label %5
i32 130, label %6
]
3: ; preds = %0
store i32 2, i32* %1
br label %8
4: ; preds = %0
store i32 3, i32* %1
br label %8
5: ; preds = %0
store i32 3, i32* %1
br label %8
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6, %5, %4, %3
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@errno = global i32 0
@switch.table.find_error = [4 x i32] [i32 3, i32 3, i32 1, i32 2]
define i32 @find_error() {
%1 = load i32, i32* @errno
%2 = add i32 %1, -128
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.find_error, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ %7, %4 ], [ 0, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ qdq_enqueue_close_buffer(void *,
                                            void (*)(unsigned int, void *));
void qd_close_delegate_buffer(void *buffer,
                              void (*funPtr)(unsigned int, void *)) {
  qdq_enqueue_close_buffer(buffer, funPtr);
}


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

x86 assembly (clang, -O2):
<qd_close_delegate_buffer>:
jmp    1030 <qdq_enqueue_close_buffer@plt>

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

LLVM IR (-O2):
define void @qd_close_delegate_buffer(i8* %0, void (i32, i8*)* %1) {
%3 = tail call i32 @qdq_enqueue_close_buffer(i8* %0, void (i32, i8*)* %1)
ret void
}
unsigned int sh_nargs(char **cmds) {
  unsigned int i;
  for (i = 0; cmds[i]; i++)
    ;
  return (i);
}


x86 assembly (clang, -O0):
<sh_nargs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpq   $0x0,(%rax,%rcx,8)
je     1134 <sh_nargs+0x34>
jmp    1126 <sh_nargs+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sh_nargs+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh_nargs>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi,%rax,8)
jne    1110 <sh_nargs+0x10>
ret

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

LLVM IR (-O2):
define i32 @sh_nargs(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ func(int *);
int main() {
  int index = 0;
  func(&index);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @func(i32* %1)
ret i32 0
}
void file1_func3(void) { return; }


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

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

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

LLVM IR (-O2):
define void @file1_func3() {
ret void
}
int isDelimiter(char c) {
  switch (c) {
  case '\n':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isDelimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
sub    $0xa,%al
jne    1126 <isDelimiter+0x26>
jmp    111a <isDelimiter+0x1a>
movl   $0x1,-0x4(%rbp)
jmp    112d <isDelimiter+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDelimiter>:
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isDelimiter(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
switch i32 %5, label %7 [
i32 10, label %6
]
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isDelimiter(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}