xunge/DecIR huggingface dataset:
int fg_detach_client(struct i2c_client *client) {
  pr_info("%s\n", __func__);
  i2c_detach_client(client);
  return 0;
}


x86 assembly (clang, -O0):
<fg_detach_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <pr_info@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <i2c_detach_client@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fg_detach_client>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
xor    %eax,%eax
call   1030 <pr_info@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <i2c_detach_client@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.i2c_client = type opaque
@.str = [4 x i8] c"%s\0A\00"
@__func__.fg_detach_client = [17 x i8] c"fg_detach_client\00"
define i32 @fg_detach_client(%struct.i2c_client* %0) {
%2 = alloca %struct.i2c_client*
store %struct.i2c_client* %0, %struct.i2c_client** %2
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.fg_detach_client, i64 0, i64 0))
%4 = load %struct.i2c_client*, %struct.i2c_client** %2
%5 = call i32 (%struct.i2c_client*, ...) bitcast (i32 (...)* @i2c_detach_client to i32 (%struct.i2c_client*, ...)*)(%struct.i2c_client* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.i2c_client = type opaque
@.str = [4 x i8] c"%s\0A\00"
@__func__.fg_detach_client = [17 x i8] c"fg_detach_client\00"
define i32 @fg_detach_client(%struct.i2c_client* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_info to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.fg_detach_client, i64 0, i64 0))
%3 = tail call i32 (%struct.i2c_client*, ...) bitcast (i32 (...)* @i2c_detach_client to i32 (%struct.i2c_client*, ...)*)(%struct.i2c_client* %0)
ret i32 0
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, void *, unsigned long, int,
                       unsigned long const *, unsigned long, unsigned int);
long shim_mbind(void *addr, unsigned long len, int mode,
                const unsigned long *nodemask, unsigned long maxnode,
                unsigned flags) {
  return (long)shim_enosys(0, addr, len, mode, nodemask, maxnode, flags);
}


x86 assembly (clang, -O0):
<shim_mbind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
xor    %edi,%edi
mov    %eax,(%rsp)
call   1030 <shim_enosys@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_mbind>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %r9d,(%rsp)
xor    %edi,%edi
mov    %rax,%r9
call   1030 <shim_enosys@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @shim_mbind(i8* %0, i64 %1, i32 %2, i64* %3, i64 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i64*
%11 = alloca i64
%12 = alloca i32
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i64* %3, i64** %10
store i64 %4, i64* %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = load i32, i32* %9
%16 = load i64*, i64** %10
%17 = load i64, i64* %11
%18 = load i32, i32* %12
%19 = call i64 @shim_enosys(i32 0, i8* %13, i64 %14, i32 %15, i64* %16, i64 %17, i32 %18)
ret i64 %19
}

LLVM IR (-O2):
define i64 @shim_mbind(i8* %0, i64 %1, i32 %2, i64* %3, i64 %4, i32 %5) {
%7 = tail call i64 @shim_enosys(i32 0, i8* %0, i64 %1, i32 %2, i64* %3, i64 %4, i32 %5)
ret i64 %7
}
int populate_nt_ports(struct parport_list *list, int flags) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.parport_list = type opaque
define i32 @populate_nt_ports(%struct.parport_list* nocapture readnone %0, i32 %1) {
ret i32 0
}
int notifier_with_return_list_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @notifier_with_return_list_init() {
ret i32 0
}
void glutPassiveMotionFunc(void (*func)(int x, int y)) {}


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

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

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

