xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
void decsc(void) { esc("7"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"7\00"
define void @decsc() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned char f40(unsigned char x, unsigned long int y) {
  return (x >> y) | (x << ((-y) & (8 - 1)));
}


x86 assembly (clang, -O0):
<f40>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f40>:
mov    %rsi,%rcx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0x7,%cl
shl    %cl,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @f40(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = lshr i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 7
%8 = shl nuw nsw i32 %3, %7
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void right_arrow(void) { printf("Hey, you pressed the right arrow! \n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Hey, you pressed the right arrow! \0A\00"
define void @right_arrow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"Hey, you pressed the right arrow! \00"
define void @right_arrow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
t2() {
  long l1 = 0x1f010L;
  long l2;
  l2 = (unsigned short)l1;
  printf("(unsigned short) 0x1f010L = 0x%lx\n", l2);
  l2 = (short)l1;
  printf("(short) 0x1f010L = 0x%lx\n", l2);
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x1f010,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzwl %ax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movswq %ax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xf010,%esi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0xfffffffffffff010,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"(unsigned short) 0x1f010L = 0x%lx\0A\00"
@.str.1 = [26 x i8] c"(short) 0x1f010L = 0x%lx\0A\00"
define i32 @t2() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i64 126992, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i16
%6 = zext i16 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i64, i64* %2
%10 = trunc i64 %9 to i16
%11 = sext i16 %10 to i64
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [35 x i8] c"(unsigned short) 0x1f010L = 0x%lx\0A\00"
@.str.1 = [26 x i8] c"(short) 0x1f010L = 0x%lx\0A\00"
define i32 @t2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 61456)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 -4080)
ret i32 undef
}
/* Variables and functions */
char *calloc(int, int);
int main() {
  int i = 0;
  char *p = calloc((1024 * 1024 * 1024), sizeof(char));
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x40000000,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
jmp    1139 <main+0x29>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i8* @calloc(i32 1073741824, i32 1)
store i8* %4, i8** %3
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int bbiFileCheckSigs(char *, int, char *);
int bigBedFileCheckSigs(char *fileName) {
  return bbiFileCheckSigs(fileName, 0x8789F2EB, "big bed");
}


x86 assembly (clang, -O0):
<bigBedFileCheckSigs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8789f2eb,%esi
lea    0xed4(%rip),%rdx
call   1030 <bbiFileCheckSigs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigBedFileCheckSigs>:
lea    0xee9(%rip),%rdx
mov    $0x8789f2eb,%esi
jmp    1030 <bbiFileCheckSigs@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"big bed\00"
define i32 @bigBedFileCheckSigs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @bbiFileCheckSigs(i8* %3, i32 -2021002517, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"big bed\00"
define i32 @bigBedFileCheckSigs(i8* %0) {
%2 = tail call i32 @bbiFileCheckSigs(i8* %0, i32 -2021002517, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_st32_user(int, int);
void gen_op_stf32_user(int addr, int dest) { gen_op_st32_user(addr, dest); }


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

x86 assembly (clang, -O2):
<gen_op_stf32_user>:
jmp    1030 <gen_op_st32_user@plt>

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

LLVM IR (-O2):
define void @gen_op_stf32_user(i32 %0, i32 %1) {
%3 = tail call i32 @gen_op_st32_user(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x23() {
  Assert_real((isgraph(35)),
              "/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_isgraph.c",
              180, ("isgraph should be 1 for #"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x23>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xb4,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x23>:
push   %rax
mov    $0x23,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xb4,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for #\00"
define void @t_isgraph_0x23() {
%1 = call i32 @isgraph(i32 35)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for #\00"
define void @t_isgraph_0x23() {
%1 = tail call i32 @isgraph(i32 35)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ message1;

/* Variables and functions */
int /*<<< orphan*/ channgemessage(char **, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char message1[] = "hare krishna";
  channgemessage(&message1, sizeof(message1));
  printf("%s\n", message1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
mov    $0xd,%esi
call   1040 <channgemessage@plt>
lea    -0xd(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x616e687369726b,%rax
mov    %rax,0x5(%rsp)
movabs $0x69726b2065726168,%rax
6b 72 69
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <channgemessage@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.message1 = [13 x i8] c"hare krishna\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = bitcast [13 x i8]* %1 to i8*
%3 = bitcast [13 x i8]* %1 to i8**
%4 = call i32 @channgemessage(i8** %3, i32 13)
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.message1 = [13 x i8] c"hare krishna\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = bitcast [13 x i8]* %1 to i8**
%4 = call i32 @channgemessage(i8** %3, i32 13)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char const);
char *endname(char *name, const char end) {
  char *ob = strchr(name, end);
  if (ob)
    ob[0] = '\0';
  return ob;
}


x86 assembly (clang, -O0):
<endname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <endname+0x35>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endname>:
push   %rax
call   1030 <strchr@plt>
test   %rax,%rax
je     111e <endname+0xe>
movb   $0x0,(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @endname(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %5, %2
ret i8* %3
}
int ata_acpi_register(void) { return 0; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @tagshello() {
ret i32 undef
}
int dg(int i) {
  int d;
  for (d = 0; i; d++, i /= 10)
    ;
  return (d);
}


x86 assembly (clang, -O0):
<dg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1139 <dg+0x39>
jmp    111d <dg+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <dg+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dg>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <dg+0x32>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <dg+0x10>
ret

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

LLVM IR (-O2):
define i32 @dg(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = sdiv i32 %5, 10
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
int test_imm_F9int8_mem(signed char *val) {
  return ((*val) & (0xF9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F9int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -7
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ libC_func();
void libB_func(void) { libC_func(); }


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

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

LLVM IR (-O0):
define void @libB_func() {
%1 = call i32 (...) @libC_func()
ret void
}

LLVM IR (-O2):
define void @libB_func() {
%1 = tail call i32 (...) @libC_func()
ret void
}
/* Variables and functions */
int check_with_mode(char const *, char const *, char const *, char const *, int,
                    int /*<<< orphan*/);
int check_translation_with_mode(const char *tableList, const char *str,
                                const char *typeform, const char *expected,
                                int mode) {
  return check_with_mode(tableList, str, typeform, expected, mode, 0);
}


x86 assembly (clang, -O0):
<check_translation_with_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
xor    %r9d,%r9d
call   1030 <check_with_mode@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_translation_with_mode>:
xor    %r9d,%r9d
jmp    1030 <check_with_mode@plt>

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

LLVM IR (-O2):
define i32 @check_translation_with_mode(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i32 @check_with_mode(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ clean_RnB();
int /*<<< orphan*/ delselect_ship();
int /*<<< orphan*/ nand_cmd(int);
int /*<<< orphan*/ select_ship();
int /*<<< orphan*/ wait_RnB();
void nand_reset(void) {
  select_ship();
  clean_RnB();
  nand_cmd(0xff);
  wait_RnB();
  delselect_ship();
}


x86 assembly (clang, -O0):
<nand_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <select_ship@plt>
mov    $0x0,%al
call   1030 <clean_RnB@plt>
mov    $0xff,%edi
call   1060 <nand_cmd@plt>
mov    $0x0,%al
call   1070 <wait_RnB@plt>
mov    $0x0,%al
call   1050 <delselect_ship@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_reset>:
push   %rax
xor    %eax,%eax
call   1040 <select_ship@plt>
xor    %eax,%eax
call   1030 <clean_RnB@plt>
mov    $0xff,%edi
call   1060 <nand_cmd@plt>
xor    %eax,%eax
call   1070 <wait_RnB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <delselect_ship@plt>

LLVM IR (-O0):
define void @nand_reset() {
%1 = call i32 (...) @select_ship()
%2 = call i32 (...) @clean_RnB()
%3 = call i32 @nand_cmd(i32 255)
%4 = call i32 (...) @wait_RnB()
%5 = call i32 (...) @delselect_ship()
ret void
}

LLVM IR (-O2):
define void @nand_reset() {
%1 = tail call i32 (...) @select_ship()
%2 = tail call i32 (...) @clean_RnB()
%3 = tail call i32 @nand_cmd(i32 255)
%4 = tail call i32 (...) @wait_RnB()
%5 = tail call i32 (...) @delselect_ship()
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float asinf(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<asinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @asinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @asinf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
/* Type definitions */
typedef char wchar_t;
struct _Locale_time {
  int dummy;
};

/* Variables and functions */
const wchar_t *_WLocale_am_str(struct _Locale_time *ltime, wchar_t *buf,
                               size_t bufSize) {
  return L"AM";
}


x86 assembly (clang, -O0):
<_WLocale_am_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xee9(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._Locale_time = type { i32 }
@.str = [3 x i32] [i32 65, i32 77, i32 0]
define i8* @_WLocale_am_str(%struct._Locale_time* %0, i8* %1, i64 %2) {
%4 = alloca %struct._Locale_time*
%5 = alloca i8*
%6 = alloca i64
store %struct._Locale_time* %0, %struct._Locale_time** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i8* bitcast ([3 x i32]* @.str to i8*)
}

LLVM IR (-O2):
%struct._Locale_time = type { i32 }
@.str = [3 x i32] [i32 65, i32 77, i32 0]
define i8* @_WLocale_am_str(%struct._Locale_time* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* bitcast ([3 x i32]* @.str to i8*)
}
int ft_tolower(int c) {
  if (c > 64 && c < 91) {
    c = c + 32;
  }
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jle    1124 <ft_tolower+0x24>
cmpl   $0x5b,-0x4(%rbp)
jge    1124 <ft_tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void sgi_image_decode(FILE *inf) {}


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

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

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

LLVM IR (-O2):
define void @sgi_image_decode(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char Get_command(void) {
  char c;
  printf("Please enter a command (i, p, m, d, f, q):  ");
  scanf(" %c", &c);
  return c;
}


x86 assembly (clang, -O0):
<Get_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_command>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Please enter a command (i, p, m, d, f, q): \00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @Get_command() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
@.str = [45 x i8] c"Please enter a command (i, p, m, d, f, q): \00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @Get_command() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ serial_puts(char *);
int /*<<< orphan*/ serial_write(int);
int putchar(int c) {
  if (c == '\n') {
    serial_puts("\r\n");
  } else {
    serial_write(c);
  }
  return c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1146 <putchar+0x26>
lea    0xec4(%rip),%rdi
call   1030 <serial_puts@plt>
jmp    114e <putchar+0x2e>
mov    -0x4(%rbp),%edi
call   1040 <serial_write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jne    1136 <putchar+0x16>
lea    0xed1(%rip),%rdi
call   1030 <serial_puts@plt>
jmp    113d <putchar+0x1d>
mov    %ebx,%edi
call   1040 <serial_write@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @serial_puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @serial_write(i32 %8)
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @putchar(i32 returned %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @serial_puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @serial_write(i32 %0)
br label %7
7: ; preds = %5, %3
ret i32 %0
}
int test_imm_6Buint8_mem(unsigned char *val) {
  return ((*val) & (0x6B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Buint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 107
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int /*<<< orphan*/, char *, char *, char *, int);
void gmx_rx(int nodeid, void *buf, int bufsize) {
  fatal_error(0, "Routine %s called in %s, %d", "gmx_rx",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/"
              "tests/test_07/network.c",
              118);
}


x86 assembly (clang, -O0):
<gmx_rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
lea    0xed5(%rip),%rsi
lea    0xeea(%rip),%rdx
lea    0xeea(%rip),%rcx
mov    $0x76,%r8d
call   1030 <fatal_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmx_rx>:
lea    0xee9(%rip),%rsi
lea    0xefe(%rip),%rdx
lea    0xefe(%rip),%rcx
xor    %edi,%edi
mov    $0x76,%r8d
jmp    1030 <fatal_error@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [7 x i8] c"gmx_rx\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define void @gmx_rx(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 118)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [7 x i8] c"gmx_rx\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define void @gmx_rx(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 118)
ret void
}
/* Variables and functions */
int strlen(unsigned char *);
void sen_put_len(unsigned char *in0, unsigned char *in1, unsigned char **sh_sen,
                 unsigned char **ln_sen) {
  int len0, len1;
  len0 = strlen(in0);
  len1 = strlen(in1);
  if (len0 > len1) {
    *sh_sen = in1;
    *ln_sen = in0;
  } else {
    *sh_sen = in0;
    *ln_sen = in1;
  }
}


x86 assembly (clang, -O0):
<sen_put_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    1167 <sen_put_len+0x57>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    117d <sen_put_len+0x6d>
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sen_put_len>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
mov    %r12,%rax
cmovg  %rbx,%rax
cmovg  %r12,%rbx
mov    %rax,(%r15)
mov    %rbx,(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sen_put_len(i8* %0, i8* %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3) {
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32 @strlen(i8* %1)
%7 = icmp sgt i32 %5, %6
%8 = select i1 %7, i8* %1, i8* %0
%9 = select i1 %7, i8* %0, i8* %1
store i8* %8, i8** %2
store i8* %9, i8** %3
ret void
}
/* Variables and functions */
double Slater_1S_4S(double, double, double);
double Slater_4S_1S(double rij, double xii, double xij) {
  return Slater_1S_4S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<Slater_4S_1S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <Slater_1S_4S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Slater_4S_1S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <Slater_1S_4S@plt>

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

LLVM IR (-O2):
define double @Slater_4S_1S(double %0, double %1, double %2) {
%4 = tail call double @Slater_1S_4S(double %0, double %2, double %1)
ret double %4
}
float fastInverseSQRT(const float in_S) {
  float xhalf = 0.5f * in_S;
  union {
    float f;
    unsigned int i;
  } fi;
  fi.f = in_S;
  fi.i = 0x5f375a86 - (fi.i >> 1);
  fi.f = fi.f * (1.5f - xhalf * fi.f * fi.f);
  return fi.f;
}


x86 assembly (clang, -O0):
<fastInverseSQRT>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
shr    $0x1,%ecx
mov    $0x5f375a86,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe9e(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastInverseSQRT>:
movd   %xmm0,%eax
shr    %eax
mov    $0x5f375a86,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @fastInverseSQRT(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca %union.anon
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = load float, float* %2
%8 = bitcast %union.anon* %4 to float*
store float %7, float* %8
%9 = bitcast %union.anon* %4 to i32*
%10 = load i32, i32* %9
%11 = lshr i32 %10, 1
%12 = sub i32 1597463174, %11
%13 = bitcast %union.anon* %4 to i32*
store i32 %12, i32* %13
%14 = bitcast %union.anon* %4 to float*
%15 = load float, float* %14
%16 = load float, float* %3
%17 = bitcast %union.anon* %4 to float*
%18 = load float, float* %17
%19 = fmul float %16, %18
%20 = bitcast %union.anon* %4 to float*
%21 = load float, float* %20
%22 = fneg float %19
%23 = call float @llvm.fmuladd.f32(float %22, float %21, float 1.500000e+00)
%24 = fmul float %15, %23
%25 = bitcast %union.anon* %4 to float*
store float %24, float* %25
%26 = bitcast %union.anon* %4 to float*
%27 = load float, float* %26
ret float %27
}

LLVM IR (-O2):
define float @fastInverseSQRT(float %0) {
%2 = bitcast float %0 to i32
%3 = lshr i32 %2, 1
%4 = sub nsw i32 1597463174, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ dump_l(void *, int);
void dump_ln(void *addr, int nw) {
  if (nw < 1)
    nw = 1;
  if (nw > 1024)
    nw = 1024;
  dump_l(addr, (nw + 3) / 4);
}


x86 assembly (clang, -O0):
<dump_ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1130 <dump_ln+0x20>
movl   $0x1,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jle    1144 <dump_ln+0x34>
movl   $0x400,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
add    $0x3,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <dump_l@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_ln>:
test   %esi,%esi
mov    $0x1,%eax
cmovle %eax,%esi
cmp    $0x400,%esi
mov    $0x400,%eax
cmovae %eax,%esi
add    $0x3,%esi
shr    $0x2,%esi
jmp    1030 <dump_l@plt>

LLVM IR (-O0):
define void @dump_ln(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 1, i32* %4
br label %8
8: ; preds = %7, %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1024
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1024, i32* %4
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 3
%16 = sdiv i32 %15, 4
%17 = call i32 @dump_l(i8* %13, i32 %16)
ret void
}

LLVM IR (-O2):
define void @dump_ln(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
%4 = select i1 %3, i32 %1, i32 1
%5 = icmp ult i32 %4, 1024
%6 = select i1 %5, i32 %4, i32 1024
%7 = add nuw nsw i32 %6, 3
%8 = lshr i32 %7, 2
%9 = tail call i32 @dump_l(i8* %0, i32 %8)
ret void
}
/* Type definitions */
struct cl_rhash_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *cl_rhash_table_entry(struct cl_rhash_table *, void **);
bool cl_rhash_table_contains(struct cl_rhash_table *tbl, void *key) {
  return cl_rhash_table_entry(tbl, &key) != NULL;
}


x86 assembly (clang, -O0):
<cl_rhash_table_contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <cl_rhash_table_entry@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_rhash_table_contains>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
call   1030 <cl_rhash_table_entry@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cl_rhash_table = type { i32 }
define i32 @cl_rhash_table_contains(%struct.cl_rhash_table* %0, i8* %1) {
%3 = alloca %struct.cl_rhash_table*
%4 = alloca i8*
store %struct.cl_rhash_table* %0, %struct.cl_rhash_table** %3
store i8* %1, i8** %4
%5 = load %struct.cl_rhash_table*, %struct.cl_rhash_table** %3
%6 = call i32* @cl_rhash_table_entry(%struct.cl_rhash_table* %5, i8** %4)
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.cl_rhash_table = type { i32 }
define i32 @cl_rhash_table_contains(%struct.cl_rhash_table* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32* @cl_rhash_table_entry(%struct.cl_rhash_table* %0, i8** %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char **add_arr(char **, char **);
int /*<<< orphan*/ free_strings(char **);
char **add_arr_free(char **a, char **b) {
  char **res = add_arr(a, b);
  free_strings(a);
  free_strings(b);
  return res;
}


x86 assembly (clang, -O0):
<add_arr_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <add_arr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free_strings@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free_strings@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_arr_free>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <add_arr@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <free_strings@plt>
mov    %r14,%rdi
call   1030 <free_strings@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8** @add_arr_free(i8** %0, i8** %1) {
%3 = tail call i8** @add_arr(i8** %0, i8** %1)
%4 = tail call i32 @free_strings(i8** %0)
%5 = tail call i32 @free_strings(i8** %1)
ret i8** %3
}
/* Variables and functions */
int c(double, double);
int main(void) { return (c(0.0, 1.0)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movsd  0xee8(%rip),%xmm1
xorps  %xmm0,%xmm0
jmp    1030 <c@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @c(double 0.000000e+00, double 1.000000e+00)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @c(double 0.000000e+00, double 1.000000e+00)
ret i32 %1
}
unsigned short squeeze(unsigned long n) {
  const unsigned long mask = ~0U << 11;
  unsigned short s;
  for (s = 0; n & mask; n >>= 1, s -= mask)
    ;
  return s | n;
}


x86 assembly (clang, -O0):
<squeeze>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xfffff800,%eax
mov    %rax,-0x10(%rbp)
movw   $0x0,-0x12(%rbp)
movabs $0xfffff800,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     115a <squeeze+0x5a>
jmp    1134 <squeeze+0x34>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
movzwl -0x12(%rbp),%eax
movabs $0xfffff800,%rcx
sub    %rcx,%rax
mov    %ax,-0x12(%rbp)
jmp    1117 <squeeze+0x17>
movzwl -0x12(%rbp),%eax
or     -0x8(%rbp),%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<squeeze>:
xor    %eax,%eax
test   $0xfffff800,%edi
je     1133 <squeeze+0x33>
movabs $0x1fffff000,%rcx
mov    %rdi,%rdx
nopw   0x0(%rax,%rax,1)
shr    %rdi
add    $0x800,%eax
movzwl %ax,%eax
test   %rcx,%rdx
mov    %rdi,%rdx
jne    1120 <squeeze+0x20>
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @squeeze(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %2
store i64 4294965248, i64* %3
store i16 0, i16* %4
br label %5
5: ; preds = %10, %1
%6 = load i64, i64* %2
%7 = and i64 %6, 4294965248
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i64, i64* %2
%12 = lshr i64 %11, 1
store i64 %12, i64* %2
%13 = load i16, i16* %4
%14 = zext i16 %13 to i64
%15 = sub i64 %14, 4294965248
%16 = trunc i64 %15 to i16
store i16 %16, i16* %4
br label %5
17: ; preds = %5
%18 = load i16, i16* %4
%19 = zext i16 %18 to i64
%20 = load i64, i64* %2
%21 = or i64 %19, %20
%22 = trunc i64 %21 to i16
ret i16 %22
}

LLVM IR (-O2):
define zeroext i16 @squeeze(i64 %0) {
%2 = and i64 %0, 4294965248
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i64 [ %7, %4 ], [ %0, %1 ]
%7 = lshr i64 %6, 1
%8 = add nuw nsw i64 %5, 2048
%9 = and i64 %8, 65535
%10 = and i64 %6, 8589930496
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i64 [ %0, %1 ], [ %7, %4 ]
%14 = phi i64 [ 0, %1 ], [ %9, %4 ]
%15 = or i64 %14, %13
%16 = trunc i64 %15 to i16
ret i16 %16
}
int DRV_NVBACKUP_READ(unsigned char *pRamAddr, unsigned int len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_NVBACKUP_READ(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int reverse(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N;
  printf("Enter number to reverse:\n");
  scanf("%d", &N);
  int ans = reverse(N);
  printf("The reverse of %d is %d", N, ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <reverse@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <reverse@plt>
mov    0x4(%rsp),%esi
lea    0xe8e(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter number to reverse:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"The reverse of %d is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @reverse(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"The reverse of %d is %d\00"
@str = [25 x i8] c"Enter number to reverse:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @reverse(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stdio_uart_init();
void stdio_init_all() { stdio_uart_init(); }


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

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

LLVM IR (-O0):
define void @stdio_init_all() {
%1 = call i32 (...) @stdio_uart_init()
ret void
}

LLVM IR (-O2):
define void @stdio_init_all() {
%1 = tail call i32 (...) @stdio_uart_init()
ret void
}