xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("Hello\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xe8() {
  Assert_real((isupper(232) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1165, ("isupper should be 0 for 0xe8"));
}


x86 assembly (clang, -O0):
<t_isupper_0xe8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe8,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x48d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xe8>:
push   %rax
mov    $0xe8,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x48d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe8\00"
define void @t_isupper_0xe8() {
%1 = call i64 @isupper(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe8\00"
define void @t_isupper_0xe8() {
%1 = tail call i64 @isupper(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long llsqrt(long long a) {
  long long prev = ~((long long)1 << 63);
  long long x = a;
  if (x > 0) {
    while (x < prev) {
      prev = x;
      x = (x + (a / x)) / 2;
    }
  }
  return (long)x;
}


x86 assembly (clang, -O0):
<llsqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    1178 <llsqrt+0x78>
jmp    112e <llsqrt+0x2e>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1173 <llsqrt+0x73>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
jmp    112e <llsqrt+0x2e>
jmp    1178 <llsqrt+0x78>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llsqrt>:
lea    -0x1(%rdi),%rax
movabs $0x7ffffffffffffffd,%rcx
ff ff 7f
cmp    %rcx,%rax
ja     1159 <llsqrt+0x59>
mov    %rdi,%rsi
jmp    1143 <llsqrt+0x43>
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
cqto
idiv   %rsi
mov    %rax,%rcx
add    %rsi,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
add    %rcx,%rax
sar    %rax
cmp    %rsi,%rax
mov    %rax,%rsi
jge    115c <llsqrt+0x5c>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1120 <llsqrt+0x20>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %eax,%ecx
jmp    112b <llsqrt+0x2b>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @llsqrt(i64 %0) {
%2 = add i64 %0, -1
%3 = icmp ult i64 %2, 9223372036854775806
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ %0, %1 ]
%6 = sdiv i64 %0, %5
%7 = add nsw i64 %6, %5
%8 = sdiv i64 %7, 2
%9 = icmp slt i64 %8, %5
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i64 [ %0, %1 ], [ %8, %4 ]
ret i64 %11
}
int xmlUCSIsSpecials(int code) {
  return (((code >= 0xFFF0) && (code <= 0xFFFF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsSpecials>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xfff0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsSpecials+0x26>
cmpl   $0xffff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsSpecials>:
and    $0xfffffff0,%edi
xor    %eax,%eax
cmp    $0xfff0,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsSpecials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65520
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 65535
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 @xmlUCSIsSpecials(i32 %0) {
%2 = and i32 %0, -16
%3 = icmp eq i32 %2, 65520
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int c;
  while (getchar())
    printf("the value:%d\n", getchar() != EOF);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
cmp    $0x0,%rax
je     116a <main+0x4a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
test   %rax,%rax
je     1164 <main+0x44>
mov    0x2eb1(%rip),%r14
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %esi,%esi
cmp    (%r14),%rax
setne  %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
test   %rax,%rax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"the value:%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i64 (...) @getchar()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"the value:%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = icmp eq i64 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = tail call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i64 (...) @getchar()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %0
ret i32 0
}
void MOU_GetDefaultAccel(int *pscale, int *pthresh) {
  *pscale = 3;
  *pthresh = 5;
}


x86 assembly (clang, -O0):
<MOU_GetDefaultAccel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MOU_GetDefaultAccel>:
movl   $0x3,(%rdi)
movl   $0x5,(%rsi)
ret

LLVM IR (-O0):
define void @MOU_GetDefaultAccel(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
store i32 3, i32* %5
%6 = load i32*, i32** %4
store i32 5, i32* %6
ret void
}

LLVM IR (-O2):
define void @MOU_GetDefaultAccel(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 3, i32* %0
store i32 5, i32* %1
ret void
}
int operatorCheck(char operatorThing) {
  if (operatorThing == '*' || operatorThing == '/' || operatorThing == '-' ||
      operatorThing == '+') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<operatorCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     113e <operatorCheck+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     113e <operatorCheck+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     113e <operatorCheck+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
jne    114a <operatorCheck+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <operatorCheck+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<operatorCheck>:
add    $0xd6,%dil
xor    %eax,%eax
cmp    $0x5,%dil
ja     111a <operatorCheck+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.operatorCheck = [6 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define i32 @operatorCheck(i8 signext %0) {
%2 = add i8 %0, -42
%3 = icmp ult i8 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.operatorCheck, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
struct ct_section {
  int dummy;
};
struct ct_model {
  int dummy;
};

/* Variables and functions */
bool ct_always_enter(struct ct_model *model, struct ct_section *section) {
  return true;
}


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

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

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

LLVM IR (-O2):
%struct.ct_model = type { i32 }
%struct.ct_section = type { i32 }
define i32 @ct_always_enter(%struct.ct_model* nocapture readnone %0, %struct.ct_section* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSendSerialCommand(char byBoardNum, char byCommand, short wData,
                        char bWaitForAck) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSendSerialCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dx,%cx
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %al,-0x5(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvSendSerialCommand>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSendSerialCommand(i8 signext %0, i8 signext %1, i16 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i16
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i16 %2, i16* %7
store i8 %3, i8* %8
%9 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSendSerialCommand(i8 signext %0, i8 signext %1, i16 signext %2, i8 signext %3) {
%5 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void st103_set_rx_addr(uint8_t ep_num, uint16_t addr) {
  uint16_t *reg_p = (uint16_t *)((0x40006000UL) + (ep_num * 8 + 4) * 2);
  *reg_p = addr;
}


x86 assembly (clang, -O0):
<st103_set_rx_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0x4,%eax
shl    $0x1,%eax
cltq
add    $0x40006000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<st103_set_rx_addr>:
shl    $0x4,%edi
movslq %edi,%rax
mov    %esi,0x40006008(%rax)
ret

LLVM IR (-O0):
define void @st103_set_rx_addr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 8
%8 = add nsw i32 %7, 4
%9 = mul nsw i32 %8, 2
%10 = sext i32 %9 to i64
%11 = add i64 1073766400, %10
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %5
%13 = load i32, i32* %4
%14 = load i32*, i32** %5
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @st103_set_rx_addr(i32 %0, i32 %1) {
%3 = shl i32 %0, 4
%4 = or i32 %3, 8
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, 1073766400
%7 = inttoptr i64 %6 to i32*
store i32 %1, i32* %7
ret void
}
/* Variables and functions */
int strlen(char *);
void chomp(char *s) {
  int end = strlen(s) - 1;
  if (end >= 0 && s[end] == '\n')
    s[end] = '\0';
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1156 <chomp+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1156 <chomp+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112a <chomp+0x1a>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112a <chomp+0x1a>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @chomp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %22
17: ; preds = %9
%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 0, i8* %21
br label %22
22: ; preds = %17, %9, %1
ret void
}

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void write_reg8(volatile uint8_t *reg, uint8_t val) {
  (*((volatile uint32_t *)(reg))) = val;
}


x86 assembly (clang, -O0):
<write_reg8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_reg8>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write_reg8(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int pause(void) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @pause() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pause() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_msg(int, char *, int /*<<< orphan*/);
void *realloc(void *, size_t);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (!ptr) {
    log_msg(1, "realloc failed: %s", strerror(errno));
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1197 <xrealloc+0x57>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe78(%rip),%rsi
call   1030 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     114d <xrealloc+0xd>
pop    %rcx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9e(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1030 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"realloc failed: %s\00"
@errno = global i32 0
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* @errno
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @log_msg(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [19 x i8] c"realloc failed: %s\00"
@errno = global i32 0
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @log_msg(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ PKCS12_SAFEBAG;

/* Variables and functions */
int /*<<< orphan*/ NID_certBag;
int /*<<< orphan*/ NID_x509Certificate;
int /*<<< orphan*/ *PKCS12_item_pack_safebag(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/ *,
                                             int /*<<< orphan*/,
                                             int /*<<< orphan*/);
int /*<<< orphan*/ X509_it;
PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509) {
  return PKCS12_item_pack_safebag(x509, &X509_it, NID_x509Certificate,
                                  NID_certBag);
}


x86 assembly (clang, -O0):
<PKCS12_x5092certbag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea7(%rip),%rsi
call   1030 <PKCS12_item_pack_safebag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PKCS12_x5092certbag>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb7(%rip),%rsi
jmp    1030 <PKCS12_item_pack_safebag@plt>

LLVM IR (-O0):
@X509_it = global i32 0
@NID_x509Certificate = global i32 0
@NID_certBag = global i32 0
define i32* @PKCS12_x5092certbag(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @NID_x509Certificate
%5 = load i32, i32* @NID_certBag
%6 = call i32* @PKCS12_item_pack_safebag(i32* %3, i32* @X509_it, i32 %4, i32 %5)
ret i32* %6
}

LLVM IR (-O2):
@X509_it = global i32 0
@NID_x509Certificate = global i32 0
@NID_certBag = global i32 0
define i32* @PKCS12_x5092certbag(i32* %0) {
%2 = load i32, i32* @NID_x509Certificate
%3 = load i32, i32* @NID_certBag
%4 = tail call i32* @PKCS12_item_pack_safebag(i32* %0, i32* @X509_it, i32 %2, i32 %3)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, short);
int fun_call_align_6(short a, short b) {
  printf("a = %d, b = %d\n", a, b);
  return a + b;
}


x86 assembly (clang, -O0):
<fun_call_align_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
lea    0xecf(%rip),%rdi
movswl %ax,%esi
movswl -0x4(%rbp),%edx
call   1030 <printf@plt>
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call_align_6>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define i32 @fun_call_align_6(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i16 signext %5, i16 signext %6)
%8 = load i16, i16* %3
%9 = sext i16 %8 to i32
%10 = load i16, i16* %4
%11 = sext i16 %10 to i32
%12 = add nsw i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define i32 @fun_call_align_6(i16 signext %0, i16 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i16 signext %0, i16 signext %1)
%4 = sext i16 %0 to i32
%5 = sext i16 %1 to i32
%6 = add nsw i32 %5, %4
ret i32 %6
}
unsigned xrop3_45_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_45_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_45_0_0>:
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    -0x100(%rdi),%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_45_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = or i32 %3, -256
%7 = xor i32 %5, %6
ret i32 %7
}
void SwapIntegerElements(int array[], int p1, int p2) {
  int tmp;
  tmp = array[p1];
  array[p1] = array[p2];
  array[p2] = tmp;
}


x86 assembly (clang, -O0):
<SwapIntegerElements>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapIntegerElements>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @SwapIntegerElements(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
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @SwapIntegerElements(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
unsigned long __attribute__((used))
int_crb_fixup(unsigned long vptptr, unsigned long hwrpb) {
  return 0;
}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i64 (i64, i64)* @int_crb_fixup to i8*)], section "llvm.metadata"
define i64 @int_crb_fixup(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret i64 0
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i64 (i64, i64)* @int_crb_fixup to i8*)], section "llvm.metadata"
define i64 @int_crb_fixup(i64 %0, i64 %1) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ t1();
int /*<<< orphan*/ t2();
void t3(int c) { c ? t1() : t2(); }


x86 assembly (clang, -O0):
<t3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <t3+0x21>
mov    $0x0,%al
call   1030 <t1@plt>
jmp    1148 <t3+0x28>
mov    $0x0,%al
call   1040 <t2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t3>:
xor    %eax,%eax
test   %edi,%edi
je     112b <t3+0xb>
jmp    1030 <t1@plt>
jmp    1040 <t2@plt>

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

LLVM IR (-O2):
define void @t3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @t1()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @t2()
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void store64(uint8_t *b, uint64_t i) { memcpy(b, &i, 8); }


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

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

LLVM IR (-O0):
define void @store64(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 @memcpy(i32* %5, i32* %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @store64(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c();
int /*<<< orphan*/ e();
int /*<<< orphan*/ g();
void f() {
  c();
  e();
  g();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <c@plt>
mov    $0x0,%al
call   1040 <e@plt>
mov    $0x0,%al
call   1030 <g@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %eax,%eax
call   1050 <c@plt>
xor    %eax,%eax
call   1040 <e@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @f() {
%1 = call i32 (...) @c()
%2 = call i32 (...) @e()
%3 = call i32 (...) @g()
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 (...) @c()
%2 = tail call i32 (...) @e()
%3 = tail call i32 (...) @g()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ debugprint(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void endprogram(char *str) {
  debugprint(0, "%s", str);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<endprogram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
lea    0xec7(%rip),%rsi
call   1030 <debugprint@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<endprogram>:
push   %rax
mov    %rdi,%rdx
lea    0xed5(%rip),%rsi
xor    %edi,%edi
call   1030 <debugprint@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EXIT_FAILURE = global i32 0
define void @endprogram(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @debugprint(i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EXIT_FAILURE = global i32 0
define void @endprogram(i8* %0) {
%2 = tail call i32 @debugprint(i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int reversed(int in, int out) {
  if (in <= 0)
    return out;
  return reversed(in / 10, (out * 10) + (in % 10));
}


x86 assembly (clang, -O0):
<reversed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1133 <reversed+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <reversed+0x49>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
imul   $0xa,-0xc(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    %edx,%esi
call   1030 <reversed@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reversed>:
mov    %esi,%eax
test   %edi,%edi
jle    1131 <reversed+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <reversed+0x10>
ret

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

LLVM IR (-O2):
define i32 @reversed(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = udiv i32 %6, 10
%8 = mul nsw i32 %5, 10
%9 = urem i32 %6, 10
%10 = add nsw i32 %8, %9
%11 = icmp ult i32 %6, 10
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ %1, %2 ], [ %10, %4 ]
ret i32 %13
}
int atoi(const char *s) {
  int i, res = 0;
  for (i = 0; s[i]; i++)
    res = 10 * res + s[i] - '0';
  return res;
}


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

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

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = mul nsw i32 %7, 10
%9 = sext i8 %6 to i32
%10 = add i32 %8, -48
%11 = add i32 %10, %9
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t BSP_Time_Get(void) {
  return (0xFFFFFFFF - (*((volatile uint32_t *)0x4004F054)));
}


x86 assembly (clang, -O0):
<BSP_Time_Get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4004f054,%eax
mov    (%rax),%rcx
mov    $0xffffffff,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_Time_Get>:
mov    $0xffffffff,%eax
sub    0x4004f054,%rax
40
ret

LLVM IR (-O0):
define i64 @BSP_Time_Get() {
%1 = load volatile i64, i64* inttoptr (i64 1074065492 to i64*)
%2 = sub nsw i64 4294967295, %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @BSP_Time_Get() {
%1 = load volatile i64, i64* inttoptr (i64 1074065492 to i64*)
%2 = sub nsw i64 4294967295, %1
ret i64 %2
}
/* Variables and functions */
int absolute_value(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", absolute_value(0b0000000011111111));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @absolute_value(i32 255)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void *wtypeInt_clone(const void *element) { return (void *)element; }


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

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

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

LLVM IR (-O2):
define i8* @wtypeInt_clone(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ SIGSTOP;
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int /*<<< orphan*/);
int get_userns_fd_cb(void *data) { return kill(getpid(), SIGSTOP); }


x86 assembly (clang, -O0):
<get_userns_fd_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_userns_fd_cb>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGSTOP = global i32 0
define i32 @get_userns_fd_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* @SIGSTOP
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SIGSTOP = global i32 0
define i32 @get_userns_fd_cb(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @getpid()
%3 = load i32, i32* @SIGSTOP
%4 = tail call i32 @kill(i32 %2, i32 %3)
ret i32 %4
}
void test13(int n, void *p) {
  int vla[n];
  goto *p;
a0:;
  static void *ps[] = {&&a0};
}


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1136 <test13+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret
mov    -0x28(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
@test13.ps = internal global [1 x i8*] [i8* blockaddress(@test13, %12)]
define void @test13(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i32, i64 %8
store i64 %8, i64* %6
%11 = load i8*, i8** %4
br label %14
12: ; preds = %14
%13 = load i8*, i8** %5
ret void
14: ; preds = %2
%15 = phi i8* [ %11, %2 ]
indirectbr i8* %15, [label %12]
}

LLVM IR (-O2):
define void @test13(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
size_t sysconf(int /*<<< orphan*/);
size_t num_threads(void) { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<num_threads>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_threads>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i64 @num_threads() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i64 @num_threads() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
long long ussu() { return 0x7fffffffffff7fffLL; }


x86 assembly (clang, -O0):
<ussu>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fffffffffff7fff,%rax
ff ff 7f
pop    %rbp
ret

x86 assembly (clang, -O2):
<ussu>:
movabs $0x7fffffffffff7fff,%rax
ff ff 7f
ret

LLVM IR (-O0):
define i64 @ussu() {
ret i64 9223372036854743039
}

LLVM IR (-O2):
define i64 @ussu() {
ret i64 9223372036854743039
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void fatal(char *msg) {
  printf("xui: %s", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"xui: %s\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"xui: %s\00"
define void @fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void primNI(unsigned char *bA) {}


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

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

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

LLVM IR (-O2):
define void @primNI(i8* nocapture %0) {
ret void
}
int do_056() { return 56; }


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

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

LLVM IR (-O0):
define i32 @do_056() {
ret i32 56
}

LLVM IR (-O2):
define i32 @do_056() {
ret i32 56
}
/* Variables and functions */
unsigned char Read_Status_Register();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void WREN_Check() {
  unsigned char byte;
  byte = Read_Status_Register();
  if (byte != 0x02) {
    fprintf(stderr, "ERROR: WEL bit is not set\n");
  }
}


x86 assembly (clang, -O0):
<WREN_Check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Read_Status_Register@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
je     1154 <WREN_Check+0x34>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WREN_Check>:
push   %rax
xor    %eax,%eax
call   1030 <Read_Status_Register@plt>
cmp    $0x2,%al
jne    112e <WREN_Check+0xe>
pop    %rax
ret
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"ERROR: WEL bit is not set\0A\00"
define void @WREN_Check() {
%1 = alloca i8
%2 = call zeroext i8 (...) @Read_Status_Register()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = icmp ne i32 %4, 2
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"ERROR: WEL bit is not set\0A\00"
define void @WREN_Check() {
%1 = tail call zeroext i8 (...) @Read_Status_Register()
%2 = icmp eq i8 %1, 2
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %0
ret void
}