xunge/DecIR huggingface dataset:
/* Variables and functions */
long strtoul(char const *, char **, int);
long strtol(const char *nptr, char **endptr, int base) {
  if (*nptr == '-')
    return -strtoul(nptr + 1, endptr, base);
  return strtoul(nptr, endptr, base);
}


x86 assembly (clang, -O0):
<strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1158 <strtol+0x48>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strtoul@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    116c <strtol+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strtoul@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtol>:
push   %rax
cmpb   $0x2d,(%rdi)
jne    1124 <strtol+0x14>
add    $0x1,%rdi
call   1030 <strtoul@plt>
neg    %rax
pop    %rcx
ret
pop    %rax
jmp    1030 <strtoul@plt>

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

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** nocapture %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i64 @strtoul(i8* %7, i8** %1, i32 %2)
%9 = sub nsw i64 0, %8
br label %12
10: ; preds = %3
%11 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
br label %12
12: ; preds = %10, %6
%13 = phi i64 [ %9, %6 ], [ %11, %10 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ isinf(double);
int /*<<< orphan*/ isnan(double);
int isnumber(double x) { return !isinf(x) && !isnan(x); }


x86 assembly (clang, -O0):
<isnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <isinf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    115c <isnumber+0x3c>
movsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumber>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <isinf@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1135 <isnumber+0x15>
pop    %rcx
ret
movsd  (%rsp),%xmm0
call   1030 <isnan@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isnumber(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @isinf(double %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load double, double* %2
%8 = call i32 @isnan(double %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isnumber(double %0) {
%2 = tail call i32 @isinf(double %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @isnan(double %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SMUADX(uint32_t x, uint32_t y) {
  return ((uint32_t)(((((int32_t)x << 16) >> 16) * (((int32_t)y) >> 16)) +
                     ((((int32_t)x) >> 16) * (((int32_t)y << 16) >> 16))));
}


x86 assembly (clang, -O0):
<__SMUADX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rdx
shl    $0x10,%edx
sar    $0x10,%edx
imul   %edx,%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SMUADX>:
movswl %di,%eax
movswl %si,%ecx
mov    %esi,%edx
sar    $0x10,%edx
imul   %eax,%edx
sar    $0x10,%edi
imul   %edi,%ecx
add    %edx,%ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
define i64 @__SMUADX(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 16
%8 = ashr i32 %7, 16
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
%11 = ashr i32 %10, 16
%12 = mul nsw i32 %8, %11
%13 = load i64, i64* %3
%14 = trunc i64 %13 to i32
%15 = ashr i32 %14, 16
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 16
%19 = ashr i32 %18, 16
%20 = mul nsw i32 %15, %19
%21 = add nsw i32 %12, %20
%22 = sext i32 %21 to i64
ret i64 %22
}

LLVM IR (-O2):
define i64 @__SMUADX(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 16
%5 = ashr exact i32 %4, 16
%6 = trunc i64 %1 to i32
%7 = ashr i32 %6, 16
%8 = mul nsw i32 %5, %7
%9 = ashr i32 %3, 16
%10 = shl i32 %6, 16
%11 = ashr exact i32 %10, 16
%12 = mul nsw i32 %11, %9
%13 = add nsw i32 %12, %8
%14 = sext i32 %13 to i64
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ prg32setBank0(int /*<<< orphan*/);
void m242_reset() { prg32setBank0(0); }


x86 assembly (clang, -O0):
<m242_reset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <prg32setBank0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m242_reset>:
xor    %edi,%edi
jmp    1030 <prg32setBank0@plt>

LLVM IR (-O0):
define void @m242_reset() {
%1 = call i32 @prg32setBank0(i32 0)
ret void
}

LLVM IR (-O2):
define void @m242_reset() {
%1 = tail call i32 @prg32setBank0(i32 0)
ret void
}
int tls13_server_certificate_recv(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_server_certificate_recv(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int partition(int, int);
void quick_sort(int low, int high) {
  int pindex;
  if (low < high) {
    pindex = partition(low, high);
    quick_sort(low, pindex - 1);
    quick_sort(pindex + 1, high);
  } else
    return;
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1169 <quick_sort+0x49>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <quick_sort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <quick_sort@plt>
jmp    116e <quick_sort+0x4e>
jmp    116e <quick_sort+0x4e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jge    1150 <quick_sort+0x30>
mov    %esi,%r14d
mov    %edi,%ebp
nopl   (%rax)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%esi
mov    %ebp,%edi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1130 <quick_sort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(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* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @partition(i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %4
br label %20
19: ; preds = %2
br label %20
20: ; preds = %19, %9
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = tail call i32 @partition(i32 %5, i32 %1)
%7 = add nsw i32 %6, -1
tail call void @quick_sort(i32 %5, i32 %7)
%8 = add nsw i32 %6, 1
%9 = icmp slt i32 %8, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
OP(dd, ba) {
  illegal_1();
  op_ba();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_ba@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_ba()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ba()
ret i32 undef
}
void g_cclosure_marshal_VOID__VOID() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_marshal_VOID__VOID() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void sigcleanup(int sig) {
  signal(SIGABRT, SIG_DFL);
  fprintf(stderr, "signal %i received, aborting\n", sig);
  cleanup();
  abort();
}


x86 assembly (clang, -O0):
<sigcleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe8b(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1060 <cleanup@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sigcleanup>:
push   %rbx
mov    %edi,%ebx
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
mov    %ebx,%edx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1060 <cleanup@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
@stderr = global i32 0
@.str = [30 x i8] c"signal %i received, aborting\0A\00"
define void @sigcleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGABRT
%4 = load i32, i32* @SIG_DFL
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = load i32, i32* %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @cleanup()
%10 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
@stderr = global i32 0
@.str = [30 x i8] c"signal %i received, aborting\0A\00"
define void @sigcleanup(i32 %0) {
%2 = load i32, i32* @SIGABRT
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %2, i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 (...) @cleanup()
%8 = tail call i32 (...) @abort()
unreachable
}
unsigned long hash(const char *str) {
  unsigned char *ptr = (unsigned char *)str;
  unsigned long h = 5381;
  int c;
  while ((c = *ptr++))
    h = ((h << 5) + h) + c;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1152 <hash+0x52>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <hash+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
int cmpfunc(const void *a, const void *b) {
  int *p = (int *)a;
  int *q = (int *)b;
  return (*p - *q);
}


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

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

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

LLVM IR (-O2):
define i32 @cmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
long double __creall(long double _Complex z) { return __real__ z; }


x86 assembly (clang, -O0):
<__creall>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__creall>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @__creall({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @__creall({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %3
}
/* Variables and functions */
char *strstr(char *, char *);
int strpos(char *str, char *substr) {
  char *straddr = strstr(str, substr);
  if (!straddr)
    return -1;
  else
    return (straddr - str) / (sizeof(char));
}


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1148 <strpos+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <strpos+0x4a>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
shr    $0x0,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @strpos(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
__attribute__((always_)) int arch_is_kernel_data(unsigned long addr) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @arch_is_kernel_data(i64 %0) {
ret i32 0
}
int arraySize(char *array) {
  int i = 0;
  while (array[i]) {
    i++;
  }
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @arraySize(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ u;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
__attribute__((always_)) uint64_t string_as_uint64(const char *s) {
  uint64_t u;
  memcpy(&u, s, sizeof(u));
  return u;
}


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

x86 assembly (clang, -O2):
<string_as_uint64>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_as_uint64(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @string_as_uint64(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void main() {
  float x = 2, y = 3, z;
  z = (x) * (y);
  printf("%f\t", z);
  z = (x * x + 2 * x - 5) * (y + 3);
  printf("%f\n", z);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xed8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xec3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeab(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xe8e(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xe75(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe65(%rip),%xmm1
addss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe57(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
movsd  0xed0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
movsd  0xec2(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\09\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
store float 2.000000e+00, float* %1
store float 3.000000e+00, float* %2
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %8)
%10 = load float, float* %1
%11 = load float, float* %1
%12 = load float, float* %1
%13 = fmul float 2.000000e+00, %12
%14 = call float @llvm.fmuladd.f32(float %10, float %11, float %13)
%15 = fsub float %14, 5.000000e+00
%16 = load float, float* %2
%17 = fadd float %16, 3.000000e+00
%18 = fmul float %15, %17
store float %18, float* %3
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %20)
%22 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\09\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 6.000000e+00)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double 1.800000e+01)
%3 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ program();
int yyselect();
YYSTART() {
  printf("%d\n", 3);
  switch (yyselect()) {
  case 109: {
    program();
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<YYSTART>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <yyselect@plt>
sub    $0x6d,%eax
jne    117c <YYSTART+0x3c>
jmp    116e <YYSTART+0x2e>
mov    $0x0,%al
call   1060 <program@plt>
mov    $0x0,%al
call   1050 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<YYSTART>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x6d,%eax
jne    116c <YYSTART+0x2c>
xor    %eax,%eax
call   1060 <program@plt>
xor    %eax,%eax
call   1050 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @YYSTART() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = call i32 (...) @yyselect()
switch i32 %3, label %7 [
i32 109, label %4
]
4: ; preds = %0
%5 = call i32 (...) @program()
%6 = call i32 (...) @get_lexval()
br label %7
7: ; preds = %0, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @YYSTART() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 (...) @yyselect()
%3 = icmp eq i32 %2, 109
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (...) @program()
%6 = tail call i32 (...) @get_lexval()
br label %7
7: ; preds = %0, %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __sql_free(void **ptr) {
  if (*ptr) {
    free(*ptr);
    *ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<__sql_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <__sql_free+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sql_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <__sql_free+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__sql_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ utf8_write_to(int, int /*<<< orphan*/ *);
void tab_write_to(FILE *s) {
  switch (2) {
  case 0:
    fprintf(s, "\t");
    break;
  case 1:
    fprintf(s, "    ");
    break;
  case 2:
    utf8_write_to(0x1F32D, s);
    break;
  }
}


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

x86 assembly (clang, -O2):
<tab_write_to>:
mov    %rdi,%rsi
mov    $0x1f32d,%edi
jmp    1030 <utf8_write_to@plt>

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

LLVM IR (-O2):
define void @tab_write_to(i32* %0) {
%2 = tail call i32 @utf8_write_to(i32 127789, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ JP_instr(int, int);
void JP(void) { JP_instr(195, 194); }


x86 assembly (clang, -O0):
<JP>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc3,%edi
mov    $0xc2,%esi
call   1030 <JP_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<JP>:
mov    $0xc3,%edi
mov    $0xc2,%esi
jmp    1030 <JP_instr@plt>

LLVM IR (-O0):
define void @JP() {
%1 = call i32 @JP_instr(i32 195, i32 194)
ret void
}

LLVM IR (-O2):
define void @JP() {
%1 = tail call i32 @JP_instr(i32 195, i32 194)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bad_alist_file() {
  fprintf(stderr, "Alist file doesn't have the right format\n");
  exit(1);
}


x86 assembly (clang, -O0):
<bad_alist_file>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bad_alist_file>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Alist file doesn't have the right format\0A\00"
define void @bad_alist_file() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Alist file doesn't have the right format\0A\00"
define void @bad_alist_file() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ strlen(char const *);
scalar_t__ wad_malloc(scalar_t__);
int /*<<< orphan*/ wad_strcpy(char *, char const *);
char *wad_strdup(const char *c) {
  char *t;
  if (!c)
    c = "";
  t = (char *)wad_malloc(strlen(c) + 1);
  wad_strcpy(t, c);
  return t;
}


x86 assembly (clang, -O0):
<wad_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <wad_strdup+0x22>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <wad_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <wad_strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wad_strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
lea    0xec2(%rip),%rbx
cmovne %rdi,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <wad_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <wad_strcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @wad_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @wad_malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @wad_strcpy(i8* %7, i8* %3)
ret i8* %7
}
void outer_test() {
  extern float outer1;
  extern float outer2;
  extern float outer3;
  double outer4;
  extern int outer5;
  extern int outer6;
  int outer7;
  extern int outer8;
  extern int outer9;
  {
    extern int outer9;
  }
}


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

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

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

LLVM IR (-O2):
define void @outer_test() {
ret void
}
void foo319(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo319(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_write_17(unsigned int data) {
  unsigned int bank_offset = 0x0C20;
  unsigned int bit_index = 6;
  exynos_5410_gpio_write_mask(bank_offset, ((data & 1U) << bit_index),
                              (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_write_17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xc20,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
and    $0x1,%esi
mov    -0xc(%rbp),%ecx
shl    %cl,%esi
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_write_17>:
mov    %edi,%esi
shl    $0x6,%esi
and    $0x40,%esi
mov    $0xc20,%edi
mov    $0x40,%edx
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_write_17(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 3104, i32* %3
store i32 6, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = call i32 @exynos_5410_gpio_write_mask(i32 %5, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_write_17(i32 %0) {
%2 = shl i32 %0, 6
%3 = and i32 %2, 64
%4 = tail call i32 @exynos_5410_gpio_write_mask(i32 3104, i32 %3, i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char **argv) {
  long a[4] = {7, 19, 11, 255};
  int tot = 0;
  for (int i = 0; i < 4; i++)
    tot = (tot * 256) + a[i];
  if (tot == 0x07130bff)
    return 0;
  abort();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x4,-0x38(%rbp)
jge    118c <main+0x7c>
mov    -0x34(%rbp),%eax
shl    $0x8,%eax
cltq
movslq -0x38(%rbp),%rcx
add    -0x30(%rbp,%rcx,8),%rax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1160 <main+0x50>
cmpl   $0x7130bff,-0x34(%rbp)
jne    11a1 <main+0x91>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
@__const.main.a = [4 x i64] [i64 7, i64 19, i64 11, i64 255]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i64]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [4 x i64]* %6 to i8*
store i32 0, i32* %7
store i32 0, i32* %8
br label %10
10: ; preds = %23, %2
%11 = load i32, i32* %8
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i32, i32* %7
%15 = mul nsw i32 %14, 256
%16 = sext i32 %15 to i64
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x i64], [4 x i64]* %6, i64 0, i64 %18
%20 = load i64, i64* %19
%21 = add nsw i64 %16, %20
%22 = trunc i64 %21 to i32
store i32 %22, i32* %7
br label %23
23: ; preds = %13
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %10
26: ; preds = %10
%27 = load i32, i32* %7
%28 = icmp eq i32 %27, 118688767
br i1 %28, label %29, label %30
29: ; preds = %26
ret i32 0
30: ; preds = %26
%31 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ df_read(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
void df_flush() { df_read(0, 0, 0, 0); }


x86 assembly (clang, -O0):
<df_flush>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <df_read@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<df_flush>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <df_read@plt>

LLVM IR (-O0):
define void @df_flush() {
%1 = call i32 @df_read(i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @df_flush() {
%1 = tail call i32 @df_read(i32 0, i32 0, i32 0, i32 0)
ret void
}
char *encoded_number_basefmt(int number) {
  static char buf[3] = {0, 0, 0};
  if (number < -4418)
    number = -4418;
  if (number > 4417)
    number = 4417;
  number += 4418;
  buf[0] = '!' + number / 94;
  buf[1] = '!' + number % 94;
  return (buf);
}


x86 assembly (clang, -O0):
<encoded_number_basefmt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffeebe,-0x4(%rbp)
jge    111b <encoded_number_basefmt+0x1b>
movl   $0xffffeebe,-0x4(%rbp)
cmpl   $0x1141,-0x4(%rbp)
jle    112f <encoded_number_basefmt+0x2f>
movl   $0x1141,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1142,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5e,%ecx
cltd
idiv   %ecx
add    $0x21,%eax
mov    %al,0x2ed3(%rip)
mov    -0x4(%rbp),%eax
mov    $0x5e,%ecx
cltd
idiv   %ecx
add    $0x21,%edx
mov    %dl,%al
mov    %al,0x2ebe(%rip)
lea    0x2eb6(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encoded_number_basefmt>:
cmp    $0xffffeebf,%edi
mov    $0xffffeebe,%eax
cmovge %edi,%eax
cmp    $0x1141,%eax
mov    $0x1141,%ecx
cmovl  %eax,%ecx
add    $0x1142,%ecx
movzwl %cx,%ecx
mov    %ecx,%eax
shr    %eax
imul   $0xae4d,%eax,%edx
shr    $0x15,%edx
lea    0x21(%rdx),%eax
mov    %al,0x2ee7(%rip)
lea    0x2ee0(%rip),%rax
imul   $0x5e,%edx,%edx
sub    %edx,%ecx
add    $0x21,%cl
mov    %cl,0x2ed3(%rip)
ret

LLVM IR (-O0):
@encoded_number_basefmt.buf = internal global [3 x i8] zeroinitializer
define i8* @encoded_number_basefmt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, -4418
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 -4418, i32* %2
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 4417
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 4417, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 4418
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 94
%15 = add nsw i32 33, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @encoded_number_basefmt.buf, i64 0, i64 0)
%17 = load i32, i32* %2
%18 = srem i32 %17, 94
%19 = add nsw i32 33, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @encoded_number_basefmt.buf, i64 0, i64 1)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @encoded_number_basefmt.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@encoded_number_basefmt.buf = internal global [3 x i8] zeroinitializer
define i8* @encoded_number_basefmt(i32 %0) {
%2 = icmp sgt i32 %0, -4418
%3 = select i1 %2, i32 %0, i32 -4418
%4 = icmp slt i32 %3, 4417
%5 = select i1 %4, i32 %3, i32 4417
%6 = trunc i32 %5 to i16
%7 = add nsw i16 %6, 4418
%8 = udiv i16 %7, 94
%9 = trunc i16 %8 to i8
%10 = add nuw nsw i8 %9, 33
store i8 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @encoded_number_basefmt.buf, i64 0, i64 0)
%11 = urem i16 %7, 94
%12 = trunc i16 %11 to i8
%13 = add nuw nsw i8 %12, 33
store i8 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @encoded_number_basefmt.buf, i64 0, i64 1)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @encoded_number_basefmt.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ receive_str_by_UART(char *, int);
int verify_and_split_str(char *, char *);
int receive_msg(char *msg_out, int length) {
  char buffer[length];
  receive_str_by_UART(buffer, length);
  return verify_and_split_str(buffer, msg_out);
}


x86 assembly (clang, -O0):
<receive_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%esi
call   1040 <receive_str_by_UART@plt>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <verify_and_split_str@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_msg>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %esi,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <receive_str_by_UART@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <verify_and_split_str@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @receive_msg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* %4
%12 = call i32 @receive_str_by_UART(i8* %10, i32 %11)
%13 = load i8*, i8** %3
%14 = call i32 @verify_and_split_str(i8* %10, i8* %13)
%15 = load i8*, i8** %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @receive_msg(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @receive_str_by_UART(i8* %4, i32 %1)
%6 = call i32 @verify_and_split_str(i8* %4, i8* %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x29_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x29_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x29_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x29_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x29_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *trim(char *);
int main() {
  {
    char str[] = "\t\n hello \t\n";
    printf("%s\n", trim(str));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <trim@plt>
mov    %rax,%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6f6c6c6568200a09,%rax
6c 6c 6f
mov    %rax,0x8(%rsp)
movl   $0xa0920,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <trim@plt>
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.str = [12 x i8] c"\09\0A hello \09\0A\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i8* @trim(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}