xunge/DecIR huggingface dataset:
/* Variables and functions */
int **get_elem_rec(int **, int);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int b = 2;
  int *array[10];
  array[9] = &b;
  int **p = get_elem_rec(array, 9);
  **p = 3;
  test_assert(b == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x9,%esi
call   1030 <get_elem_rec@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    (%rax),%rax
movl   $0x3,(%rax)
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movl   $0x2,0xc(%rsp)
lea    0xc(%rsp),%rax
mov    %rax,0x58(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x9,%esi
call   1030 <get_elem_rec@plt>
mov    (%rax),%rax
movl   $0x3,(%rax)
xor    %edi,%edi
cmpl   $0x3,0xc(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32*]
%4 = alloca i32**
store i32 0, i32* %1
store i32 2, i32* %2
%5 = getelementptr inbounds [10 x i32*], [10 x i32*]* %3, i64 0, i64 9
store i32* %2, i32** %5
%6 = getelementptr inbounds [10 x i32*], [10 x i32*]* %3, i64 0, i64 0
%7 = call i32** @get_elem_rec(i32** %6, i32 9)
store i32** %7, i32*** %4
%8 = load i32**, i32*** %4
%9 = load i32*, i32** %8
store i32 3, i32* %9
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 3
%12 = zext i1 %11 to i32
%13 = call i32 @test_assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32*]
%3 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%4 = bitcast [10 x i32*]* %2 to i8*
%5 = getelementptr inbounds [10 x i32*], [10 x i32*]* %2, i64 0, i64 9
store i32* %1, i32** %5
%6 = getelementptr inbounds [10 x i32*], [10 x i32*]* %2, i64 0, i64 0
%7 = call i32** @get_elem_rec(i32** %6, i32 9)
%8 = load i32*, i32** %7
store i32 3, i32* %8
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @test_assert(i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ drv_Newhaven_sendCommand(char, int /*<<< orphan*/ *,
                                            int /*<<< orphan*/);
void drv_Newhaven_display_on(void) {
  char cmd;
  cmd = 0x41;
  drv_Newhaven_sendCommand(cmd, NULL, 0);
}


x86 assembly (clang, -O0):
<drv_Newhaven_display_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x41,-0x1(%rbp)
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
movsbl -0x1(%rbp),%edi
call   1030 <drv_Newhaven_sendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Newhaven_display_on>:
mov    $0x41,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <drv_Newhaven_sendCommand@plt>

LLVM IR (-O0):
define void @drv_Newhaven_display_on() {
%1 = alloca i8
store i8 65, i8* %1
%2 = load i8, i8* %1
%3 = call i32 @drv_Newhaven_sendCommand(i8 signext %2, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @drv_Newhaven_display_on() {
%1 = tail call i32 @drv_Newhaven_sendCommand(i8 signext 65, i32* null, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Shift(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char str[100];
  scanf("%s", str);
  Shift(str);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <Shift@plt>
lea    -0x70(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xec2(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <Shift@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @Shift(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int posix_memalign(void **, int, size_t);
int main(void) {
  void *alloc_buf;
  int ret;
  ret = posix_memalign((void **)&alloc_buf, 64, (size_t)1024);
  if (!ret)
    free(alloc_buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x40,%esi
mov    $0x400,%edx
call   1040 <posix_memalign@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1158 <main+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
mov    $0x400,%edx
mov    $0x40,%esi
call   1040 <posix_memalign@plt>
test   %eax,%eax
jne    1140 <main+0x20>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i32 @posix_memalign(i8** %1, i32 64, i64 1024)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %0
ret i32 0
}
int passes_loc_constraints_uhp(int **walk_points, int curr_num_pts,
                               double not_used) {
  if (walk_points[curr_num_pts - 1][1] <= 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<passes_loc_constraints_uhp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
cmpl   $0x0,0x4(%rax)
jg     1137 <passes_loc_constraints_uhp+0x37>
movl   $0x0,-0x4(%rbp)
jmp    113e <passes_loc_constraints_uhp+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<passes_loc_constraints_uhp>:
movslq %esi,%rax
mov    -0x8(%rdi,%rax,8),%rcx
xor    %eax,%eax
cmpl   $0x0,0x4(%rcx)
setg   %al
ret

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

LLVM IR (-O2):
define i32 @passes_loc_constraints_uhp(i32** nocapture %0, i32 %1, double %2) {
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32*, i32** %0, i64 %5
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void AONPMCTLMcuSRamRetConfig(uint32_t ui32Retention) {
  uint32_t ui32Reg;

  ;
  ui32Reg =
      (*((volatile unsigned long *)(0x40090000 + 0x00000008))) & ~0x0000000F;
  ui32Reg |= ui32Retention;
  (*((volatile unsigned long *)(0x40090000 + 0x00000008))) = ui32Reg;
}


x86 assembly (clang, -O0):
<AONPMCTLMcuSRamRetConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40090008,%eax
mov    (%rax),%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x40090008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONPMCTLMcuSRamRetConfig>:
mov    %rdi,-0x8(%rsp)
mov    0x40090008,%rax
40
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x10(%rsp)
mov    -0x8(%rsp),%rax
or     %rax,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    %rax,0x40090008
40
ret

LLVM IR (-O0):
define void @AONPMCTLMcuSRamRetConfig(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store volatile i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074331656 to i64*)
%5 = and i64 %4, -16
store volatile i64 %5, i64* %3
%6 = load volatile i64, i64* %2
%7 = load volatile i64, i64* %3
%8 = or i64 %7, %6
store volatile i64 %8, i64* %3
%9 = load volatile i64, i64* %3
store volatile i64 %9, i64* inttoptr (i64 1074331656 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONPMCTLMcuSRamRetConfig(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store volatile i64 %0, i64* %2
%4 = bitcast i64* %3 to i8*
%5 = load volatile i64, i64* inttoptr (i64 1074331656 to i64*)
%6 = and i64 %5, -16
store volatile i64 %6, i64* %3
%7 = load volatile i64, i64* %2
%8 = load volatile i64, i64* %3
%9 = or i64 %8, %7
store volatile i64 %9, i64* %3
%10 = load volatile i64, i64* %3
store volatile i64 %10, i64* inttoptr (i64 1074331656 to i64*)
ret void
}
int SubMod(int a, int b) { return (a - b) < 0 ? (a - b) + 26 : a - b; }


x86 assembly (clang, -O0):
<SubMod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
jge    112a <SubMod+0x2a>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1a,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <SubMod+0x33>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubMod>:
sub    %esi,%edi
lea    0x1a(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @SubMod(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = add nsw i32 %3, 26
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
/* Variables and functions */
void *pseudotalloc_malloc(size_t);
void *talloc_named(const void *context, size_t size, const char *fmt, ...) {
  return pseudotalloc_malloc(size);
}


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

x86 assembly (clang, -O2):
<talloc_named>:
mov    %rsi,%rdi
jmp    1030 <pseudotalloc_malloc@plt>

LLVM IR (-O0):
define i8* @talloc_named(i8* %0, i64 %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %5
%8 = call i8* @pseudotalloc_malloc(i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @talloc_named(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, ...) {
%4 = tail call i8* @pseudotalloc_malloc(i64 %1)
ret i8* %4
}
int compare(const void *v1, const void *v2) {
  const int *pi1 = (const int *)v1;
  const int *pi2 = (const int *)v2;
  if (*pi1 < *pi2)
    return -1;
  else if (*pi1 > *pi2)
    return +1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <compare+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <compare+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    1158 <compare+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <compare+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %7
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = icmp sgt i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void hexbyte(char *out, uint8_t b) {
  static const char hextable[] = "0123456789abcdef";
  out[0] = hextable[b >> 4];
  out[1] = hextable[b & 0x0f];
}


x86 assembly (clang, -O0):
<hexbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0xee5(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xecc(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexbyte>:
mov    %esi,%eax
sar    $0x4,%eax
cltq
lea    0xef2(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,(%rdi)
and    $0xf,%esi
mov    (%rsi,%rcx,1),%al
mov    %al,0x1(%rdi)
ret

LLVM IR (-O0):
@hexbyte.hextable = internal constant [17 x i8] c"0123456789abcdef\00"
define void @hexbyte(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @hexbyte.hextable, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = and i32 %12, 15
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [17 x i8], [17 x i8]* @hexbyte.hextable, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
@hexbyte.hextable = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define void @hexbyte(i8* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @hexbyte.hextable, i64 0, i64 %4
%6 = load i8, i8* %5
store i8 %6, i8* %0
%7 = and i32 %1, 15
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [17 x i8], [17 x i8]* @hexbyte.hextable, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %10, i8* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void insertTabs(int n) {
  for (int l = 0; l < n; l++) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<insertTabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <insertTabs+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <insertTabs+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertTabs>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <insertTabs+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <insertTabs+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @insertTabs(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(unsigned int, int /*<<< orphan*/ *);
void fput32(unsigned int x, FILE *fp) {
  fputc(x & 0xff, fp);
  fputc((x >> 8) & 0xff, fp);
  fputc((x >> 16) & 0xff, fp);
  fputc((x >> 24) & 0xff, fp);
}


x86 assembly (clang, -O0):
<fput32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x4(%rbp),%edi
shr    $0x8,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x4(%rbp),%edi
shr    $0x10,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x4(%rbp),%edi
shr    $0x18,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @fput32(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = call i32 @fputc(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = call i32 @fputc(i32 %11, i32* %12)
%14 = load i32, i32* %3
%15 = lshr i32 %14, 16
%16 = and i32 %15, 255
%17 = load i32*, i32** %4
%18 = call i32 @fputc(i32 %16, i32* %17)
%19 = load i32, i32* %3
%20 = lshr i32 %19, 24
%21 = and i32 %20, 255
%22 = load i32*, i32** %4
%23 = call i32 @fputc(i32 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @fput32(i32 %0, i32* nocapture %1) {
%3 = and i32 %0, 255
%4 = tail call i32 @fputc(i32 %3, i32* %1)
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %1)
%8 = lshr i32 %0, 16
%9 = and i32 %8, 255
%10 = tail call i32 @fputc(i32 %9, i32* %1)
%11 = lshr i32 %0, 24
%12 = tail call i32 @fputc(i32 %11, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ update_DIV();
int /*<<< orphan*/ update_TIMA();
void cycle_timer(void) {
  update_TIMA();
  update_DIV();
}


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

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

LLVM IR (-O0):
define void @cycle_timer() {
%1 = call i32 (...) @update_TIMA()
%2 = call i32 (...) @update_DIV()
ret void
}

LLVM IR (-O2):
define void @cycle_timer() {
%1 = tail call i32 (...) @update_TIMA()
%2 = tail call i32 (...) @update_DIV()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x3e() {
  Assert_real((isprint(62)),
              "/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_isprint.c",
              315, ("isprint should be 1 for >"));
}


x86 assembly (clang, -O0):
<t_isprint_0x3e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x13b,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x3e>:
push   %rax
mov    $0x3e,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x13b,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for >\00"
define void @t_isprint_0x3e() {
%1 = call i32 @isprint(i32 62)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 315, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for >\00"
define void @t_isprint_0x3e() {
%1 = tail call i32 @isprint(i32 62)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 315, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tree_sel_update(int);
void tree_sel_changed(void) { tree_sel_update(1); }


x86 assembly (clang, -O0):
<tree_sel_changed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <tree_sel_update@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_sel_changed>:
mov    $0x1,%edi
jmp    1030 <tree_sel_update@plt>

LLVM IR (-O0):
define void @tree_sel_changed() {
%1 = call i32 @tree_sel_update(i32 1)
ret void
}

LLVM IR (-O2):
define void @tree_sel_changed() {
%1 = tail call i32 @tree_sel_update(i32 1)
ret void
}
void A(void *v) {
  thread_yield();
  printf(1, "A\n");
  texit();
}


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <thread_yield@plt>
mov    $0x1,%edi
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <texit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
push   %rax
xor    %eax,%eax
call   1040 <thread_yield@plt>
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <texit@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"A\0A\00"
define void @A(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @thread_yield()
%3 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @texit()
ret void
}
/* Variables and functions */
scalar_t__ strlen(char const *);
scalar_t__ strspn(char const *, char *);
bool is_pid(const char *str) {
  return (strspn(str, "0123456789") == strlen(str));
}


x86 assembly (clang, -O0):
<is_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pid>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <strspn@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define i32 @is_pid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strspn(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define i32 @is_pid(i8* nocapture %0) {
%2 = tail call i64 @strspn(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_3Fuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x3F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Fuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x3f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Fuint64_midword_reg>:
test   $0x3f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Fuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 63
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_3Fuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 4128768
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double(sinh)(double x) { return 0.0; }


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

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

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @sinh(double %0) {
ret double 0.000000e+00
}
void sm_free_sys(void *memoryBlock) { ; }


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

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

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

LLVM IR (-O2):
define void @sm_free_sys(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  printf("this is \x25 d\n", 20);
  printf("hello%%dude\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x14,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"this is % d\0A\00"
@.str.1 = [13 x i8] c"hello%%dude\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 20)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"this is % d\0A\00"
@.str.1 = [13 x i8] c"hello%%dude\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 20)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int security_syslog(int type) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @security_syslog(i32 %0) {
ret i32 0
}
/* Variables and functions */
unsigned char Read_MFRC522(int);
int /*<<< orphan*/ Write_MFRC522(int, unsigned char);
int /*<<< orphan*/ bcm2835_delay(int);
void AntennaOn(void) {
  unsigned char temp = Read_MFRC522(0x14);
  if (!(temp & 0x09))
    Write_MFRC522(0x14, temp | 0x09);
  bcm2835_delay(200);
}


x86 assembly (clang, -O0):
<AntennaOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1030 <Read_MFRC522@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x9,%eax
cmp    $0x0,%eax
jne    1169 <AntennaOn+0x39>
movzbl -0x1(%rbp),%eax
or     $0x9,%eax
mov    $0x14,%edi
movzbl %al,%esi
call   1050 <Write_MFRC522@plt>
mov    $0xc8,%edi
call   1040 <bcm2835_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AntennaOn>:
push   %rax
mov    $0x14,%edi
call   1030 <Read_MFRC522@plt>
test   $0x9,%al
jne    114e <AntennaOn+0x1e>
or     $0x9,%al
movzbl %al,%esi
mov    $0x14,%edi
call   1050 <Write_MFRC522@plt>
mov    $0xc8,%edi
pop    %rax
jmp    1040 <bcm2835_delay@plt>

LLVM IR (-O0):
define void @AntennaOn() {
%1 = alloca i8
%2 = call zeroext i8 @Read_MFRC522(i32 20)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = and i32 %4, 9
%6 = icmp ne i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %0
%8 = load i8, i8* %1
%9 = zext i8 %8 to i32
%10 = or i32 %9, 9
%11 = trunc i32 %10 to i8
%12 = call i32 @Write_MFRC522(i32 20, i8 zeroext %11)
br label %13
13: ; preds = %7, %0
%14 = call i32 @bcm2835_delay(i32 200)
ret void
}

LLVM IR (-O2):
define void @AntennaOn() {
%1 = tail call zeroext i8 @Read_MFRC522(i32 20)
%2 = and i8 %1, 9
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = or i8 %1, 9
%6 = tail call i32 @Write_MFRC522(i32 20, i8 zeroext %5)
br label %7
7: ; preds = %4, %0
%8 = tail call i32 @bcm2835_delay(i32 200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
void doublereg(void) { ol("add\thl,hl"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"add\09hl,hl\00"
define void @doublereg() {
%1 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"add\09hl,hl\00"
define void @doublereg() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void reinit() {}


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

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

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

LLVM IR (-O2):
define void @reinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ startboot(char *, char **);
void _main(char *argv0) { startboot(argv0, &argv0); }


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

x86 assembly (clang, -O2):
<_main>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rsi
call   1030 <startboot@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @_main(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @startboot(i8* %0, i8** %2)
ret void
}
void unary(char o, double *r) {
  if (o == '-')
    *r = -(*r);
}


x86 assembly (clang, -O0):
<unary>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
jne    1142 <unary+0x42>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unary>:
cmp    $0x2d,%dil
jne    1114 <unary+0x14>
movsd  (%rsi),%xmm0
xorps  0xeef(%rip),%xmm0
movlps %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @unary(i8 signext %0, double* %1) {
%3 = alloca i8
%4 = alloca double*
store i8 %0, i8* %3
store double* %1, double** %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 45
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double*, double** %4
%10 = load double, double* %9
%11 = fneg double %10
%12 = load double*, double** %4
store double %11, double* %12
br label %13
13: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @unary(i8 signext %0, double* nocapture %1) {
%3 = icmp eq i8 %0, 45
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load double, double* %1
%6 = fneg double %5
store double %6, double* %1
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __nop();
void delay(int c) {
  for (int i = 0; i < c; i++) {
    __nop();
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <delay+0x33>
mov    $0x0,%al
call   1030 <__nop@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <delay+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
test   %edi,%edi
jle    112c <delay+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__nop@plt>
add    $0xffffffff,%ebx
jne    1120 <delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @__nop()
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @__nop()
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *safe_malloc(size_t);
void *clone_memory(void *memory, size_t size) {
  void *tmp = safe_malloc(size);
  memcpy(tmp, memory, size);
  return tmp;
}


x86 assembly (clang, -O0):
<clone_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <safe_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clone_memory>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <safe_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @clone_memory(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @safe_malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @clone_memory(i8* %0, i64 %1) {
%3 = tail call i8* @safe_malloc(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int spcxpse(char const *, double, double, double, char *, char *, int *,
            double *, double *, int /*<<< orphan*/ *);
int spcxps(const char ctypeS[9], double crvalX, double restfrq, double restwav,
           char *ptype, char *xtype, int *restreq, double *crvalS,
           double *dSdX) {
  return spcxpse(ctypeS, crvalX, restfrq, restwav, ptype, xtype, restreq,
                 crvalS, dSdX, NULL);
}


x86 assembly (clang, -O0):
<spcxps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
xor    %eax,%eax
movq   $0x0,(%rsp)
call   1030 <spcxpse@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spcxps>:
push   %rax
movq   $0x0,(%rsp)
call   1030 <spcxpse@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @spcxps(i8* %0, double %1, double %2, double %3, i8* %4, i8* %5, i32* %6, double* %7, double* %8) {
%10 = alloca i8*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32*
%17 = alloca double*
%18 = alloca double*
store i8* %0, i8** %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store i8* %4, i8** %14
store i8* %5, i8** %15
store i32* %6, i32** %16
store double* %7, double** %17
store double* %8, double** %18
%19 = load i8*, i8** %10
%20 = load double, double* %11
%21 = load double, double* %12
%22 = load double, double* %13
%23 = load i8*, i8** %14
%24 = load i8*, i8** %15
%25 = load i32*, i32** %16
%26 = load double*, double** %17
%27 = load double*, double** %18
%28 = call i32 @spcxpse(i8* %19, double %20, double %21, double %22, i8* %23, i8* %24, i32* %25, double* %26, double* %27, i32* null)
ret i32 %28
}

LLVM IR (-O2):
define i32 @spcxps(i8* %0, double %1, double %2, double %3, i8* %4, i8* %5, i32* %6, double* %7, double* %8) {
%10 = tail call i32 @spcxpse(i8* %0, double %1, double %2, double %3, i8* %4, i8* %5, i32* %6, double* %7, double* %8, i32* null)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int nope_main() {
  printf("Hello from Nios II!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Hello from Nios II!\00"
define i32 @nope_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clock_init_correction();
void clock_init() { clock_init_correction(); }


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

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

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

LLVM IR (-O2):
define void @clock_init() {
%1 = tail call i32 (...) @clock_init_correction()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_event_all(int, int /*<<< orphan*/ *);
void state_change() { add_event_all(0x01, NULL); }


x86 assembly (clang, -O0):
<state_change>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <add_event_all@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_change>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <add_event_all@plt>

LLVM IR (-O0):
define void @state_change() {
%1 = call i32 @add_event_all(i32 1, i32* null)
ret void
}

LLVM IR (-O2):
define void @state_change() {
%1 = tail call i32 @add_event_all(i32 1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putstr(char const *);
void ft_putendl_succ(char const *s) {
  ft_putstr("\x1B[32m");
  ft_putstr(s);
  ft_putendl("\x1B[0m");
}


x86 assembly (clang, -O0):
<ft_putendl_succ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
lea    0xebe(%rip),%rdi
call   1030 <ft_putendl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_succ>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    %rbx,%rdi
call   1040 <ft_putstr@plt>
lea    0xec7(%rip),%rdi
pop    %rbx
jmp    1030 <ft_putendl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[32m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putendl_succ(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @ft_putstr(i8* %4)
%6 = call i32 @ft_putendl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[32m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putendl_succ(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putstr(i8* %0)
%4 = tail call i32 @ft_putendl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_info(char const *);
void console_init(void) {
  static const char console_test[] = "\r\n\r\nLinuxBIOS-"
                                     "1.1.4"
                                     ".0Fallback"
                                     " "
                                     "Thu Oct 9 20:29:48 MDT 2003"
                                     " starting...\r\n";
  print_info(console_test);
}


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

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

LLVM IR (-O0):
@console_init.console_test = internal constant [72 x i8] c"\0D\0A\0D\0ALinuxBIOS-1.1.4.0Fallback Thu Oct 9 20:29:48 MDT 2003 starting...\0D\0A\00"
define void @console_init() {
%1 = call i32 @print_info(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @console_init.console_test, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@console_init.console_test = internal constant [72 x i8] c"\0D\0A\0D\0ALinuxBIOS-1.1.4.0Fallback Thu Oct 9 20:29:48 MDT 2003 starting...\0D\0A\00"
define void @console_init() {
%1 = tail call i32 @print_info(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @console_init.console_test, i64 0, i64 0))
ret void
}
void av_hwframe_constraints_free() {}


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

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

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

LLVM IR (-O2):
define void @av_hwframe_constraints_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *print_message2() { printf("Hello from Thread2\n"); }


x86 assembly (clang, -O0):
<print_message2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from Thread2\0A\00"
define i8* @print_message2() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello from Thread2\00"
define noalias i8* @print_message2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
int ICDoSomething(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ICDoSomething() {
ret i32 0
}