xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Car_Get(int);
int /*<<< orphan*/ Car_GetAxles(int /*<<< orphan*/, int);
int Car_GetAxlesWeight(int /*<<< orphan*/);
int Car_GetCarAxlesWeight(int carnum, int i) {
  return Car_GetAxlesWeight(Car_GetAxles(Car_Get(carnum), i));
}


x86 assembly (clang, -O0):
<Car_GetCarAxlesWeight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <Car_Get@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1050 <Car_GetAxles@plt>
mov    %eax,%edi
call   1030 <Car_GetAxlesWeight@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Car_GetCarAxlesWeight>:
push   %rbx
mov    %esi,%ebx
call   1040 <Car_Get@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <Car_GetAxles@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <Car_GetAxlesWeight@plt>

LLVM IR (-O0):
define i32 @Car_GetCarAxlesWeight(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @Car_Get(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @Car_GetAxles(i32 %6, i32 %7)
%9 = call i32 @Car_GetAxlesWeight(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @Car_GetCarAxlesWeight(i32 %0, i32 %1) {
%3 = tail call i32 @Car_Get(i32 %0)
%4 = tail call i32 @Car_GetAxles(i32 %3, i32 %1)
%5 = tail call i32 @Car_GetAxlesWeight(i32 %4)
ret i32 %5
}
/* Variables and functions */
unsigned int *WriteUnsigned2(unsigned int *, unsigned int, unsigned int);
__attribute__((always_)) unsigned *WriteUnsigned4(unsigned *ptr, unsigned out0,
                                                  unsigned out1, unsigned out2,
                                                  unsigned out3) {
  ptr = WriteUnsigned2(ptr, out0, out1);
  return WriteUnsigned2(ptr, out2, out3);
}


x86 assembly (clang, -O0):
<WriteUnsigned4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <WriteUnsigned2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <WriteUnsigned2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteUnsigned4>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    %ecx,%ebp
call   1030 <WriteUnsigned2@plt>
mov    %rax,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <WriteUnsigned2@plt>

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

LLVM IR (-O2):
define i32* @WriteUnsigned4(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32* @WriteUnsigned2(i32* %0, i32 %1, i32 %2)
%7 = tail call i32* @WriteUnsigned2(i32* %6, i32 %3, i32 %4)
ret i32* %7
}
unsigned int mul_poly(unsigned int a, unsigned int b, unsigned int poly) {
  unsigned int c;
  c = 0;
  while (a) {
    if (a & 1)
      c ^= b;
    a = a >> 1;
    b = b << 1;
    if (b & (1 << 16))
      b ^= poly;
  }
  return c;
}


x86 assembly (clang, -O0):
<mul_poly>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1167 <mul_poly+0x67>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1136 <mul_poly+0x36>
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     1162 <mul_poly+0x62>
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <mul_poly+0x14>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_poly>:
xor    %eax,%eax
test   %edi,%edi
je     1133 <mul_poly+0x33>
mov    %edi,%r8d
nopl   0x0(%rax)
mov    %edi,%ecx
and    $0x1,%ecx
neg    %ecx
and    %esi,%ecx
xor    %ecx,%eax
shr    %r8d
lea    (%rsi,%rsi,1),%ecx
movswl %si,%esi
sar    $0xf,%esi
and    %edx,%esi
xor    %ecx,%esi
cmp    $0x1,%edi
mov    %r8d,%edi
ja     1110 <mul_poly+0x10>
ret

LLVM IR (-O0):
define i32 @mul_poly(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %31, %3
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %32
11: ; preds = %8
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = xor i32 %17, %16
store i32 %18, i32* %7
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* %4
%21 = lshr i32 %20, 1
store i32 %21, i32* %4
%22 = load i32, i32* %5
%23 = shl i32 %22, 1
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = and i32 %24, 65536
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %19
%28 = load i32, i32* %6
%29 = load i32, i32* %5
%30 = xor i32 %29, %28
store i32 %30, i32* %5
br label %31
31: ; preds = %27, %19
br label %8
32: ; preds = %8
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @mul_poly(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %20, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %12, %5 ], [ 0, %3 ]
%7 = phi i32 [ %13, %5 ], [ %0, %3 ]
%8 = phi i32 [ %18, %5 ], [ %1, %3 ]
%9 = and i32 %7, 1
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 0, i32 %8
%12 = xor i32 %11, %6
%13 = lshr i32 %7, 1
%14 = shl i32 %8, 1
%15 = and i32 %8, 32768
%16 = icmp eq i32 %15, 0
%17 = select i1 %16, i32 0, i32 %2
%18 = xor i32 %17, %14
%19 = icmp ult i32 %7, 2
br i1 %19, label %20, label %5
20: ; preds = %5, %3
%21 = phi i32 [ 0, %3 ], [ %12, %5 ]
ret i32 %21
}
void uDMAChannel8_15SelectDefault(unsigned long ulDefPeriphs) {
  (*((volatile unsigned long *)(0x400FF514))) &= ~ulDefPeriphs;
}


x86 assembly (clang, -O0):
<uDMAChannel8_15SelectDefault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400ff514,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400ff514,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannel8_15SelectDefault>:
not    %rdi
and    %rdi,0x400ff514
40
ret

LLVM IR (-O0):
define void @uDMAChannel8_15SelectDefault(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074787604 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074787604 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannel8_15SelectDefault(i64 %0) {
%2 = xor i64 %0, -1
%3 = load volatile i64, i64* inttoptr (i64 1074787604 to i64*)
%4 = and i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 1074787604 to i64*)
ret void
}
/* Type definitions */
struct crypto_aead {
  int dummy;
};
struct chcr_context {
  int dummy;
};

/* Variables and functions */
struct chcr_context *crypto_aead_ctx(struct crypto_aead *);
struct chcr_context *a_ctx(struct crypto_aead *tfm) {
  return crypto_aead_ctx(tfm);
}


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

x86 assembly (clang, -O2):
<a_ctx>:
jmp    1030 <crypto_aead_ctx@plt>

LLVM IR (-O0):
%struct.chcr_context = type { i32 }
%struct.crypto_aead = type { i32 }
define %struct.chcr_context* @a_ctx(%struct.crypto_aead* %0) {
%2 = alloca %struct.crypto_aead*
store %struct.crypto_aead* %0, %struct.crypto_aead** %2
%3 = load %struct.crypto_aead*, %struct.crypto_aead** %2
%4 = call %struct.chcr_context* @crypto_aead_ctx(%struct.crypto_aead* %3)
ret %struct.chcr_context* %4
}

LLVM IR (-O2):
%struct.chcr_context = type { i32 }
%struct.crypto_aead = type { i32 }
define %struct.chcr_context* @a_ctx(%struct.crypto_aead* %0) {
%2 = tail call %struct.chcr_context* @crypto_aead_ctx(%struct.crypto_aead* %0)
ret %struct.chcr_context* %2
}
/* Variables and functions */
char const *getenv(char *);
const char *IoTHubAccount_GetDeviceKey(void) {
  return getenv("IOTHUB_DEVICE_KEY");
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"IOTHUB_DEVICE_KEY\00"
define i8* @IoTHubAccount_GetDeviceKey() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [18 x i8] c"IOTHUB_DEVICE_KEY\00"
define i8* @IoTHubAccount_GetDeviceKey() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
char *usgets(char *, int, int);
char *readline(int fd) {
  static char buf[1500];
  return usgets(buf, 1500, fd);
}


x86 assembly (clang, -O0):
<readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
mov    $0x5dc,%esi
call   1030 <usgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline>:
mov    %edi,%edx
lea    0x2f27(%rip),%rdi
mov    $0x5dc,%esi
jmp    1030 <usgets@plt>

LLVM IR (-O0):
@readline.buf = internal global [1500 x i8] zeroinitializer
define i8* @readline(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @usgets(i8* getelementptr inbounds ([1500 x i8], [1500 x i8]* @readline.buf, i64 0, i64 0), i32 1500, i32 %3)
ret i8* %4
}

LLVM IR (-O2):
@readline.buf = internal global [1500 x i8] zeroinitializer
define i8* @readline(i32 %0) {
%2 = tail call i8* @usgets(i8* getelementptr inbounds ([1500 x i8], [1500 x i8]* @readline.buf, i64 0, i64 0), i32 1500, i32 %0)
ret i8* %2
}
/* Variables and functions */
char tolower(char);
void lower(char *str, int len) {
  int i;
  for (i = 0; i < len; i++)
    str[i] = tolower(str[i]);
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <lower+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <lower+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <lower+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <lower+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @lower(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @tolower(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, unsigned int);
unsigned fmt_pad(char *buffer, unsigned width, char pad) {
  if (buffer != 0)
    memset(buffer, pad, width);
  return width;
}


x86 assembly (clang, -O0):
<fmt_pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <fmt_pad+0x31>
mov    -0x8(%rbp),%rdi
mov    -0xd(%rbp),%al
mov    -0xc(%rbp),%edx
movsbl %al,%esi
call   1030 <memset@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_pad>:
push   %rbx
mov    %esi,%ebx
test   %rdi,%rdi
je     1122 <fmt_pad+0x12>
movsbl %dl,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fmt_pad(i8* %0, i32 %1, i8 signext %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** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8, i8* %6
%12 = load i32, i32* %5
%13 = call i32 @memset(i8* %10, i8 signext %11, i32 %12)
br label %14
14: ; preds = %9, %3
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @fmt_pad(i8* %0, i32 returned %1, i8 signext %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @memset(i8* %0, i8 signext %2, i32 %1)
br label %7
7: ; preds = %5, %3
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() {
  printf("foo in lib\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"foo in lib\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((unused)) int isdigit(int c) {
  return (unsigned int)(c - '0') <= 9;
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0x9,%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 48
%5 = icmp ule i32 %4, 9
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add nsw i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syscall_0(int);
int main(int argc, char *argv[], char *envp[]) {
  syscall_0(100);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x64,%edi
call   1030 <syscall_0@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <syscall_0@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @syscall_0(i32 100)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @syscall_0(i32 100)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ __sigfillset(int /*<<< orphan*/ *);
int sigfillset(sigset_t *set) {
  __sigfillset(set);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sigfillset(i32* %0) {
%2 = tail call i32 @__sigfillset(i32* %0)
ret i32 0
}
/* Variables and functions */
int putchar(int);
int main() { return putchar(4 + putchar(putchar(52) - 4)) - 52; }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x34,%edi
call   1030 <putchar@plt>
lea    -0x4(%rax),%edi
call   1030 <putchar@plt>
lea    0x4(%rax),%edi
call   1030 <putchar@plt>
add    $0xffffffcc,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putchar(i32 52)
%3 = sub nsw i32 %2, 4
%4 = call i32 @putchar(i32 %3)
%5 = add nsw i32 4, %4
%6 = call i32 @putchar(i32 %5)
%7 = sub nsw i32 %6, 52
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 52)
%2 = add nsw i32 %1, -4
%3 = tail call i32 @putchar(i32 %2)
%4 = add nsw i32 %3, 4
%5 = tail call i32 @putchar(i32 %4)
%6 = add nsw i32 %5, -52
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int clear_screen_buffer(void) {
  int count, count2;
  for (count = 0; count < 80; count++, printf("\n"))
    for (count2 = 0; count2 < 25; count2++)
      printf("");
  return 0;
}


x86 assembly (clang, -O0):
<clear_screen_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x50,-0x4(%rbp)
jge    1173 <clear_screen_buffer+0x63>
movl   $0x0,-0x8(%rbp)
cmpl   $0x19,-0x8(%rbp)
jge    1154 <clear_screen_buffer+0x44>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <clear_screen_buffer+0x20>
jmp    1159 <clear_screen_buffer+0x49>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <clear_screen_buffer+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen_buffer>:
push   %rbx
mov    $0x50,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <clear_screen_buffer+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"\0A\00"
define i32 @clear_screen_buffer() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %16, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 80
br i1 %5, label %6, label %20
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %12, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 25
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %7
15: ; preds = %7
br label %16
16: ; preds = %15
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %3
20: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @clear_screen_buffer() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @putchar(i32 10)
%5 = icmp eq i32 %3, 80
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Type definitions */
struct cramfs_inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inode_toggle_endianness(int, int /*<<< orphan*/,
                                           struct cramfs_inode *,
                                           struct cramfs_inode *);
void inode_to_host(int from_big_endian, struct cramfs_inode *inode_in,
                   struct cramfs_inode *inode_out) {
  inode_toggle_endianness(from_big_endian, 0, inode_in, inode_out);
}


x86 assembly (clang, -O0):
<inode_to_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <inode_toggle_endianness@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inode_to_host>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <inode_toggle_endianness@plt>

LLVM IR (-O0):
%struct.cramfs_inode = type { i32 }
define void @inode_to_host(i32 %0, %struct.cramfs_inode* %1, %struct.cramfs_inode* %2) {
%4 = alloca i32
%5 = alloca %struct.cramfs_inode*
%6 = alloca %struct.cramfs_inode*
store i32 %0, i32* %4
store %struct.cramfs_inode* %1, %struct.cramfs_inode** %5
store %struct.cramfs_inode* %2, %struct.cramfs_inode** %6
%7 = load i32, i32* %4
%8 = load %struct.cramfs_inode*, %struct.cramfs_inode** %5
%9 = load %struct.cramfs_inode*, %struct.cramfs_inode** %6
%10 = call i32 @inode_toggle_endianness(i32 %7, i32 0, %struct.cramfs_inode* %8, %struct.cramfs_inode* %9)
ret void
}

LLVM IR (-O2):
%struct.cramfs_inode = type { i32 }
define void @inode_to_host(i32 %0, %struct.cramfs_inode* %1, %struct.cramfs_inode* %2) {
%4 = tail call i32 @inode_toggle_endianness(i32 %0, i32 0, %struct.cramfs_inode* %1, %struct.cramfs_inode* %2)
ret void
}
/* Variables and functions */
char *memcmove(char *, char const *, int, scalar_t__);
scalar_t__ strlen(char const *);
char *strcmove(char *whither, const char *whence, int c) {
  char *r = memcmove(whither, whence, c, strlen(whence) + 1);
  if (r)
    *r = 0;
  return r;
}


x86 assembly (clang, -O0):
<strcmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    %rax,%rcx
add    $0x1,%rcx
call   1040 <memcmove@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117f <strcmove+0x5f>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmove>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rcx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <memcmove@plt>
test   %rax,%rax
je     114f <strcmove+0x2f>
movb   $0x0,(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strcmove(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @memcmove(i8* %0, i8* %1, i32 %2, i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %3
store i8 0, i8* %6
br label %9
9: ; preds = %8, %3
ret i8* %6
}
unsigned char getByte(const unsigned char *inp, unsigned int bitpos) {
  const unsigned char *addr;
  addr = inp + (bitpos >> 3);
  return (addr[0] << (bitpos & 7)) | (addr[1] >> (8 - (bitpos & 7)));
}


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
shl    %cl,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%edx
mov    -0xc(%rbp),%esi
and    $0x7,%esi
mov    $0x8,%ecx
sub    %esi,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
movzbl 0x1(%rdi,%rax,1),%edx
movzbl (%rdi,%rax,1),%eax
shl    $0x8,%eax
or     %edx,%eax
and    $0x7,%cl
shl    %cl,%eax
shr    $0x8,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @getByte(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = trunc i32 %1 to i8
%10 = tail call i8 @llvm.fshl.i8(i8 %6, i8 %8, i8 %9)
ret i8 %10
}
void uart_write(unsigned offs, unsigned long val) {
  volatile unsigned long *reg = (volatile unsigned long *)(0x80000000 + offs);
  *reg = val;
}


x86 assembly (clang, -O0):
<uart_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80000000,%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_write>:
mov    %edi,%eax
mov    $0x80000000,%ecx
xor    %rax,%rcx
mov    %rsi,(%rcx)
ret

LLVM IR (-O0):
define void @uart_write(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = add i32 -2147483648, %6
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
store i64* %9, i64** %5
%10 = load i64, i64* %4
%11 = load i64*, i64** %5
store volatile i64 %10, i64* %11
ret void
}

LLVM IR (-O2):
define void @uart_write(i32 %0, i64 %1) {
%3 = xor i32 %0, -2147483648
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i64*
store volatile i64 %1, i64* %5
ret void
}
int str_to_int(char *str) {
  int num = 0;
  for (int i = 0; str[i] != '\0'; i++) {
    num = num * 10 + str[i] - '0';
  }
  return num;
}


x86 assembly (clang, -O0):
<str_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <str_to_int+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <str_to_int+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_int>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <str_to_int+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_to_int+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %14, %6 ], [ 0, %1 ]
%8 = phi i8 [ %16, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = sext i8 %8 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = add nuw nsw i64 %7, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %6
}
char *convert_to_string(int text[], int size) {
  char *p = text;
  char *pnt = (p + size);
  pnt = '\0';
  return p;
}


x86 assembly (clang, -O0):
<convert_to_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_string>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @convert_to_string(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = bitcast i32* %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8* %12, i8** %6
store i8* null, i8** %6
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @convert_to_string(i32* readnone %0, i32 %1) {
%3 = bitcast i32* %0 to i8*
ret i8* %3
}
/* Variables and functions */
int booster_lstat64(char const *, void *);
int lstat64(const char *path, void *buf) { return booster_lstat64(path, buf); }


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

x86 assembly (clang, -O2):
<lstat64>:
jmp    1030 <booster_lstat64@plt>

LLVM IR (-O0):
define i32 @lstat64(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 @booster_lstat64(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lstat64(i8* %0, i8* %1) {
%3 = tail call i32 @booster_lstat64(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G30_f(char *s) {
  debug("G30_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G30_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G30_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G30_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G30_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G30_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G30_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
float empirical_objective_function(float *p, void **extras) { return 0.0; }


x86 assembly (clang, -O0):
<empirical_objective_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @empirical_objective_function(float* %0, i8** %1) {
%3 = alloca float*
%4 = alloca i8**
store float* %0, float** %3
store i8** %1, i8*** %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @empirical_objective_function(float* nocapture readnone %0, i8** nocapture readnone %1) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ sched_wakeup_process(char const *, int, double, int, void *);
void sched_wakeup_new_process(const char *modname, int pass, double clock,
                              int cpu, void *args) {
  sched_wakeup_process(modname, pass, clock, cpu, args);
}


x86 assembly (clang, -O0):
<sched_wakeup_new_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <sched_wakeup_process@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_wakeup_new_process>:
jmp    1030 <sched_wakeup_process@plt>

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

LLVM IR (-O2):
define void @sched_wakeup_new_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = tail call i32 @sched_wakeup_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4)
ret void
}
int main(void) {
  extern int f();
  return f() ?: -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     113d <main+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x3a>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x3a>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
cmp    $0x1,%eax
sbb    %ecx,%ecx
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %4
%7 = phi i32 [ %2, %4 ], [ -1, %5 ]
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i32 -1, i32 %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int MIDI_Fpeek(FILE *fp) {
  int c;
  c = fgetc(fp);
  ungetc(c, fp);
  return c;
}


x86 assembly (clang, -O0):
<MIDI_Fpeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIDI_Fpeek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @MIDI_Fpeek(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @ungetc(i32 %6, i32* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @MIDI_Fpeek(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @ungetc(i32 %2, i32* %0)
ret i32 %2
}
double real_square(double x) { return (x * x); }


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

x86 assembly (clang, -O2):
<real_square>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @real_square(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @real_square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int isdigit(int c) { return (((c) <= (0x39)) && ((c) >= (0x30))); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1120 <isdigit+0x20>
cmpl   $0x30,-0x4(%rbp)
setge  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 57
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 48
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long CCNextPOT(unsigned long x) {
  x = x - 1;
  x = x | (x >> 1);
  x = x | (x >> 2);
  x = x | (x >> 4);
  x = x | (x >> 8);
  x = x | (x >> 16);
  return x + 1;
}


x86 assembly (clang, -O0):
<CCNextPOT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x10,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CCNextPOT>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rdx
shr    $0x8,%rdx
or     %rcx,%rdx
mov    %rdx,%rax
shr    $0x10,%rax
or     %rdx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @CCNextPOT(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = load i64, i64* %2
%7 = lshr i64 %6, 1
%8 = or i64 %5, %7
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = load i64, i64* %2
%11 = lshr i64 %10, 2
%12 = or i64 %9, %11
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = load i64, i64* %2
%15 = lshr i64 %14, 4
%16 = or i64 %13, %15
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = load i64, i64* %2
%19 = lshr i64 %18, 8
%20 = or i64 %17, %19
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = load i64, i64* %2
%23 = lshr i64 %22, 16
%24 = or i64 %21, %23
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = add i64 %25, 1
ret i64 %26
}

LLVM IR (-O2):
define i64 @CCNextPOT(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = add i64 %12, 1
ret i64 %13
}
/* Variables and functions */
double abs(double d) {
  unsigned long long ret = *(unsigned long long *)(&d) & ~(1ull << 63);
  return *(double *)(&ret);
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
and    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @abs(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = bitcast double* %2 to i64*
%5 = load i64, i64* %4
%6 = and i64 %5, 9223372036854775807
store i64 %6, i64* %3
%7 = bitcast i64* %3 to double*
%8 = load double, double* %7
ret double %8
}

LLVM IR (-O2):
define double @abs(double %0) {
%2 = bitcast double %0 to i64
%3 = and i64 %2, 9223372036854775807
%4 = bitcast i64 %3 to double
ret double %4
}
/* Variables and functions */
void bzero(void *s, size_t n) {
  while (n) {
    ((char *)s)[--n] = '\0';
  }
  ((char *)s)[n] = '\0';
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <bzero+0x34>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
movb   $0x0,-0x1(%rax,%rcx,1)
jmp    110c <bzero+0xc>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     1126 <bzero+0x16>
mov    %rsi,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
movb   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
store i8 0, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct BasePRNGObject {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stdlib_base_prng_next(struct BasePRNGObject *);
uint64_t stdlib_base_random_randi(struct BasePRNGObject *obj) {
  return stdlib_base_prng_next(obj);
}


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

x86 assembly (clang, -O2):
<stdlib_base_random_randi>:
jmp    1030 <stdlib_base_prng_next@plt>

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

LLVM IR (-O2):
%struct.BasePRNGObject = type { i32 }
define i32 @stdlib_base_random_randi(%struct.BasePRNGObject* %0) {
%2 = tail call i32 @stdlib_base_prng_next(%struct.BasePRNGObject* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int *);
void up_and_down(int n) {
  printf("Level %d: n location %p\n", n, &n);
  if (n < 4)
    up_and_down(n + 1);
  printf("LEVEL %d: n location %p\n", n, &n);
}


x86 assembly (clang, -O0):
<up_and_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
lea    -0x4(%rbp),%rdx
call   1030 <printf@plt>
cmpl   $0x4,-0x4(%rbp)
jge    1153 <up_and_down+0x33>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <up_and_down@plt>
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
lea    -0x4(%rbp),%rdx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<up_and_down>:
push   %rax
mov    %edi,%esi
mov    %edi,0x4(%rsp)
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rdx
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
cmp    $0x3,%esi
jg     114f <up_and_down+0x2f>
add    $0x1,%esi
mov    %esi,%edi
call   1040 <up_and_down@plt>
mov    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
lea    0x4(%rsp),%rdx
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Level %d: n location %p\0A\00"
@.str.1 = [25 x i8] c"LEVEL %d: n location %p\0A\00"
define void @up_and_down(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3, i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32* %2)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Level %d: n location %p\0A\00"
@.str.1 = [25 x i8] c"LEVEL %d: n location %p\0A\00"
define void @up_and_down(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0, i32* %2)
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = add nsw i32 %4, 1
%8 = load i32, i32* %2
br label %9
9: ; preds = %6, %1
%10 = phi i32 [ %8, %6 ], [ %4, %1 ]
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32* %2)
ret void
}