xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ DeallocateDataRxBuffer();
void WF_RxPacketDeallocate(void) { DeallocateDataRxBuffer(); }


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

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

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

LLVM IR (-O2):
define void @WF_RxPacketDeallocate() {
%1 = tail call i32 (...) @DeallocateDataRxBuffer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int example_do_event(int n) {
  fprintf(stderr, "Doing function #%d\n", n);
  return n + 1;
}


x86 assembly (clang, -O0):
<example_do_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_do_event>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Doing function #%d\0A\00"
define i32 @example_do_event(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Doing function #%d\0A\00"
define i32 @example_do_event(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = add nsw i32 %0, 1
ret i32 %4
}
void chalStart2CHALSTART() {}


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

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

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

LLVM IR (-O2):
define void @chalStart2CHALSTART() {
ret void
}
int test_imm_20uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x20 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_20uint64_lowword_mem>:
testb  $0x20,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_20uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 32
%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_20uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 32
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int);
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ stdscr;
void cpustat_top_setup(void) {
  (void)initscr();
  (void)cbreak();
  (void)noecho();
  (void)nodelay(stdscr, 1);
  (void)keypad(stdscr, 1);
  (void)curs_set(0);
}


x86 assembly (clang, -O0):
<cpustat_top_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1070 <noecho@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1060 <nodelay@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <keypad@plt>
xor    %edi,%edi
call   1080 <curs_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpustat_top_setup>:
push   %rbx
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1070 <noecho@plt>
mov    0x2e6b(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1060 <nodelay@plt>
mov    (%rbx),%edi
mov    $0x1,%esi
call   1040 <keypad@plt>
xor    %edi,%edi
pop    %rbx
jmp    1080 <curs_set@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @cpustat_top_setup() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = call i32 @nodelay(i32 %4, i32 1)
%6 = load i32, i32* @stdscr
%7 = call i32 @keypad(i32 %6, i32 1)
%8 = call i32 @curs_set(i32 0)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @cpustat_top_setup() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = tail call i32 @nodelay(i32 %4, i32 1)
%6 = load i32, i32* @stdscr
%7 = tail call i32 @keypad(i32 %6, i32 1)
%8 = tail call i32 @curs_set(i32 0)
ret void
}
/* Variables and functions */
int WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
scalar_t__ WIFSIGNALED(int);
int getresult(int status) {
  if (WIFSIGNALED(status))
    return 1 << 8;
  else if (WIFEXITED(status))
    return WEXITSTATUS(status);
  else
    return 1 << 16;
}


x86 assembly (clang, -O0):
<getresult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <WIFSIGNALED@plt>
cmp    $0x0,%rax
je     1159 <getresult+0x29>
movl   $0x100,-0x4(%rbp)
jmp    1182 <getresult+0x52>
mov    -0x8(%rbp),%edi
call   1050 <WIFEXITED@plt>
cmp    $0x0,%rax
je     117b <getresult+0x4b>
mov    -0x8(%rbp),%edi
call   1040 <WEXITSTATUS@plt>
mov    %eax,-0x4(%rbp)
jmp    1182 <getresult+0x52>
movl   $0x10000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getresult>:
push   %rbx
mov    %edi,%ebx
call   1030 <WIFSIGNALED@plt>
mov    %rax,%rcx
mov    $0x100,%eax
test   %rcx,%rcx
je     1147 <getresult+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1050 <WIFEXITED@plt>
test   %rax,%rax
je     115b <getresult+0x2b>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <WEXITSTATUS@plt>
mov    $0x10000,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getresult(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @WIFSIGNALED(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 256, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i64 @WIFEXITED(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %3
%14 = call i32 @WEXITSTATUS(i32 %13)
store i32 %14, i32* %2
br label %16
15: ; preds = %8
store i32 65536, i32* %2
br label %16
16: ; preds = %15, %12, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @getresult(i32 %0) {
%2 = tail call i64 @WIFSIGNALED(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i64 @WIFEXITED(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @WEXITSTATUS(i32 %0)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32 [ %8, %7 ], [ 256, %1 ], [ 65536, %4 ]
ret i32 %10
}
/* Variables and functions */
void wizchip_cs_deselect(void) {}


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

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

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

LLVM IR (-O2):
define void @wizchip_cs_deselect() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ as3_error(char *, char const *, char const *, int);
void internal_error(const char *file, int line, const char *f) {
  as3_error("internal error in %s, %s:%d", f, file, line);
}


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

x86 assembly (clang, -O2):
<internal_error>:
mov    %esi,%ecx
mov    %rdi,%rax
lea    0xee4(%rip),%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <as3_error@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"internal error in %s, %s:%d\00"
define void @internal_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @as3_error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"internal error in %s, %s:%d\00"
define void @internal_error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @as3_error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i32 %1)
ret void
}
int qsort_cmp_int(const void *x, const void *y) {
  if (*((int *)x) < *((int *)y))
    return (-1);
  else
    return (*((int *)x) > *((int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <qsort_cmp_int+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp_int+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @qsort_cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char const *, size_t);
int /*<<< orphan*/ outint(int);
int /*<<< orphan*/ outstrg(char const *);
scalar_t__ strlen(char const *);
void outname1(const char *file, size_t line, const char *name) {
  if (name == NULL)
    errx(1, "%s, %zu: internal error: outname(NULL)", file, line);
  outint((int)strlen(name));
  outstrg(name);
}


x86 assembly (clang, -O0):
<outname1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1178 <outname1+0x38>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%edi
lea    0xe8d(%rip),%rsi
call   1040 <errx@plt>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1050 <outint@plt>
mov    -0x18(%rbp),%rdi
call   1060 <outstrg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outname1>:
push   %rbx
mov    %rdx,%rbx
test   %rdx,%rdx
jne    1160 <outname1+0x20>
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xeaa(%rip),%rsi
mov    $0x1,%edi
call   1040 <errx@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1050 <outint@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <outstrg@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"%s, %zu: internal error: outname(NULL)\00"
define void @outname1(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 i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i64, i64* %5
%12 = call i32 @errx(i32 1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %10, i64 %11)
br label %13
13: ; preds = %9, %3
%14 = load i8*, i8** %6
%15 = call i64 @strlen(i8* %14)
%16 = trunc i64 %15 to i32
%17 = call i32 @outint(i32 %16)
%18 = load i8*, i8** %6
%19 = call i32 @outstrg(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"%s, %zu: internal error: outname(NULL)\00"
define void @outname1(i8* %0, i64 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
br label %7
7: ; preds = %5, %3
%8 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%9 = trunc i64 %8 to i32
%10 = tail call i32 @outint(i32 %9)
%11 = tail call i32 @outstrg(i8* %2)
ret void
}
int test4() { test4(); }


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

x86 assembly (clang, -O2):
<test4>:
jmp    1100 <test4>

LLVM IR (-O0):
define i32 @test4() {
%1 = alloca i32
%2 = call i32 @test4()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test4() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int setsockopt(int, int, int, void const *, int /*<<< orphan*/);
void xsetsockopt(int fd, int level, int optname, const void *optval,
                 socklen_t optlen) {
  int err;
  err = setsockopt(fd, level, optname, optval, optlen);
  if (err) {
    perror("setsockopt");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<xsetsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1182 <xsetsockopt+0x52>
lea    0xe8d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsetsockopt>:
push   %rax
call   1030 <setsockopt@plt>
test   %eax,%eax
jne    113c <xsetsockopt+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"setsockopt\00"
define void @xsetsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = call i32 @setsockopt(i32 %12, i32 %13, i32 %14, i8* %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %5
%21 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"setsockopt\00"
define void @xsetsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int x;
  printf("Number please: ");
  scanf("%i", &x);
  printf("Thanks for number %i!\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xec3(%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    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Number please: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [23 x i8] c"Thanks for number %i!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Number please: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [23 x i8] c"Thanks for number %i!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
void vec3_add(float *dst, float *b) {
  dst[0] = dst[0] + b[0];
  dst[1] = dst[1] + b[1];
  dst[2] = dst[2] + b[2];
}


x86 assembly (clang, -O0):
<vec3_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_add>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
addss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
addss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vec3_add(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = fadd float %7, %10
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = fadd float %16, %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 1
store float %20, float* %22
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 2
%25 = load float, float* %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 2
%28 = load float, float* %27
%29 = fadd float %25, %28
%30 = load float*, float** %3
%31 = getelementptr inbounds float, float* %30, i64 2
store float %29, float* %31
ret void
}

LLVM IR (-O2):
define void @vec3_add(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fadd float %3, %4
store float %5, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = fadd float %7, %9
store float %10, float* %6
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = fadd float %12, %14
store float %15, float* %11
ret void
}
void gpio_unexport(unsigned gpio) {}


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

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

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

LLVM IR (-O2):
define void @gpio_unexport(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
scalar_t__ vktrace_malloc(int);
char *vktrace_allocate_and_copy_n(const char *_src, int _count) {
  size_t bufferSize = 1 + _count;
  char *retVal = (char *)vktrace_malloc(sizeof(char) * bufferSize);
  strncpy(retVal, _src, _count);
  retVal[_count] = '\0';
  return retVal;
}


x86 assembly (clang, -O0):
<vktrace_allocate_and_copy_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <vktrace_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vktrace_allocate_and_copy_n>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1030 <vktrace_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <strncpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @vktrace_allocate_and_copy_n(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @vktrace_malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i32 %1)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
double bb_alb_noaa(double redchan, double nirchan) {
  double result;
  result = (0.035 + 0.545 * nirchan - 0.32 * redchan);
  return result;
}


x86 assembly (clang, -O0):
<bb_alb_noaa>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xeed(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xee9(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_alb_noaa>:
mulsd  0xef8(%rip),%xmm1
addsd  0xef8(%rip),%xmm1
mulsd  0xef8(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @bb_alb_noaa(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = call double @llvm.fmuladd.f64(double 5.450000e-01, double %6, double 3.500000e-02)
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double -3.200000e-01, double %8, double %7)
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @bb_alb_noaa(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %1, double 5.450000e-01, double 3.500000e-02)
%4 = tail call double @llvm.fmuladd.f64(double %0, double -3.200000e-01, double %3)
ret double %4
}
void f_floatcomplex_insufficient_fprs1(float __complex__ a, float __complex__ b,
                                       float __complex__ c, float __complex__ d,
                                       float __complex__ e) {}


x86 assembly (clang, -O0):
<f_floatcomplex_insufficient_fprs1>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movlpd %xmm1,-0x10(%rbp)
movlpd %xmm2,-0x18(%rbp)
movlpd %xmm3,-0x20(%rbp)
movlpd %xmm4,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f_floatcomplex_insufficient_fprs1(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3, <2 x float> %4) {
%6 = alloca { float, float }
%7 = alloca { float, float }
%8 = alloca { float, float }
%9 = alloca { float, float }
%10 = alloca { float, float }
%11 = bitcast { float, float }* %6 to <2 x float>*
store <2 x float> %0, <2 x float>* %11
%12 = bitcast { float, float }* %7 to <2 x float>*
store <2 x float> %1, <2 x float>* %12
%13 = bitcast { float, float }* %8 to <2 x float>*
store <2 x float> %2, <2 x float>* %13
%14 = bitcast { float, float }* %9 to <2 x float>*
store <2 x float> %3, <2 x float>* %14
%15 = bitcast { float, float }* %10 to <2 x float>*
store <2 x float> %4, <2 x float>* %15
ret void
}

LLVM IR (-O2):
define void @f_floatcomplex_insufficient_fprs1(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3, <2 x float> %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void call_error(const char *func, ...) {
  error("%s: %s\n", func, strerror(errno));
}


x86 assembly (clang, -O0):
<call_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xeb0(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @call_error(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @call_error(i8* %0, ...) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "sd-locker: usage: id file command [arguments]\n");
  (void)fflush(stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"sd-locker: usage: id file command [arguments]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"sd-locker: usage: id file command [arguments]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void XSetStipple() {}


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

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

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

LLVM IR (-O2):
define void @XSetStipple() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xd5() {
  Assert_real((isalnum(213) == 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_isalnum.c",
              1070, ("isalnum should be 0 for 0xd5"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xd5>:
push   %rax
mov    $0xd5,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x42e,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd5\00"
define void @t_isalnum_0xd5() {
%1 = call i64 @isalnum(i32 213)
%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 1070, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd5\00"
define void @t_isalnum_0xd5() {
%1 = tail call i64 @isalnum(i32 213)
%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 1070, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__typeof__(strndup(1, 1)) test_strndup_161(void) { return strndup(1, 1); }


x86 assembly (clang, -O0):
<test_strndup_161>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <strndup@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @test_strndup_161() {
%1 = call i8* @strndup(i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @test_strndup_161() {
%1 = tail call i8* @strndup(i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* %1
}
void fc286(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
a:;
  typedef int(*j)[n];
  0;
  goto a;
}


x86 assembly (clang, -O0):
<fc286>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc286+0x7>

x86 assembly (clang, -O2):
<fc286>:
jmp    1100 <fc286>

LLVM IR (-O0):
define void @fc286(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
br label %19
19: ; preds = %19, %1
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
br label %19
}

LLVM IR (-O2):
define void @fc286(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ VectorTableInitForOSRtl8195A(void *, void *, void *);
void TRAP_Init(void *svc, void *svh, void *tick) {
  VectorTableInitForOSRtl8195A(svc, svh, tick);
}


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

x86 assembly (clang, -O2):
<TRAP_Init>:
jmp    1030 <VectorTableInitForOSRtl8195A@plt>

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

LLVM IR (-O2):
define void @TRAP_Init(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @VectorTableInitForOSRtl8195A(i8* %0, i8* %1, i8* %2)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ CLOCK_BOOTTIME;
scalar_t__ CLOCK_BOOTTIME_ALARM;
int clock_gettime(scalar_t__, struct timespec *);
int tclock_gettime(clock_t clockid, struct timespec *now) {
  if (clockid == CLOCK_BOOTTIME_ALARM)
    clockid = CLOCK_BOOTTIME;
  return clock_gettime(clockid, now);
}


x86 assembly (clang, -O0):
<tclock_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ec5(%rip),%rcx
cmp    (%rcx),%rax
jne    1142 <tclock_gettime+0x32>
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tclock_gettime>:
mov    0x2ed9(%rip),%rax
cmp    %rdi,(%rax)
jne    1126 <tclock_gettime+0x16>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rdi
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_BOOTTIME_ALARM = global i64 0
@CLOCK_BOOTTIME = global i64 0
define i32 @tclock_gettime(i64 %0, %struct.timespec* %1) {
%3 = alloca i64
%4 = alloca %struct.timespec*
store i64 %0, i64* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i64, i64* %3
%6 = load i64, i64* @CLOCK_BOOTTIME_ALARM
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* @CLOCK_BOOTTIME
store i64 %9, i64* %3
br label %10
10: ; preds = %8, %2
%11 = load i64, i64* %3
%12 = load %struct.timespec*, %struct.timespec** %4
%13 = call i32 @clock_gettime(i64 %11, %struct.timespec* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_BOOTTIME_ALARM = global i64 0
@CLOCK_BOOTTIME = global i64 0
define i32 @tclock_gettime(i64 %0, %struct.timespec* %1) {
%3 = load i64, i64* @CLOCK_BOOTTIME_ALARM
%4 = icmp eq i64 %3, %0
%5 = load i64, i64* @CLOCK_BOOTTIME
%6 = select i1 %4, i64 %5, i64 %0
%7 = tail call i32 @clock_gettime(i64 %6, %struct.timespec* %1)
ret i32 %7
}
int isin(s, c)
char *s;
int c;
{
  for (; *s != '\0'; s++)
    if (*s == (char)c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<isin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <isin+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113c <isin+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1159 <isin+0x59>
jmp    1141 <isin+0x41>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <isin+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isin>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <isin+0x22>
movsbl %sil,%edx
add    $0x1,%rdi
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1123 <isin+0x23>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <isin+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isin(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %11
8: ; preds = %11
%9 = load i8, i8* %16
%10 = icmp eq i8 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %5, %8
%12 = phi i8 [ %3, %5 ], [ %9, %8 ]
%13 = phi i8* [ %0, %5 ], [ %16, %8 ]
%14 = sext i8 %12 to i32
%15 = icmp eq i32 %7, %14
%16 = getelementptr inbounds i8, i8* %13, i64 1
br i1 %15, label %17, label %8
17: ; preds = %11, %8, %2
%18 = phi i32 [ 0, %2 ], [ 0, %8 ], [ 1, %11 ]
ret i32 %18
}
/* Variables and functions */
unsigned int ioread32(void *);
unsigned int M4U_ReadReg32(unsigned long M4uBase, unsigned long Offset) {
  unsigned int val;
  val = ioread32((void *)(M4uBase + Offset));
  return val;
}


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

x86 assembly (clang, -O2):
<M4U_ReadReg32>:
add    %rsi,%rdi
jmp    1030 <ioread32@plt>

LLVM IR (-O0):
define i32 @M4U_ReadReg32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
%9 = inttoptr i64 %8 to i8*
%10 = call i32 @ioread32(i8* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @M4U_ReadReg32(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @ioread32(i8* %4)
ret i32 %5
}
void Memory_SetPositiveDirection() { asm("cld\n\t"); }


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

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

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

LLVM IR (-O2):
define void @Memory_SetPositiveDirection() {
tail call void asm sideeffect "cld\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cylindrical_thing(float, float, float);
int /*<<< orphan*/ end_module();
int /*<<< orphan*/ module(char *);
void cylindrical_module(char *modulename, float length, float r1, float r2) {
  module(modulename);
  cylindrical_thing(length, r1, r2);
  end_module();
}


x86 assembly (clang, -O0):
<cylindrical_module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <module@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1050 <cylindrical_thing@plt>
mov    $0x0,%al
call   1030 <end_module@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cylindrical_module>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
call   1040 <module@plt>
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
call   1050 <cylindrical_thing@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1030 <end_module@plt>

LLVM IR (-O0):
define void @cylindrical_module(i8* %0, float %1, float %2, float %3) {
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i8* %0, i8** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load i8*, i8** %5
%10 = call i32 @module(i8* %9)
%11 = load float, float* %6
%12 = load float, float* %7
%13 = load float, float* %8
%14 = call i32 @cylindrical_thing(float %11, float %12, float %13)
%15 = call i32 (...) @end_module()
ret void
}

LLVM IR (-O2):
define void @cylindrical_module(i8* %0, float %1, float %2, float %3) {
%5 = tail call i32 @module(i8* %0)
%6 = tail call i32 @cylindrical_thing(float %1, float %2, float %3)
%7 = tail call i32 (...) @end_module()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ curve25519_donna(unsigned char *, unsigned char const *,
                                    unsigned char const *);
void curve25519(unsigned char *shared, const unsigned char *my_privkey,
                const unsigned char *their_pubkey) {
  curve25519_donna(shared, my_privkey, their_pubkey);
}


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

x86 assembly (clang, -O2):
<curve25519>:
jmp    1030 <curve25519_donna@plt>

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

LLVM IR (-O2):
define void @curve25519(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @curve25519_donna(i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int remove(char const *);
__attribute__((visibility("default"))) int httplib_remove(const char *path) {
  return remove(path);
}


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

x86 assembly (clang, -O2):
<httplib_remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @httplib_remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
void arg_test(const char *s, int i, double d) {}


x86 assembly (clang, -O0):
<arg_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arg_test(i8* %0, i32 %1, double %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca double
store i8* %0, i8** %4
store i32 %1, i32* %5
store double %2, double* %6
ret void
}

LLVM IR (-O2):
define void @arg_test(i8* nocapture %0, i32 %1, double %2) {
ret void
}
int main() {
  int x;
  for (x = 0; x < 10; x = x + 1)
    ;
  if (x != 10)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112f <main+0x2f>
jmp    1121 <main+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
cmpl   $0xa,-0x8(%rbp)
je     1145 <main+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <main+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
const char *get_lame_version(void) {
  static const char *const str = "3"
                                 "."
                                 "88"
                                 " "
                                 ""
                                 ""
                                 ""
                                 "(beta "
                                 "1"
                                 ", "
                                 "Mar 18 2022"
                                 ")";
  return str;
}


x86 assembly (clang, -O0):
<get_lame_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lame_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@get_lame_version.str = internal constant i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i32 0, i32 0)
@.str = [27 x i8] c"3.88 (beta 1, Mar 18 2022)\00"
define i8* @get_lame_version() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"3.88 (beta 1, Mar 18 2022)\00"
define i8* @get_lame_version() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}