LLVM IR (-O2):
define void @glutPassiveMotionFunc(void (i32, i32)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int main() {
  int x = -1;
  unsigned u = 2147483648;
  printf("x= %u = %d\n", x, x);
  printf("u = %u = %d \n", u, u);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x80000000,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x80000000,%esi
mov    $0x80000000,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"x= %u = %d\0A\00"
@.str.1 = [14 x i8] c"u = %u = %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 -1, i32 -1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 -2147483648, i32 -2147483648)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t hdlc_get_len(const uint8_t *buf) {
  uint16_t len = (buf[0] & (0x03)) << 11;
  return (len + buf[1]);
}


x86 assembly (clang, -O0):
<hdlc_get_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x3,%eax
shl    $0xb,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdlc_get_len>:
mov    (%rdi),%eax
and    $0x3,%eax
shl    $0xb,%eax
add    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hdlc_get_len(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = and i32 %6, 3
%8 = shl i32 %7, 11
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @hdlc_get_len(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 11
%4 = and i32 %3, 6144
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = add nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void show_ver(void) {
  printf("Version.1.5.0\n");
  printf("Copyright(C)2009. Matayoshi.\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Version.1.5.0\0A\00"
@.str.1 = [30 x i8] c"Copyright(C)2009. Matayoshi.\0A\00"
define void @show_ver() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [14 x i8] c"Version.1.5.0\00"
@str.2 = [29 x i8] c"Copyright(C)2009. Matayoshi.\00"
define void @show_ver() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int sgn(float n) {
  if (n < 0)
    return -1;
  if (n == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1122 <sgn+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <sgn+0x4c>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1145 <sgn+0x45>
jp     1145 <sgn+0x45>
movl   $0x0,-0x4(%rbp)
jmp    114c <sgn+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorps  %xmm1,%xmm1
movaps %xmm0,%xmm2
cmpneqss %xmm1,%xmm2
movd   %xmm2,%ecx
and    $0x1,%ecx
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sgn(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp oeq float %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 0, i32* %2
br label %12
11: ; preds = %7
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @sgn(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp une float %0, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 -1, i32 %4
ret i32 %5
}
unsigned char toUpperChar(unsigned char c) {
  if (c > 96 && c < 123) {
    return (c - 32);
  }
  return c;
}


x86 assembly (clang, -O0):
<toUpperChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x60,%eax
jle    1133 <toUpperChar+0x33>
movzbl -0x2(%rbp),%eax
cmp    $0x7b,%eax
jge    1133 <toUpperChar+0x33>
movzbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <toUpperChar+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toUpperChar>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @toUpperChar(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sgt i32 %5, 96
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 123
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @toUpperChar(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
void generate_segv(int val) {
  int *p = 0;
  printf("EIP of segfault: 0x%x\n", &&segfault);
  __asm__ __volatile__(
      "movl $0x600D1, %eax;            movl $0x600D2, %ebx;            movl "
      "$0x600D3, %ecx;            movl $0x600D4, %edx;            movl "
      "$0x600D5, %edi;            movl $0x600D6, %esi;            movl "
      "$0x600D7, %ebp");
segfault:
  __asm__ __volatile__("movl (0x0), %ecx");
}


x86 assembly (clang, -O0):
<generate_segv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xed6(%rip),%rdi
xor    %eax,%eax
lea    0x28(%rip),%rsi
call   1030 <printf@plt>
mov    $0x600d1,%eax
mov    $0x600d2,%ebx
mov    $0x600d3,%ecx
mov    $0x600d4,%edx
mov    $0x600d5,%edi
mov    $0x600d6,%esi
mov    $0x600d7,%ebp
mov    0x0,%ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_segv>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x2a(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x600d1,%eax
mov    $0x600d2,%ebx
mov    $0x600d3,%ecx
mov    $0x600d4,%edx
mov    $0x600d5,%edi
mov    $0x600d6,%esi
mov    $0x600d7,%ebp
mov    0x0,%ecx
pop    %rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"EIP of segfault: 0x%x\0A\00"
define void @generate_segv(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* null, i32** %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* blockaddress(@generate_segv, %5))
br label %5
5: ; preds = %1, %6
ret void
6: ; No predecessors!
indirectbr i8* undef, [label %5]
}

LLVM IR (-O2):
@.str = [23 x i8] c"EIP of segfault: 0x%x\0A\00"
define void @generate_segv(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* blockaddress(@generate_segv, %3))
tail call void asm sideeffect "movl $$0x600D1, %eax; movl $$0x600D2, %ebx; movl $$0x600D3, %ecx; movl $$0x600D4, %edx; movl $$0x600D5, %edi; movl $$0x600D6, %esi; movl $$0x600D7, %ebp", "~{dirflag},~{fpsr},~{flags}"()
br label %3
3: ; preds = %1
tail call void asm sideeffect "movl (0x0), %ecx", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned long unpack32(const unsigned char *x) {
  return (unsigned long)(x[0]) | (((unsigned long)(x[1])) << 8) |
         (((unsigned long)(x[2])) << 16) | (((unsigned long)(x[3])) << 24);
}


x86 assembly (clang, -O0):
<unpack32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @unpack32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = shl i64 %10, 8
%12 = or i64 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl i64 %16, 16
%18 = or i64 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i64
%23 = shl i64 %22, 24
%24 = or i64 %18, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @unpack32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
int do_461() { return 461; }


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

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

LLVM IR (-O0):
define i32 @do_461() {
ret i32 461
}

LLVM IR (-O2):
define i32 @do_461() {
ret i32 461
}
/* Variables and functions */
int /*<<< orphan*/ CreateWin40(unsigned long, unsigned long, unsigned long,
                               unsigned long);
void createwin(unsigned long w, unsigned long h, unsigned long cfg,
               unsigned long cbg) {
  CreateWin40(w, h, cfg, cbg);
}


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

x86 assembly (clang, -O2):
<createwin>:
jmp    1030 <CreateWin40@plt>

LLVM IR (-O0):
define void @createwin(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call i32 @CreateWin40(i64 %9, i64 %10, i64 %11, i64 %12)
ret void
}

LLVM IR (-O2):
define void @createwin(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @CreateWin40(i64 %0, i64 %1, i64 %2, i64 %3)
ret void
}
/* Variables and functions */
int anetUnixGenericConnect(char *, char *, int);
int anetUnixNonBlockConnect(char *err, char *path) {
  return anetUnixGenericConnect(err, path, 1);
}


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

x86 assembly (clang, -O2):
<anetUnixNonBlockConnect>:
mov    $0x1,%edx
jmp    1030 <anetUnixGenericConnect@plt>

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

LLVM IR (-O2):
define i32 @anetUnixNonBlockConnect(i8* %0, i8* %1) {
%3 = tail call i32 @anetUnixGenericConnect(i8* %0, i8* %1, i32 1)
ret i32 %3
}
void _tr_flush_block(void) {}


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

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

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

LLVM IR (-O2):
define void @_tr_flush_block() {
ret void
}
/* Variables and functions */
void *_hi_alloc(size_t, char const *, int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *_hi_zalloc(size_t size, const char *name, int line) {
  void *p;
  p = _hi_alloc(size, name, line);
  if (p != NULL) {
    memset(p, 0, size);
  }
  return p;
}


x86 assembly (clang, -O0):
<_hi_zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <_hi_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1161 <_hi_zalloc+0x41>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hi_zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <_hi_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <_hi_zalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_hi_zalloc(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @_hi_alloc(i64 %0, i8* %1, i32 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %0)
br label %8
8: ; preds = %6, %3
ret i8* %4
}
/* Type definitions */
struct smc_call {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ smc32_result(struct smc_call *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void smc32_return(struct smc_call *smc, int32_t v) { smc32_result(smc, 0, v); }


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

x86 assembly (clang, -O2):
<smc32_return>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <smc32_result@plt>

LLVM IR (-O0):
%struct.smc_call = type { i32 }
define void @smc32_return(%struct.smc_call* %0, i32 %1) {
%3 = alloca %struct.smc_call*
%4 = alloca i32
store %struct.smc_call* %0, %struct.smc_call** %3
store i32 %1, i32* %4
%5 = load %struct.smc_call*, %struct.smc_call** %3
%6 = load i32, i32* %4
%7 = call i32 @smc32_result(%struct.smc_call* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.smc_call = type { i32 }
define void @smc32_return(%struct.smc_call* %0, i32 %1) {
%3 = tail call i32 @smc32_result(%struct.smc_call* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, int, int);
void get_query_string(char *query, int page, char *buf) {
  sprintf(buf, "QU=%s^PG=%d^LC=%d^", query, page, 15);
}


x86 assembly (clang, -O0):
<get_query_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xecb(%rip),%rsi
mov    $0xf,%r8d
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_query_string>:
mov    %esi,%ecx
mov    %rdi,%rax
lea    0xee4(%rip),%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
mov    $0xf,%r8d
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"QU=%s^PG=%d^LC=%d^\00"
define void @get_query_string(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i32 15)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"QU=%s^PG=%d^LC=%d^\00"
define void @get_query_string(i8* %0, i32 %1, i8* nocapture writeonly %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
int /*<<< orphan*/ sleep(int);
void *thr_fn2(void *arg) {
  printf("thread2 exiting\n");
  sleep(10);
  pthread_exit((void *)2);
}


x86 assembly (clang, -O0):
<thr_fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
mov    $0x2,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn2>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"thread2 exiting\0A\00"
define i8* @thr_fn2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 10)
%6 = call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@str = [16 x i8] c"thread2 exiting\00"
define noalias i8* @thr_fn2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 10)
%4 = tail call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
ret i8* undef
}
int main(void) {
  int a;
  &a + 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char tolower(char);
char *string_tolower(char *str) {
  for (int i = 0; str[i]; i++)
    str[i] = tolower(str[i]);
  return str;
}


x86 assembly (clang, -O0):
<string_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1161 <string_tolower+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <string_tolower+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_tolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <string_tolower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <string_tolower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @string_tolower(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %22, %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 %25
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call signext i8 @tolower(i8 signext %16)
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
br label %22
22: ; preds = %11
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %4
25: ; preds = %4
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define i8* @string_tolower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret i8* %0
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8 [ %12, %5 ], [ %2, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %5
}
void DAC_ADC_init() {
  *((volatile unsigned short *)(0x10000000 + 0x2c)) = 0x8000;
  *((volatile unsigned long *)(0x10000000 + 0x80)) = 0x00800000;
  *((volatile unsigned short *)(0x10000000 + 0x00A4)) = 0x0000;
  *((volatile unsigned short *)(0x10000000 + 0x00aC)) = 0xD00D;
  *((volatile unsigned short *)(0x10000000 + 0x00A0)) = 0x8000;
}


x86 assembly (clang, -O0):
<DAC_ADC_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1000002c,%eax
movw   $0x8000,(%rax)
mov    $0x10000080,%eax
movq   $0x800000,(%rax)
mov    $0x100000a4,%eax
movw   $0x0,(%rax)
mov    $0x100000ac,%eax
movw   $0xd00d,(%rax)
mov    $0x100000a0,%eax
movw   $0x8000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DAC_ADC_init>:
movw   $0x8000,0x1000002c
movq   $0x800000,0x10000080
movw   $0x0,0x100000a4
movw   $0xd00d,0x100000ac
10 0d d0
movw   $0x8000,0x100000a0
ret

LLVM IR (-O0):
define void @DAC_ADC_init() {
store volatile i16 -32768, i16* inttoptr (i64 268435500 to i16*)
store volatile i64 8388608, i64* inttoptr (i64 268435584 to i64*)
store volatile i16 0, i16* inttoptr (i64 268435620 to i16*)
store volatile i16 -12275, i16* inttoptr (i64 268435628 to i16*)
store volatile i16 -32768, i16* inttoptr (i64 268435616 to i16*)
ret void
}

LLVM IR (-O2):
define void @DAC_ADC_init() {
store volatile i16 -32768, i16* inttoptr (i64 268435500 to i16*)
store volatile i64 8388608, i64* inttoptr (i64 268435584 to i64*)
store volatile i16 0, i16* inttoptr (i64 268435620 to i16*)
store volatile i16 -12275, i16* inttoptr (i64 268435628 to i16*)
store volatile i16 -32768, i16* inttoptr (i64 268435616 to i16*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errorf(char *, int, char *, int, char *);
void assert_true2(int line, char *expr, int result) {
  if (!result)
    errorf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/zhuzhaoyuan/8cc/refs/heads/master/"
           "utiltest.c",
           14, "%d: assert_true: %s", line, expr);
}


x86 assembly (clang, -O0):
<assert_true2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114b <assert_true2+0x3b>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xec6(%rip),%rdi
mov    $0xe,%esi
lea    0xf41(%rip),%rdx
call   1030 <errorf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_true2>:
test   %edx,%edx
je     1115 <assert_true2+0x5>
ret
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xedf(%rip),%rdi
lea    0xf5f(%rip),%rdx
mov    $0xe,%esi
jmp    1030 <errorf@plt>

LLVM IR (-O0):
@.str = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhuzhaoyuan/8cc/refs/heads/master/utiltest.c\00"
@.str.1 = [20 x i8] c"%d: assert_true: %s\00"
define void @assert_true2(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = call i32 @errorf(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %10, i8* %11)
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhuzhaoyuan/8cc/refs/heads/master/utiltest.c\00"
@.str.1 = [20 x i8] c"%d: assert_true: %s\00"
define void @assert_true2(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @errorf(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8* %1)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct demod_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ selcall_deinit(struct demod_state *);
void eea_deinit(struct demod_state *s) { selcall_deinit(s); }


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

x86 assembly (clang, -O2):
<eea_deinit>:
jmp    1030 <selcall_deinit@plt>

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

LLVM IR (-O2):
%struct.demod_state = type { i32 }
define void @eea_deinit(%struct.demod_state* %0) {
%2 = tail call i32 @selcall_deinit(%struct.demod_state* %0)
ret void
}
char check_char1(char x) { return x; }


x86 assembly (clang, -O0):
<check_char1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_char1>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @check_char1(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @check_char1(i8 returned signext %0) {
ret i8 %0
}
void fb_hPostEvent_code_end(void) {}


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

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

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

LLVM IR (-O2):
define void @fb_hPostEvent_code_end() {
ret void
}
/* Variables and functions */
float floorf(float const);
float fractf(const float in_X) { return in_X - floorf(in_X); }


x86 assembly (clang, -O0):
<fractf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floorf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fractf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <floorf@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fractf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @llvm.floor.f32(float %4)
%6 = fsub float %3, %5
ret float %6
}

LLVM IR (-O2):
define float @fractf(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
%3 = fsub float %0, %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ test_gtd7();
int main(void) {
  test_gtd7();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_gtd7()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f();
main() {
  int n = 2;
  double x[n];
  f();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
store i32 2, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca double, i64 %6
store i64 %6, i64* %4
%9 = call i32 (...) @f()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_fs_driver();
void test_fat() { test_fs_driver(); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_locale_to_utf8() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c2(int);
void c1(int i) { c2(i * 2); }


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

x86 assembly (clang, -O2):
<c1>:
add    %edi,%edi
jmp    1030 <c2@plt>

LLVM IR (-O0):
define void @c1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = call i32 @c2(i32 %4)
ret void
}

LLVM IR (-O2):
define void @c1(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = tail call i32 @c2(i32 %2)
ret void
}
long PS_BtoI(const unsigned char *buf) {
  return ((buf[0] & 0xFF)) | ((buf[1] & 0xFF) << 8) | ((buf[2] & 0xFF) << 16) |
         ((buf[3] & 0xFF) << 24);
}


x86 assembly (clang, -O0):
<PS_BtoI>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<PS_BtoI>:
movslq (%rdi),%rax
ret

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

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


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

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

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

LLVM IR (-O2):
%struct.img_data = type opaque
define void @add_states(%struct.img_data* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int, int, int /*<<< orphan*/, int,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
off_t lseek(int fd, off_t offset, int whence) {
  return __syscall(8, fd, offset, whence, 0, 0, 0);
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x8,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0x8,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__syscall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__syscall(i32 8, i32 %0, i32 %1, i32 %2, i32 0, i32 0, i32 0)
ret i32 %4
}
void _exit(int x) {}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}

LLVM IR (-O2):
void catch_signal(int sig) {}


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

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

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

LLVM IR (-O2):
define void @catch_signal(i32 %0) {
ret void
}
/* Variables and functions */
int ULONG_MAX;
int is_on_4th_quarter(unsigned long i) {
  return ULONG_MAX / 4 * 3 < i && i <= ULONG_MAX;
}


x86 assembly (clang, -O0):
<is_on_4th_quarter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
movslq %eax,%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x9(%rbp)
jae    1145 <is_on_4th_quarter+0x45>
mov    -0x8(%rbp),%rax
mov    0x2e9f(%rip),%rcx
movslq (%rcx),%rcx
cmp    %rcx,%rax
setbe  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_on_4th_quarter>:
mov    0x2ed1(%rip),%rax
movslq (%rax),%rax
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
lea    (%rcx,%rcx,2),%ecx
movslq %ecx,%rcx
cmp    %rdi,%rcx
setb   %cl
cmp    %rdi,%rax
setae  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
@ULONG_MAX = global i32 0
define i32 @is_on_4th_quarter(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @ULONG_MAX
%4 = sdiv i32 %3, 4
%5 = mul nsw i32 %4, 3
%6 = sext i32 %5 to i64
%7 = load i64, i64* %2
%8 = icmp ult i64 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i64, i64* %2
%11 = load i32, i32* @ULONG_MAX
%12 = sext i32 %11 to i64
%13 = icmp ule i64 %10, %12
br label %14
14: ; preds = %9, %1
%15 = phi i1 [ false, %1 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@ULONG_MAX = global i32 0
define i32 @is_on_4th_quarter(i64 %0) {
%2 = load i32, i32* @ULONG_MAX
%3 = sdiv i32 %2, 4
%4 = mul nsw i32 %3, 3
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %5, %0
%7 = sext i32 %2 to i64
%8 = icmp uge i64 %7, %0
%9 = select i1 %6, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ deregister_chip_restore(struct flashrom_flashctx *const);
int /*<<< orphan*/ unmap_flash(struct flashrom_flashctx *const);
void finalize_flash_access(struct flashrom_flashctx *const flash) {
  deregister_chip_restore(flash);
  unmap_flash(flash);
}


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

x86 assembly (clang, -O2):
<finalize_flash_access>:
push   %rbx
mov    %rdi,%rbx
call   1040 <deregister_chip_restore@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <unmap_flash@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define void @finalize_flash_access(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @deregister_chip_restore(%struct.flashrom_flashctx* %3)
%5 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%6 = call i32 @unmap_flash(%struct.flashrom_flashctx* %5)
ret void
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define void @finalize_flash_access(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @deregister_chip_restore(%struct.flashrom_flashctx* %0)
%3 = tail call i32 @unmap_flash(%struct.flashrom_flashctx* %0)
ret void
}
/* Variables and functions */
scalar_t__ notnull(int *);
int g3(int *y) {
  if (notnull(y)) {
    return 0;
  }
  return *y;
}


x86 assembly (clang, -O0):
<g3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <notnull@plt>
cmp    $0x0,%rax
je     113b <g3+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1144 <g3+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g3>:
push   %rbx
mov    %rdi,%rbx
call   1030 <notnull@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1125 <g3+0x15>
pop    %rbx
ret
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @g3(i32* %0) {
%2 = tail call i64 @notnull(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32, i32* %0
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}