xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ run(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc == 2) {
    run(argv[1]);
  } else {
    fprintf(stderr, "Not enough arguments\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1152 <main+0x32>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <run@plt>
jmp    1167 <main+0x47>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1030 <run@plt>
jmp    1146 <main+0x26>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Not enough arguments\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @run(i8* %11)
br label %16
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Not enough arguments\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @run(i8* %6)
br label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %4
ret i32 0
}
void f_short(short b) { f_short(0); }


x86 assembly (clang, -O0):
<f_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
xor    %edi,%edi
call   1030 <f_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f_short(i16 signext %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ze_green() { printf("[32m"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[32m\00"
define void @ze_green() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[32m\00"
define void @ze_green() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g5_set_xmjMC0(int /*<<< orphan*/, int, int, double **,
                                 double *, double *);
void g5_set_xmj0(int adr, int nj, double (*xj)[3], double *mj, double *epsj2) {
  g5_set_xmjMC0(0, adr, nj, xj, mj, epsj2);
}


x86 assembly (clang, -O0):
<g5_set_xmj0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
xor    %edi,%edi
call   1030 <g5_set_xmjMC0@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g5_set_xmj0>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <g5_set_xmjMC0@plt>

LLVM IR (-O0):
define void @g5_set_xmj0(i32 %0, i32 %1, [3 x double]* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca [3 x double]*
%9 = alloca double*
%10 = alloca double*
store i32 %0, i32* %6
store i32 %1, i32* %7
store [3 x double]* %2, [3 x double]** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load [3 x double]*, [3 x double]** %8
%14 = bitcast [3 x double]* %13 to double**
%15 = load double*, double** %9
%16 = load double*, double** %10
%17 = call i32 @g5_set_xmjMC0(i32 0, i32 %11, i32 %12, double** %14, double* %15, double* %16)
ret void
}

LLVM IR (-O2):
define void @g5_set_xmj0(i32 %0, i32 %1, [3 x double]* %2, double* %3, double* %4) {
%6 = bitcast [3 x double]* %2 to double**
%7 = tail call i32 @g5_set_xmjMC0(i32 0, i32 %0, i32 %1, double** %6, double* %3, double* %4)
ret void
}
int ft_iswhitespace(const char c) {
  if (c == ' ' || c == '\t' || c == '\n')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_iswhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1131 <ft_iswhitespace+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1131 <ft_iswhitespace+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    113d <ft_iswhitespace+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <ft_iswhitespace+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_iswhitespace>:
cmp    $0x20,%dil
ja     1120 <ft_iswhitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <ft_iswhitespace+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_iswhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
indreg0indreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
ja     1136 <indreg0indreg1+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <indreg0indreg1+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0indreg1>:
mov    (%r8),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @indreg0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp ule i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
const char *Slice_Description(void) {
  return "The `Slice` type is an iterable that allows one to only iterate over "
         "part of another iterable. Given some start, stop and step, only "
         "those entries described by the `Slice` are returned in the iteration."
         "\n\n"
         "Under the hood the `Slice` object still iterates over the whole "
         "iterable "
         "but it only returns those values in the range given.";
}


x86 assembly (clang, -O0):
<Slice_Description>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [330 x i8] c"The `Slice` type is an iterable that allows one to only iterate over part of another iterable. Given some start, stop and step, only those entries described by the `Slice` are returned in the iteration.\0A\0AUnder the hood the `Slice` object still iterates over the whole iterable but it only returns those values in the range given.\00"
define i8* @Slice_Description() {
ret i8* getelementptr inbounds ([330 x i8], [330 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [330 x i8] c"The `Slice` type is an iterable that allows one to only iterate over part of another iterable. Given some start, stop and step, only those entries described by the `Slice` are returned in the iteration.\0A\0AUnder the hood the `Slice` object still iterates over the whole iterable but it only returns those values in the range given.\00"
define i8* @Slice_Description() {
ret i8* getelementptr inbounds ([330 x i8], [330 x i8]* @.str, i64 0, i64 0)
}
void clear_bit(int nr, volatile unsigned long *addr) {
  asm volatile("btrl %1,%0" : "+m"(*(volatile long *)(addr)) : "Ir"(nr));
}


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

x86 assembly (clang, -O2):
<clear_bit>:
btr    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @clear_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btrl $1,$0", "=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ for1();
int /*<<< orphan*/ for2();
void testFor(void) {
  for1();
  for2();
}


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

x86 assembly (clang, -O2):
<testFor>:
push   %rax
xor    %eax,%eax
call   1030 <for1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <for2@plt>

LLVM IR (-O0):
define void @testFor() {
%1 = call i32 (...) @for1()
%2 = call i32 (...) @for2()
ret void
}

LLVM IR (-O2):
define void @testFor() {
%1 = tail call i32 (...) @for1()
%2 = tail call i32 (...) @for2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void cpuid_get(void *id) { memcpy(id, (void *)((0x1ffff7ac)), (12)); }


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

x86 assembly (clang, -O2):
<cpuid_get>:
mov    $0x1ffff7ac,%esi
mov    $0xc,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @cpuid_get(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memcpy(i8* %3, i8* inttoptr (i64 536868780 to i8*), i32 12)
ret void
}

LLVM IR (-O2):
define void @cpuid_get(i8* %0) {
%2 = tail call i32 @memcpy(i8* %0, i8* inttoptr (i64 536868780 to i8*), i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_if_valid(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char input[41];
  scanf("%s", input);
  check_if_valid(input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <check_if_valid@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <check_if_valid@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [41 x i8]
%2 = getelementptr inbounds [41 x i8], [41 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @check_if_valid(i8* %2)
ret i32 0
}
/* Variables and functions */
int rand();
int randomDoor(int num_of_doors) { return rand() % num_of_doors; }


x86 assembly (clang, -O0):
<randomDoor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomDoor>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randomDoor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @randomDoor(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *output_25();
int main(void) {
  const char *s = output_25();
  if (s[0] != 's')
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <output_25@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
je     1161 <main+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <output_25@plt>
cmpb   $0x73,(%rax)
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @output_25()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 115
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @output_25()
%2 = load i8, i8* %1
%3 = icmp eq i8 %2, 115
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = tail call i32 @exit(i32 0)
unreachable
}
void ff_hevc_put_hevc_bi_w_epel_hv32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_hv32_8_sse4() {
ret void
}
int entity_count_weapons(struct t_creature *e) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.t_creature = type opaque
define i32 @entity_count_weapons(%struct.t_creature* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t const);
void DEBUG_CLEAR(void *ptr, const size_t bytes) { memset(ptr, 0x5a, bytes); }


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

x86 assembly (clang, -O2):
<DEBUG_CLEAR>:
mov    %rsi,%rdx
mov    $0x5a,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @DEBUG_CLEAR(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 90, i64 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int next_char(FILE *f) {
  int c = fgetc(f);
  if (c == '\r') {
    c = fgetc(f);
    if (c != '\n') {
      ungetc(c, f);
      c = '\r';
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<next_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xd,-0xc(%rbp)
jne    1170 <next_char+0x50>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
je     116b <next_char+0x4b>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
movl   $0xd,-0xc(%rbp)
jmp    1170 <next_char+0x50>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_char>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fgetc@plt>
cmp    $0xd,%eax
jne    114f <next_char+0x2f>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%edi
mov    $0xa,%eax
cmp    $0xa,%edi
je     114f <next_char+0x2f>
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    $0xd,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @next_char(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = icmp eq i32 %2, 13
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @fgetc(i32* %0)
%6 = icmp eq i32 %5, 10
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @ungetc(i32 %5, i32* %0)
br label %9
9: ; preds = %4, %7, %1
%10 = phi i32 [ 13, %7 ], [ 10, %4 ], [ %2, %1 ]
ret i32 %10
}
void f() {
  char *p = __builtin_malloc(42);
  __builtin_memset(p, 3, 10);
  __builtin_memset(p, 7, 33);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2a,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
mov    $0x21,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rebias();
void picosat_reset_phases(void) { rebias(); }


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

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

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

LLVM IR (-O2):
define void @picosat_reset_phases() {
%1 = tail call i32 (...) @rebias()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ readPort(char *, unsigned char *);
void receive_downstream_message(char *msg_data, unsigned char *msg_len) {
  readPort(msg_data, msg_len);
}


x86 assembly (clang, -O0):
<receive_downstream_message>:
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 <readPort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_downstream_message>:
jmp    1030 <readPort@plt>

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

LLVM IR (-O2):
define void @receive_downstream_message(i8* %0, i8* %1) {
%3 = tail call i32 @readPort(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *fn(void *arg) {
  while (true)
    sleep(10);
  return NULL;
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <sleep@plt>
jmp    111c <fn+0xc>

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

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

LLVM IR (-O2):
define noalias i8* @fn(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 10)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ nrf_write(int, unsigned char *, int);
void __attribute__((unused)) nrf_set_feature(unsigned char feature) {
  nrf_write(0x20 | 0x1D, &feature, 1);
}


x86 assembly (clang, -O0):
<nrf_set_feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3d,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <nrf_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_set_feature>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x3d,%edi
mov    $0x1,%edx
call   1030 <nrf_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @nrf_set_feature(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @nrf_write(i32 61, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @nrf_set_feature(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @nrf_write(i32 61, i8* %2, i32 1)
ret void
}
int do_773() { return 773; }


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

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

LLVM IR (-O0):
define i32 @do_773() {
ret i32 773
}

LLVM IR (-O2):
define i32 @do_773() {
ret i32 773
}
int test_imm_23int32_reg(int val) { return ((val) & (0x23 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_23int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x23,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_23int32_reg(i32 %0) {
%2 = and i32 %0, 35
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cb_get_level(int val) {
  int level = val;
  switch (level) {
  case 66:
  case 77:
  case 78:
  case 88:
    break;
  default:
    if (level < 1 || level > 49) {
      goto level_error;
    }
    break;
  }
  return level;
level_error:
  return 0;
}


x86 assembly (clang, -O0):
<cb_get_level>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x42,%eax
je     1146 <cb_get_level+0x46>
jmp    1121 <cb_get_level+0x21>
mov    -0x10(%rbp),%eax
add    $0xffffffb3,%eax
sub    $0x2,%eax
jb     1146 <cb_get_level+0x46>
jmp    1135 <cb_get_level+0x35>
mov    -0x10(%rbp),%eax
sub    $0x58,%eax
jne    114b <cb_get_level+0x4b>
jmp    1146 <cb_get_level+0x46>
jmp    1169 <cb_get_level+0x69>
cmpl   $0x1,-0xc(%rbp)
jl     115f <cb_get_level+0x5f>
cmpl   $0x31,-0xc(%rbp)
jle    1164 <cb_get_level+0x64>
jmp    1174 <cb_get_level+0x74>
jmp    1169 <cb_get_level+0x69>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <cb_get_level+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_get_level>:
mov    %edi,%eax
lea    -0x42(%rax),%ecx
cmp    $0x16,%ecx
ja     1115 <cb_get_level+0x15>
mov    $0x401801,%edx
bt     %ecx,%edx
jae    1115 <cb_get_level+0x15>
ret
lea    -0x32(%rax),%ecx
xor    %edx,%edx
cmp    $0xffffffcf,%ecx
cmovae %eax,%edx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @cb_get_level(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %4
switch i32 %6, label %8 [
i32 66, label %7
i32 77, label %7
i32 78, label %7
i32 88, label %7
]
7: ; preds = %1, %1, %1, %1
br label %16
8: ; preds = %1
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 49
br i1 %13, label %14, label %15
14: ; preds = %11, %8
br label %18
15: ; preds = %11
br label %16
16: ; preds = %15, %7
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %19
18: ; preds = %14
store i32 0, i32* %2
br label %19
19: ; preds = %18, %16
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @cb_get_level(i32 %0) {
switch i32 %0, label %2 [
i32 66, label %6
i32 77, label %6
i32 78, label %6
i32 88, label %6
]
2: ; preds = %1
%3 = add i32 %0, -50
%4 = icmp ult i32 %3, -49
%5 = select i1 %4, i32 0, i32 %0
br label %6
6: ; preds = %2, %1, %1, %1, %1
%7 = phi i32 [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %5, %2 ]
ret i32 %7
}
double acos(double x __attribute__((unused))) { return 0.0; }


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

x86 assembly (clang, -O2):
<acos>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @acos(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @acos(double %0) {
ret double 0.000000e+00
}
unsigned long UARTModemControlGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000030))) & (0x00000800));
}


x86 assembly (clang, -O0):
<UARTModemControlGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
and    $0x800,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlGet>:
mov    0x30(%rdi),%rax
and    $0x800,%eax
ret

LLVM IR (-O0):
define i64 @UARTModemControlGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 48
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 2048
ret i64 %7
}

LLVM IR (-O2):
define i64 @UARTModemControlGet(i64 %0) {
%2 = add i64 %0, 48
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 2048
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void get_string_buffer(char *s) { strcpy(s, "String"); }


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

x86 assembly (clang, -O2):
<get_string_buffer>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"String\00"
define void @get_string_buffer(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_ISVTX;
int file_sticky(const struct stat *stat) {
  return (stat->st_mode & S_ISVTX) == 0;
}


x86 assembly (clang, -O0):
<file_sticky>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ed3(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_sticky>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_ISVTX = global i32 0
define i32 @file_sticky(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @S_ISVTX
%7 = and i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_ISVTX = global i32 0
define i32 @file_sticky(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @S_ISVTX
%5 = and i32 %4, %3
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
char *cpystak(x)
char *x;
{ return (endstak(movstr(x, locstak()))); }


x86 assembly (clang, -O0):
<cpystak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <locstak@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
mov    $0x0,%al
call   1040 <movstr@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1050 <endstak@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpystak>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <locstak@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <movstr@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1050 <endstak@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i8* @cpystak(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @locstak()
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @movstr to i32 (i8*, i32, ...)*)(i8* %3, i32 %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @endstak to i32 (i32, ...)*)(i32 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @cpystak(i8* %0) {
%2 = tail call i32 (...) @locstak()
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @movstr to i32 (i8*, i32, ...)*)(i8* %0, i32 %2)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @endstak to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
scalar_t__ strchr(char *, int);
int char_isspace(int c) { return strchr(" \t\n\r\f\v", c) ? 1 : 0; }


x86 assembly (clang, -O0):
<char_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_isspace>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" \09\0A\0D\0C\0B\00"
define i32 @char_isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c" \09\0A\0D\0C\0B\00"
define i32 @char_isspace(i32 %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fct_subfile() { printf("function in subfile\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"function in subfile\0A\00"
define void @fct_subfile() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"function in subfile\00"
define void @fct_subfile() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SA1StackRelativeIndirectIndexed(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op93M1(void) { STA8(SA1StackRelativeIndirectIndexed(2)); }


x86 assembly (clang, -O0):
<Op93M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <SA1StackRelativeIndirectIndexed@plt>
mov    %eax,%edi
call   1030 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op93M1>:
push   %rax
mov    $0x2,%edi
call   1040 <SA1StackRelativeIndirectIndexed@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <STA8@plt>

LLVM IR (-O0):
define void @Op93M1() {
%1 = call i32 @SA1StackRelativeIndirectIndexed(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op93M1() {
%1 = tail call i32 @SA1StackRelativeIndirectIndexed(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bio_putbit(int);
void bio_write(int v, int n) {
  int i;
  for (i = n - 1; i >= 0; i--) {
    bio_putbit((v >> i) & 1);
  }
}


x86 assembly (clang, -O0):
<bio_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     114f <bio_write+0x3f>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%ecx
sar    %cl,%edi
and    $0x1,%edi
call   1030 <bio_putbit@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <bio_write+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bio_write>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1137 <bio_write+0x27>
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
xchg   %ax,%ax
lea    -0x2(%rbx),%ecx
mov    %ebp,%edi
shr    %cl,%edi
and    $0x1,%edi
call   1030 <bio_putbit@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <bio_write+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @bio_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = ashr i32 %12, %13
%15 = and i32 %14, 1
%16 = call i32 @bio_putbit(i32 %15)
br label %17
17: ; preds = %11
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %8
20: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @bio_write(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = lshr i32 %0, %6
%8 = and i32 %7, 1
%9 = tail call i32 @bio_putbit(i32 %8)
%10 = icmp ugt i32 %5, 1
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
void strength_test1(int *data) {
  int i = 0;
  do {
    data[data[2]] = 2;
    i = i + 1;
  } while (21 * i < data[1]);
}


x86 assembly (clang, -O0):
<strength_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
imul   $0x15,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jl     110f <strength_test1+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test1>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq 0x8(%rdi),%rcx
movl   $0x2,(%rdi,%rcx,4)
add    $0x15,%eax
cmp    0x4(%rdi),%eax
jl     1110 <strength_test1+0x10>
ret

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

LLVM IR (-O2):
define void @strength_test1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = getelementptr inbounds i32, i32* %0, i64 1
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %9, %4 ]
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 2, i32* %8
%9 = add nuw nsw i32 %5, 1
%10 = mul nsw i32 %9, 21
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %4, label %13
13: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void subtract(unsigned int a, unsigned int b) {
  unsigned int total = 0;
  if (a >= b) {
    total = a - b;
    printf("%d - %d = %d\n", a, b, total);
  } else
    printf("This calculator isn't capable of handling negative numbers.\n");
}


x86 assembly (clang, -O0):
<subtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     1156 <subtract+0x46>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1164 <subtract+0x54>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtract>:
mov    %esi,%edx
mov    %edi,%ecx
sub    %esi,%ecx
jae    1134 <subtract+0x14>
lea    0xedf(%rip),%rdi
jmp    1030 <puts@plt>
mov    %edi,%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
@.str.1 = [61 x i8] c"This calculator isn't capable of handling negative numbers.\0A\00"
define void @subtract(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp uge i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
br label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %9
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
@str = [60 x i8] c"This calculator isn't capable of handling negative numbers.\00"
define void @subtract(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sub i32 %0, %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove_space(char *);
scalar_t__ strcmp(char *, char *);
int main(void) {
  char before[] = "12 + 3";
  char after[] = "12+3";
  remove_space(before);
  if (strcmp(before, after) == 0) {
    return (0);
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xeb0(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <remove_space@plt>
lea    -0xb(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    118a <main+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1191 <main+0x71>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x33202b,0xb(%rsp)
movl   $0x2b203231,0x8(%rsp)
2b
movb   $0x0,0x4(%rsp)
movl   $0x332b3231,(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <remove_space@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.before = [7 x i8] c"12 + 3\00"
@__const.main.after = [5 x i8] c"12+3\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [5 x i8]
store i32 0, i32* %1
%4 = bitcast [7 x i8]* %2 to i8*
%5 = bitcast [5 x i8]* %3 to i8*
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = call i32 @remove_space(i8* %6)
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 0, i32* %1
br label %14
13: ; preds = %0
store i32 -1, i32* %1
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@__const.main.before = [7 x i8] c"12 + 3\00"
@__const.main.after = [5 x i8] c"12+3\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @remove_space(i8* %3)
%6 = call i64 @strcmp(i8* %3, i8* %4)
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ spg_delaunay_reduce(double **, double);
void spg_delaunay_reduce_(double lattice[3][3], double *symprec) {
  spg_delaunay_reduce(lattice, *symprec);
}


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

x86 assembly (clang, -O2):
<spg_delaunay_reduce_>:
movsd  (%rsi),%xmm0
jmp    1030 <spg_delaunay_reduce@plt>

LLVM IR (-O0):
define void @spg_delaunay_reduce_([3 x double]* %0, double* %1) {
%3 = alloca [3 x double]*
%4 = alloca double*
store [3 x double]* %0, [3 x double]** %3
store double* %1, double** %4
%5 = load [3 x double]*, [3 x double]** %3
%6 = bitcast [3 x double]* %5 to double**
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = call i32 @spg_delaunay_reduce(double** %6, double %8)
ret void
}

LLVM IR (-O2):
define void @spg_delaunay_reduce_([3 x double]* %0, double* nocapture %1) {
%3 = bitcast [3 x double]* %0 to double**
%4 = load double, double* %1
%5 = tail call i32 @spg_delaunay_reduce(double** %3, double %4)
ret void
}
void answer_analyze(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @INT0_intr() {
ret void
}
double glp_difftime(double t1, double t0) { return (t1 - t0) / 1000.0; }


x86 assembly (clang, -O0):
<glp_difftime>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glp_difftime>:
subsd  %xmm1,%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @glp_difftime(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = fdiv double %7, 1.000000e+03
ret double %8
}

LLVM IR (-O2):
define double @glp_difftime(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fdiv double %3, 1.000000e+03
ret double %4
}
void elfoutlsbu16(unsigned char *bp, unsigned int v) {
  ((bp)[1] = (v >> 8), (bp)[0] = v);
}


x86 assembly (clang, -O0):
<elfoutlsbu16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<elfoutlsbu16>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @elfoutlsbu16(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 = lshr i32 %5, 8
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
ret void
}

LLVM IR (-O2):
define void @elfoutlsbu16(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
%6 = trunc i32 %1 to i8
store i8 %6, i8* %0
ret void
}