xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void pce_usage(FILE *out) {
  static const char usage_str[] = ("Usage:                              \n"
                                   "  pce [command] [options]          \n\n"
                                   "Commands:                            \n"
                                   "  server    run pce server (PCE)     \n"
                                   "  client    run pce client (PCC)     \n"
                                   "  help      show this help and exit\n\n"
                                   "Examples:                            \n"
                                   "  pce server -d -p 4189              \n"
                                   "  pce client                       \n\n");
  fprintf(out, "%s", usage_str);
  fflush(out);
  return;
}


x86 assembly (clang, -O0):
<pce_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x101c(%rip),%rsi
lea    0xec2(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pce_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x152,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@pce_usage.usage_str = internal constant [339 x i8] c"Usage: \0A pce [command] [options] \0A\0ACommands: \0A server run pce server (PCE) \0A client run pce client (PCC) \0A help show this help and exit\0A\0AExamples: \0A pce server -d -p 4189 \0A pce client \0A\0A\00"
@.str = [3 x i8] c"%s\00"
define void @pce_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([339 x i8], [339 x i8]* @pce_usage.usage_str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fflush(i32* %5)
ret void
}

LLVM IR (-O2):
@pce_usage.usage_str = internal constant [339 x i8] c"Usage: \0A pce [command] [options] \0A\0ACommands: \0A server run pce server (PCE) \0A client run pce client (PCC) \0A help show this help and exit\0A\0AExamples: \0A pce server -d -p 4189 \0A pce client \0A\0A\00"
define void @pce_usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([339 x i8], [339 x i8]* @pce_usage.usage_str, i64 0, i64 0), i64 338, i64 1, i32* %0)
%3 = tail call i32 @fflush(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int gmpint_cmp(mpz_t *op, mpz_t *op2) { return mpz_cmp(*op, *op2); }


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

x86 assembly (clang, -O2):
<gmpint_cmp>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <mpz_cmp@plt>

LLVM IR (-O0):
define i32 @gmpint_cmp(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @mpz_cmp(i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @gmpint_cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @mpz_cmp(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ a(char *);
void __attribute__((constructor)) initE() { a("initE"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"initE\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initE, i8* null }]
define void @initE() {
%1 = call i32 @a(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"initE\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initE, i8* null }]
define void @initE() {
%1 = tail call i32 @a(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ shutdownComms();
void sighandler(int signum) {
  shutdownComms();
  exit(-1);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <shutdownComms@plt>
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
xor    %eax,%eax
call   1040 <shutdownComms@plt>
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @shutdownComms()
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @sighandler(i32 %0) {
%2 = tail call i32 (...) @shutdownComms()
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int Operand_br2_decode(unsigned int *valp) {
  *valp = *valp << 1;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_br2_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_br2_decode>:
shll   (%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_br2_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 1
store i32 %3, i32* %0
ret i32 0
}
unsigned int getInt24(unsigned char *data, int offset) {
  unsigned int res;
  res = data[offset + 0] << 0;
  res += data[offset + 1] << 8;
  res += data[offset + 2] << 16;
  return res;
}


x86 assembly (clang, -O0):
<getInt24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x10,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInt24>:
movslq %esi,%rax
movzwl (%rdi,%rax,1),%ecx
movzbl 0x2(%rdi,%rax,1),%eax
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getInt24(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 0
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 0
store i32 %13, i32* %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = shl i32 %20, 8
%22 = load i32, i32* %5
%23 = add i32 %22, %21
store i32 %23, i32* %5
%24 = load i8*, i8** %3
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 16
%32 = load i32, i32* %5
%33 = add i32 %32, %31
store i32 %33, i32* %5
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
define i32 @getInt24(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 8
%13 = or i32 %12, %6
%14 = add nsw i32 %1, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl nuw nsw i32 %18, 16
%20 = or i32 %13, %19
ret i32 %20
}
void thorium_nop(void *pointer) {}


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

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

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

LLVM IR (-O2):
define void @thorium_nop(i8* nocapture %0) {
ret void
}
unsigned int uasn1_length_length(unsigned int length) {
  unsigned int l = 1;
  if (length >= 0x80) {
    for (l = 2; (length = length >> 8); l++)
      ;
  }
  return l;
}


x86 assembly (clang, -O0):
<uasn1_length_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x80,-0x4(%rbp)
jb     114c <uasn1_length_length+0x4c>
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1147 <uasn1_length_length+0x47>
jmp    1139 <uasn1_length_length+0x39>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <uasn1_length_length+0x22>
jmp    114c <uasn1_length_length+0x4c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uasn1_length_length>:
mov    $0x1,%eax
cmp    $0x80,%edi
jb     1140 <uasn1_length_length+0x40>
mov    $0x2,%eax
cmp    $0x100,%edi
jb     1140 <uasn1_length_length+0x40>
mov    $0x2,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shr    $0x8,%ecx
add    $0x1,%eax
cmp    $0xffff,%edi
mov    %ecx,%edi
ja     1130 <uasn1_length_length+0x30>
ret

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

LLVM IR (-O2):
define i32 @uasn1_length_length(i32 %0) {
%2 = icmp ugt i32 %0, 127
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = icmp ult i32 %0, 256
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 2, %3 ]
%7 = phi i32 [ %8, %5 ], [ %0, %3 ]
%8 = lshr i32 %7, 8
%9 = add nuw nsw i32 %6, 1
%10 = icmp ult i32 %7, 65536
br i1 %10, label %11, label %5
11: ; preds = %5, %3, %1
%12 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %9, %5 ]
ret i32 %12
}
/* Variables and functions */
int add_numbers(int, int);
int add_numbo(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int result;
  int bob;
  result = add_numbers(4, 3);
  bob = add_numbo(6, 7);
  printf("sum is %d\n", result);
  printf("sum is %d\n", bob);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
mov    $0x3,%esi
call   1050 <add_numbers@plt>
mov    %eax,-0x14(%rbp)
mov    $0x6,%edi
mov    $0x7,%esi
call   1040 <add_numbo@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x4,%edi
mov    $0x3,%esi
call   1050 <add_numbers@plt>
mov    %eax,%ebx
mov    $0x6,%edi
mov    $0x7,%esi
call   1040 <add_numbo@plt>
mov    %eax,%ebp
lea    0xea3(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"sum is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @add_numbers(i32 4, i32 3)
store i32 %8, i32* %6
%9 = call i32 @add_numbo(i32 6, i32 7)
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"sum is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add_numbers(i32 4, i32 3)
%4 = tail call i32 @add_numbo(i32 6, i32 7)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
long rshift16_round(const long l) { return (l + 0x8000) >> 16; }


x86 assembly (clang, -O0):
<rshift16_round>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8000,%rax
sar    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rshift16_round>:
lea    0x8000(%rdi),%rax
sar    $0x10,%rax
ret

LLVM IR (-O0):
define i64 @rshift16_round(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 32768
%5 = ashr i64 %4, 16
ret i64 %5
}

LLVM IR (-O2):
define i64 @rshift16_round(i64 %0) {
%2 = add nsw i64 %0, 32768
%3 = ashr i64 %2, 16
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
void GenGrowStack(int size) {
  if (!size)
    return;
  GenPrintInstr2Operands(0x0A, 0, 0x0A, 0, 0x0D, size);
}


x86 assembly (clang, -O0):
<GenGrowStack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <GenGrowStack+0x1a>
jmp    1144 <GenGrowStack+0x34>
mov    -0x4(%rbp),%r9d
mov    $0xa,%edx
xor    %ecx,%ecx
mov    $0xd,%r8d
mov    %edx,%edi
mov    %ecx,%esi
call   1030 <GenPrintInstr2Operands@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenGrowStack>:
test   %edi,%edi
je     1130 <GenGrowStack+0x20>
mov    %edi,%r9d
mov    $0xa,%edi
xor    %esi,%esi
mov    $0xa,%edx
xor    %ecx,%ecx
mov    $0xd,%r8d
jmp    1030 <GenPrintInstr2Operands@plt>
ret

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

LLVM IR (-O2):
define void @GenGrowStack(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @GenPrintInstr2Operands(i32 10, i32 0, i32 10, i32 0, i32 13, i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
save_argv(av, af) char *av[], *af;
{
  while (*av) {
    strcat(af, *av++);
    if (*av)
      strcat(af, " ");
  }
}


x86 assembly (clang, -O0):
<save_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     116c <save_argv+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rsi
call   1030 <strcat@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1167 <save_argv+0x57>
mov    -0x18(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1030 <strcat@plt>
jmp    1120 <save_argv+0x10>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_argv>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1169 <save_argv+0x49>
mov    %rdi,%rbx
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <strcat@plt>
cmpq   $0x0,(%rbx)
je     1169 <save_argv+0x49>
mov    %r14,%rdi
call   1030 <strlen@plt>
movw   $0x20,(%r14,%rax,1)
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1140 <save_argv+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @save_argv(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %18, label %5
5: ; preds = %2, %12
%6 = phi i8* [ %16, %12 ], [ %3, %2 ]
%7 = phi i8** [ %8, %12 ], [ %0, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = tail call i8* @strcat(i8* dereferenceable(1) %1, i8* %6)
%10 = load i8*, i8** %8
%11 = icmp eq i8* %10, null
br i1 %11, label %18, label %12
12: ; preds = %5
%13 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%14 = getelementptr i8, i8* %1, i64 %13
%15 = bitcast i8* %14 to i16*
store i16 32, i16* %15
%16 = load i8*, i8** %8
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %5
18: ; preds = %5, %12, %2
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct multiply_resource_id_pool {
  int dummy;
};
struct multiple_ir {
  int dummy;
};
struct multiple_error {
  int dummy;
};

/* Variables and functions */
int multiply_resource_get_bool(struct multiple_error *, struct multiple_ir *,
                               struct multiply_resource_id_pool *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/);
int multiply_resource_get_false(struct multiple_error *err,
                                struct multiple_ir *ir,
                                struct multiply_resource_id_pool *res_id,
                                uint32_t *id_out) {
  return multiply_resource_get_bool(err, ir, res_id, id_out, 0);
}


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

x86 assembly (clang, -O2):
<multiply_resource_get_false>:
xor    %r8d,%r8d
jmp    1030 <multiply_resource_get_bool@plt>

LLVM IR (-O0):
%struct.multiple_error = type { i32 }
%struct.multiple_ir = type { i32 }
%struct.multiply_resource_id_pool = type { i32 }
define i32 @multiply_resource_get_false(%struct.multiple_error* %0, %struct.multiple_ir* %1, %struct.multiply_resource_id_pool* %2, i32* %3) {
%5 = alloca %struct.multiple_error*
%6 = alloca %struct.multiple_ir*
%7 = alloca %struct.multiply_resource_id_pool*
%8 = alloca i32*
store %struct.multiple_error* %0, %struct.multiple_error** %5
store %struct.multiple_ir* %1, %struct.multiple_ir** %6
store %struct.multiply_resource_id_pool* %2, %struct.multiply_resource_id_pool** %7
store i32* %3, i32** %8
%9 = load %struct.multiple_error*, %struct.multiple_error** %5
%10 = load %struct.multiple_ir*, %struct.multiple_ir** %6
%11 = load %struct.multiply_resource_id_pool*, %struct.multiply_resource_id_pool** %7
%12 = load i32*, i32** %8
%13 = call i32 @multiply_resource_get_bool(%struct.multiple_error* %9, %struct.multiple_ir* %10, %struct.multiply_resource_id_pool* %11, i32* %12, i32 0)
ret i32 %13
}

LLVM IR (-O2):
%struct.multiple_error = type { i32 }
%struct.multiple_ir = type { i32 }
%struct.multiply_resource_id_pool = type { i32 }
define i32 @multiply_resource_get_false(%struct.multiple_error* %0, %struct.multiple_ir* %1, %struct.multiply_resource_id_pool* %2, i32* %3) {
%5 = tail call i32 @multiply_resource_get_bool(%struct.multiple_error* %0, %struct.multiple_ir* %1, %struct.multiply_resource_id_pool* %2, i32* %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int errno;
int klogctl(int, char *, int);
int __sulong_posix_syslog(int type, char *bufp, int len) {
  {
    int native_errno = errno;
    int result = klogctl(type, bufp, len);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_syslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <klogctl@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    115a <__sulong_posix_syslog+0x4a>
xor    %eax,%eax
mov    0x2e8d(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%ecx
mov    0x2e7c(%rip),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_syslog>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <klogctl@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_syslog(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @errno
%5 = tail call i32 @klogctl(i32 %0, i8* %1, i32 %2)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %8, i32 %5
store i32 %4, i32* @errno
ret i32 %9
}
int isValidCell(int row, int col) {
  if (row < 0 || col < 0 || row >= 3 || col >= 3)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isValidCell>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1132 <isValidCell+0x32>
cmpl   $0x0,-0xc(%rbp)
jl     1132 <isValidCell+0x32>
cmpl   $0x3,-0x8(%rbp)
jge    1132 <isValidCell+0x32>
cmpl   $0x3,-0xc(%rbp)
jl     113e <isValidCell+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <isValidCell+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidCell>:
mov    %esi,%eax
or     %edi,%eax
setns  %al
cmp    $0x3,%edi
setl   %cl
and    %al,%cl
cmp    $0x3,%esi
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @isValidCell(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp slt i32 %3, 0
%5 = icmp sgt i32 %0, 2
%6 = or i1 %5, %4
%7 = icmp sgt i32 %1, 2
%8 = or i1 %7, %6
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
scalar_t__ EINTR;
int api_error_translate(scalar_t__);
scalar_t__ close(int);
scalar_t__ errno;
int api_close(int fd) {
  while (0 != close(fd)) {
    if (errno != EINTR) {
      return api_error_translate(errno);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<api_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1177 <api_close+0x57>
mov    0x2e98(%rip),%rax
mov    (%rax),%rax
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
je     1172 <api_close+0x52>
mov    0x2e7e(%rip),%rax
mov    (%rax),%rdi
call   1040 <api_error_translate@plt>
mov    %eax,-0x4(%rbp)
jmp    117e <api_close+0x5e>
jmp    112b <api_close+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<api_close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2eb2(%rip),%r14
mov    0x2ea3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
test   %rax,%rax
je     115e <api_close+0x3e>
mov    (%r14),%rdi
cmp    (%r15),%rdi
je     1140 <api_close+0x20>
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <api_error_translate@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @api_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = call i64 @close(i32 %5)
%7 = icmp ne i64 0, %6
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i64, i64* @errno
%10 = load i64, i64* @EINTR
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i64, i64* @errno
%14 = call i32 @api_error_translate(i64 %13)
store i32 %14, i32* %2
br label %17
15: ; preds = %8
br label %4
16: ; preds = %4
store i32 0, i32* %2
br label %17
17: ; preds = %16, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @api_close(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i64 @close(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %5
%10 = tail call i32 @api_error_translate(i64 %6)
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ %10, %9 ], [ 0, %2 ]
ret i32 %12
}
int fat_mountCheck() {
  int mediaStatus;
  int ret;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @fat_mountCheck() {
%1 = alloca i32
%2 = alloca i32
ret i32 1
}

LLVM IR (-O2):
define i32 @fat_mountCheck() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int smaller(int, int);
int main() {
  int a, b, min;
  a = 10;
  b = 2;
  min = smaller(a, b);
  printf("%d\n", min);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <smaller@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x2,%esi
call   1030 <smaller@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @smaller(i32 10, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int blk_oversized_queue_0(int *q) {
  if (q[2])
    return q[1] == 5;
  return (q[0] != 5);
}


x86 assembly (clang, -O0):
<blk_oversized_queue_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x8(%rax)
je     112e <blk_oversized_queue_0+0x2e>
mov    -0x10(%rbp),%rax
cmpl   $0x5,0x4(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <blk_oversized_queue_0+0x40>
mov    -0x10(%rbp),%rax
cmpl   $0x5,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blk_oversized_queue_0>:
cmpl   $0x0,0x8(%rdi)
je     1111 <blk_oversized_queue_0+0x11>
cmpl   $0x5,0x4(%rdi)
sete   %al
movzbl %al,%eax
ret
cmpl   $0x5,(%rdi)
setne  %al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @blk_oversized_queue_0(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 5
br label %12
9: ; preds = %1
%10 = load i32, i32* %0
%11 = icmp ne i32 %10, 5
br label %12
12: ; preds = %9, %5
%13 = phi i1 [ %8, %5 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int japi_isvisible(int);
int j_isvisible(int arg0) { return (japi_isvisible(arg0)); }


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

x86 assembly (clang, -O2):
<j_isvisible>:
jmp    1030 <japi_isvisible@plt>

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

LLVM IR (-O2):
define i32 @j_isvisible(i32 %0) {
%2 = tail call i32 @japi_isvisible(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void die(char *msg, int status) {
  if (msg)
    fputs(msg, stderr);
  exit(status);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <die+0x2c>
mov    -0x8(%rbp),%rdi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %esi,%ebx
test   %rdi,%rdi
je     1136 <die+0x16>
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* %8, i32 %9)
br label %11
11: ; preds = %7, %2
%12 = load i32, i32* %4
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @die(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* %0, i32 %5)
br label %7
7: ; preds = %4, %2
%8 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ tempnam();
int main() {
  tempnam();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tempnam()
ret i32 0
}
void foo_2_2_2_2_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_2_2_2_1_1() {
ret void
}
void CON_Print(const char *text) {}


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

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

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

LLVM IR (-O2):
define void @CON_Print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(char *);
int main() {
  char buf[64];
  f(buf);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    %rsp,%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @f(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @f(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ flush_bcache();
int /*<<< orphan*/ flush_ucache();
void do_exit() {
  flush_ucache();
  flush_bcache();
}


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

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

LLVM IR (-O0):
define void @do_exit() {
%1 = call i32 (...) @flush_ucache()
%2 = call i32 (...) @flush_bcache()
ret void
}

LLVM IR (-O2):
define void @do_exit() {
%1 = tail call i32 (...) @flush_ucache()
%2 = tail call i32 (...) @flush_bcache()
ret void
}
int found_in_mod2(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @found_in_mod2() {
ret i32 2
}

LLVM IR (-O2):
define i32 @found_in_mod2() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int a = 2, b = 3;
  a /= b;
  print("a 0");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
xor    %edi,%edi
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"a 0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = sdiv i32 %5, %4
store i32 %6, i32* %2
%7 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = call i32 @printid(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"a 0\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 0)
ret i32 0
}
int bar(int i) {
  if ((i & 4) == 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x2,%eax
jne    1122 <bar+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <bar+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i > 5) {
    if (i != 10) {
      i = i - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    114b <main+0x3b>
cmpl   $0xa,-0x8(%rbp)
je     1146 <main+0x36>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x6,%eax
jl     1130 <main+0x20>
nopl   (%rax)
lea    -0x1(%rax),%ecx
cmp    $0xa,%eax
cmove  %eax,%ecx
mov    %ecx,%eax
cmp    $0x5,%ecx
ja     1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 5
br i1 %2, label %3, label %9
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ %1, %0 ]
%5 = icmp eq i32 %4, 10
%6 = add nsw i32 %4, -1
%7 = select i1 %5, i32 10, i32 %6
%8 = icmp ugt i32 %7, 5
br i1 %8, label %3, label %9
9: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ strlen(char *);
char *strndup(char *, scalar_t__);
char *remove_quote(char *string) {
  if (string[0] == '\'')
    return strndup(string + 1, strlen(string) - 2);
  else
    return strndup(string, strlen(string));
}


x86 assembly (clang, -O0):
<remove_quote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
jne    116a <remove_quote+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
sub    $0x2,%rsi
call   1040 <strndup@plt>
mov    %rax,-0x8(%rbp)
jmp    118b <remove_quote+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1040 <strndup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_quote>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmpb   $0x27,(%rdi)
jne    1141 <remove_quote+0x21>
lea    0x1(%rbx),%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x2(%rax),%rsi
mov    %r14,%rdi
jmp    114f <remove_quote+0x2f>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strndup@plt>

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

LLVM IR (-O2):
define noalias i8* @remove_quote(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 39
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i64 @strlen(i8* %0)
%7 = add nsw i64 %6, -2
%8 = tail call i8* @strndup(i8* %5, i64 %7)
br label %12
9: ; preds = %1
%10 = tail call i64 @strlen(i8* %0)
%11 = tail call i8* @strndup(i8* %0, i64 %10)
br label %12
12: ; preds = %9, %4
%13 = phi i8* [ %8, %4 ], [ %11, %9 ]
ret i8* %13
}
int fun868() { return 868; }


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

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

LLVM IR (-O0):
define i32 @fun868() {
ret i32 868
}

LLVM IR (-O2):
define i32 @fun868() {
ret i32 868
}
char *strcpy(char *dest, const char *src) {
  char *p;
  p = dest;
  while (*src != '\0')
    *p++ = *src++;
  *p = '\0';
  return (dest);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <strcpy+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

LLVM IR (-O0):
define i8* @strcpy(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
store i8* %6, i8** %5
br label %7
7: ; preds = %12, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
%15 = load i8, i8* %13
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %5
store i8 %15, i8* %16
br label %7
18: ; preds = %7
%19 = load i8*, i8** %5
store i8 0, i8* %19
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
int metatile_delete(struct storage_backend *store, const char *xmlconfig, int x,
                    int y, int z) {
  return 0;
}


x86 assembly (clang, -O0):
<metatile_delete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.storage_backend = type opaque
define i32 @metatile_delete(%struct.storage_backend* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.storage_backend*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.storage_backend* %0, %struct.storage_backend** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
%struct.storage_backend = type opaque
define i32 @metatile_delete(%struct.storage_backend* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int natural(double);
int sqrt(int);
int hexagonal(uint64_t x) {
  double h = (sqrt(8 * x + 1) + 1) / 4;
  return natural(h);
}


x86 assembly (clang, -O0):
<hexagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
add    $0x1,%edi
call   1030 <sqrt@plt>
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <natural@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexagonal>:
push   %rax
lea    0x1(,%rdi,8),%edi
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
add    $0x4,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
cvtsi2sd %eax,%xmm0
pop    %rax
jmp    1040 <natural@plt>

LLVM IR (-O0):
define i32 @hexagonal(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 8, %4
%6 = add nsw i32 %5, 1
%7 = call i32 @sqrt(i32 %6)
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %8, 4
%10 = sitofp i32 %9 to double
store double %10, double* %3
%11 = load double, double* %3
%12 = call i32 @natural(double %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @hexagonal(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = or i32 %2, 1
%4 = tail call i32 @sqrt(i32 %3)
%5 = add nsw i32 %4, 1
%6 = sdiv i32 %5, 4
%7 = sitofp i32 %6 to double
%8 = tail call i32 @natural(double %7)
ret i32 %8
}