xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_response(char *);
int /*<<< orphan*/ set_crmode();
int /*<<< orphan*/ tty_mode(int);
int main(int argc, char *argv[]) {
  int res;
  tty_mode(0);
  set_crmode();
  res = get_response("Do you want another transaction");
  tty_mode(1);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1050 <tty_mode@plt>
mov    $0x0,%al
call   1040 <set_crmode@plt>
lea    0xea5(%rip),%rdi
call   1030 <get_response@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
call   1050 <tty_mode@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <tty_mode@plt>
xor    %eax,%eax
call   1040 <set_crmode@plt>
lea    0xeba(%rip),%rdi
call   1030 <get_response@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <tty_mode@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @tty_mode(i32 0)
%8 = call i32 (...) @set_crmode()
%9 = call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %6
%10 = call i32 @tty_mode(i32 1)
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @tty_mode(i32 0)
%4 = tail call i32 (...) @set_crmode()
%5 = tail call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @tty_mode(i32 1)
ret i32 %5
}
int internal_fudge(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @internal_fudge() {
ret i32 0
}
int cpusupport_x86_sse2_detect(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @cpusupport_x86_sse2_detect() {
ret i32 0
}
void wr_functor(s, func) char *s;
struct definition *func;
{
  printf("%s: ", s);
  wr_functor_1(func);
  putchar('\n');
}


x86 assembly (clang, -O0):
<wr_functor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <wr_functor_1@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wr_functor>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <wr_functor_1@plt>
mov    $0xa,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.definition = type opaque
@.str = [5 x i8] c"%s: \00"
define void @wr_functor(i8* %0, %struct.definition* %1) {
%3 = alloca i8*
%4 = alloca %struct.definition*
store i8* %0, i8** %3
store %struct.definition* %1, %struct.definition** %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load %struct.definition*, %struct.definition** %4
%8 = call i32 (%struct.definition*, ...) bitcast (i32 (...)* @wr_functor_1 to i32 (%struct.definition*, ...)*)(%struct.definition* %7)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret void
}

LLVM IR (-O2):
%struct.definition = type opaque
@.str = [5 x i8] c"%s: \00"
define void @wr_functor(i8* %0, %struct.definition* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (%struct.definition*, ...) bitcast (i32 (...)* @wr_functor_1 to i32 (%struct.definition*, ...)*)(%struct.definition* %1)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret void
}
int main(void) {
  int a = -1;
  int b = a >> 1;
  return (a != b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%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
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp ne i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_help(void) {
  printf("\nhcd [argument...]\n");
  printf("\t-%s\n", ("daemon"));
  printf("\n");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0xebb(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\0Ahcd [argument...]\0A\00"
@.str.1 = [6 x i8] c"\09-%s\0A\00"
@.str.2 = [7 x i8] c"daemon\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @show_help() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"\09-%s\0A\00"
@.str.2 = [7 x i8] c"daemon\00"
@str = [19 x i8] c"\0Ahcd [argument...]\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
ret void
}
void death_sentence(struct battle_char *origin, struct battle_char *target) {}


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

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

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

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @death_sentence(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stdout;
void cutils_cout_void_ptr_print(void *pointer) {
  fprintf(stdout, "<pointer to %p>\n", pointer);
}


x86 assembly (clang, -O0):
<cutils_cout_void_ptr_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cout_void_ptr_print>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [17 x i8] c"<pointer to %p>\0A\00"
define void @cutils_cout_void_ptr_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [17 x i8] c"<pointer to %p>\0A\00"
define void @cutils_cout_void_ptr_print(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void RTHandleTableCreateEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHandleTableCreateEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_open_cloexec() {
  printf("NOT IMPLEMENTED:"
         "pa_open_cloexec"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_open_cloexec\00"
define i32 @pa_open_cloexec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int fun902() { return 902; }


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

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

LLVM IR (-O0):
define i32 @fun902() {
ret i32 902
}

LLVM IR (-O2):
define i32 @fun902() {
ret i32 902
}
/* Type definitions */
struct memGfx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mgPutDot(struct memGfx *, int, int, int);
void mgSlowDot(struct memGfx *mg, int x, int y, int colorIx) {
  mgPutDot(mg, x, y, colorIx);
}


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

x86 assembly (clang, -O2):
<mgSlowDot>:
jmp    1030 <mgPutDot@plt>

LLVM IR (-O0):
%struct.memGfx = type { i32 }
define void @mgSlowDot(%struct.memGfx* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.memGfx*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.memGfx* %0, %struct.memGfx** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.memGfx*, %struct.memGfx** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @mgPutDot(%struct.memGfx* %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.memGfx = type { i32 }
define void @mgSlowDot(%struct.memGfx* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @mgPutDot(%struct.memGfx* %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
bool nrf52_errata_136(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_136() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_hiscorelist();
int /*<<< orphan*/ readhiscores(char *);
int cmd_hiscore(const char *name, char *fname) {
  if (!fname) {
    print_hiscorelist();
    exit(0);
  }
  readhiscores(fname);
  return 1;
}


x86 assembly (clang, -O0):
<cmd_hiscore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <cmd_hiscore+0x29>
mov    $0x0,%al
call   1030 <print_hiscorelist@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1040 <readhiscores@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_hiscore>:
push   %rax
test   %rsi,%rsi
je     1145 <cmd_hiscore+0x15>
mov    %rsi,%rdi
call   1040 <readhiscores@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <print_hiscorelist@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @cmd_hiscore(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i32 (...) @print_hiscorelist()
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @readhiscores(i8* %11)
ret i32 1
}

LLVM IR (-O2):
define i32 @cmd_hiscore(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @print_hiscorelist()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = tail call i32 @readhiscores(i8* %1)
ret i32 1
}
void foo502() {}


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

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

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

LLVM IR (-O2):
define void @foo502() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void print_help(FILE *stream, const char *prog_name) {
  fprintf(stream, "usage: %s\n", prog_name);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"usage: %s\0A\00"
define void @print_help(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"usage: %s\0A\00"
define void @print_help(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
float QCC_Float(float l) { return l; }


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

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

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

LLVM IR (-O2):
define float @QCC_Float(float returned %0) {
ret float %0
}
/* Variables and functions */
int socketpair(int, int, int, int *);
int _socketpair(int domain, int type, int protocol, int socket_vector[2]) {
  return socketpair(domain, type, protocol, socket_vector);
}


x86 assembly (clang, -O0):
<_socketpair>:
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    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <socketpair@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_socketpair>:
jmp    1030 <socketpair@plt>

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

LLVM IR (-O2):
define i32 @_socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void SayHello(char *szName) { printf("Hello, %s", szName); }


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

x86 assembly (clang, -O2):
<SayHello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Hello, %s\00"
define void @SayHello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello, %s\00"
define void @SayHello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WINS_Shutdown();
void Net_Shutdown(void) { WINS_Shutdown(); }


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

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

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

LLVM IR (-O2):
define void @Net_Shutdown() {
%1 = tail call i32 (...) @WINS_Shutdown()
ret void
}
/* Type definitions */
struct nlattr {
  int dummy;
};
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
scalar_t__ nla_data(struct nlattr const *);
__u16 nla_get_u16(const struct nlattr *nla) { return *(__u16 *)nla_data(nla); }


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

x86 assembly (clang, -O2):
<nla_get_u16>:
push   %rax
call   1030 <nla_data@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_get_u16(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = call i64 @nla_data(%struct.nlattr* %3)
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_get_u16(%struct.nlattr* %0) {
%2 = tail call i64 @nla_data(%struct.nlattr* %0)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
float sub(float a, float b) { return a - b; }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sub(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 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @sub(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ do_it();
int main() {
  do_it();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_it()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void interaction_system_pause(char *arg1) {
  0;
  system("pause");
  0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
define void @interaction_system_pause(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define void @interaction_system_pause(i8* nocapture readnone %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo489() {}


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

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

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

LLVM IR (-O2):
define void @foo489() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DeletePeriSmallData(void *periattr) { free(periattr); }


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

x86 assembly (clang, -O2):
<DeletePeriSmallData>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @DeletePeriSmallData(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int main() {
  *((char *)0) = 'a';
  return 0;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store i8 97, i8* null
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x76() {
  Assert_real((isupper(118) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              595, ("isupper should be 0 for v"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for v\00"
define void @t_isupper_0x76() {
%1 = call i64 @isupper(i32 118)
%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 595, 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for v\00"
define void @t_isupper_0x76() {
%1 = tail call i64 @isupper(i32 118)
%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 595, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int putc(int c, FILE *stream) { fputc(c, stream); }


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

x86 assembly (clang, -O2):
<putc>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define i32 @putc(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @fputc(i32 %0, i32* %1)
ret i32 undef
}
/* Variables and functions */
char *buggy();
int main() {
  char *p = buggy();
  p[0] = 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @buggy()
store i8 0, i8* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void ffree_fpreg(int fpreg) {
  put8(0xDD);
  put8(0xC0 + fpreg);
}


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

x86 assembly (clang, -O2):
<ffree_fpreg>:
push   %rbx
mov    %edi,%ebx
mov    $0xdd,%edi
call   1030 <put8@plt>
add    $0xc0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @ffree_fpreg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 221)
%4 = load i32, i32* %2
%5 = add nsw i32 192, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @ffree_fpreg(i32 %0) {
%2 = tail call i32 @put8(i32 221)
%3 = add nsw i32 %0, 192
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
void print_uint16(FILE *fp, uint16_t v) {
  fprintf(fp, "%c%c", v >> 8, v & 0xff);
}


x86 assembly (clang, -O0):
<print_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sar    $0x8,%edx
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uint16>:
movzbl %sil,%ecx
mov    %esi,%edx
sar    $0x8,%edx
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%c%c\00"
define void @print_uint16(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 = ashr i32 %6, 8
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c%c\00"
define void @print_uint16(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = and i32 %1, 255
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClearONOFF();
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_68K(void) {
  DeinitFields();
  ClearONOFF();
}


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

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

LLVM IR (-O0):
define void @SwitchFrom_68K() {
%1 = call i32 (...) @DeinitFields()
%2 = call i32 (...) @ClearONOFF()
ret void
}

LLVM IR (-O2):
define void @SwitchFrom_68K() {
%1 = tail call i32 (...) @DeinitFields()
%2 = tail call i32 (...) @ClearONOFF()
ret void
}
/* Variables and functions */
int ide_do_packet_command_pio(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int ide_spinup() {
  char cmd[12] = {0x70, 0x1F, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  int length = ide_do_packet_command_pio(cmd, NULL, 0);
  return length;
}


x86 assembly (clang, -O0):
<ide_spinup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <ide_do_packet_command_pio@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_spinup>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <ide_do_packet_command_pio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.ide_spinup.cmd = <{ i8, i8, [10 x i8] }> <{ i8 112, i8 31, [10 x i8] zeroinitializer }>
define i32 @ide_spinup() {
%1 = alloca [12 x i8]
%2 = alloca i32
%3 = bitcast [12 x i8]* %1 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = call i32 @ide_do_packet_command_pio(i8* %4, i32* null, i32 0)
store i32 %5, i32* %2
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@__const.ide_spinup.cmd = <{ i8, i8, [10 x i8] }> <{ i8 112, i8 31, [10 x i8] zeroinitializer }>
define i32 @ide_spinup() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @ide_do_packet_command_pio(i8* %2, i32* null, i32 0)
ret i32 %3
}
int _intcmp(void *data, void *key) {
  int i1 = *((int *)data);
  int i2 = *((int *)key);
  return i1 - i2;
}


x86 assembly (clang, -O0):
<_intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_intcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @_intcmp(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 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int ispunct(int);
int iswpunct(wint_t c) { return c <= 255 ? ispunct(c) : 0; }


x86 assembly (clang, -O0):
<iswpunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jg     1138 <iswpunct+0x28>
mov    -0x4(%rbp),%edi
call   1030 <ispunct@plt>
mov    %eax,-0x8(%rbp)
jmp    1142 <iswpunct+0x32>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <iswpunct+0x32>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswpunct>:
cmp    $0xff,%edi
jg     111d <iswpunct+0xd>
jmp    1030 <ispunct@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iswpunct(i32 %0) {
%2 = icmp slt i32 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @ispunct(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void multidim_arr6_Bad() {
  int a[3][2];
  int b[5];
  int *p = a;
  *p = 5;
  b[a[0][0]] = 1;
}


x86 assembly (clang, -O0):
<multidim_arr6_Bad>:
push   %rbp
mov    %rsp,%rbp
lea    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x5,(%rax)
movslq -0x20(%rbp),%rax
movl   $0x1,-0x40(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @multidim_arr6_Bad() {
%1 = alloca [3 x [2 x i32]]
%2 = alloca [5 x i32]
%3 = alloca i32*
%4 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 0
%5 = bitcast [2 x i32]* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 5, i32* %6
%7 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %10
store i32 1, i32* %11
ret void
}

LLVM IR (-O2):
define void @multidim_arr6_Bad() {
ret void
}
/* Variables and functions */
double pow(int, double);
double ldexp(double x, double n) { return x * pow(2, n); }


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
movapd %xmm1,%xmm0
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ldexp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(i32 2, double %6)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @ldexp(double %0, double %1) {
%3 = tail call double @pow(i32 2, double %1)
%4 = fmul double %3, %0
ret double %4
}
void CMUTIL_CallStackInit() {}


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

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

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

LLVM IR (-O2):
define void @CMUTIL_CallStackInit() {
ret void
}
int dmnsn_sgn(double n) {
  if (n > 0.0) {
    return 1;
  } else if (n < 0.0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<dmnsn_sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1127 <dmnsn_sgn+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1148 <dmnsn_sgn+0x48>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1141 <dmnsn_sgn+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <dmnsn_sgn+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmnsn_sgn>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @dmnsn_sgn(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[5] = {2, 3, 6, 7, 4};
  int *array;
  int i;
  array = arr;
  for (i = 0; i < 5; i++) {
    printf("%i\n", *(array + i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    117c <main+0x6c>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114d <main+0x3d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
float cosf(float);
float el_true_anomalyf(float semiMajor, float ecc, float fi) {
  return (semiMajor * (1.0f - ecc * ecc)) / (1.0f + ecc * cosf(fi));
}


x86 assembly (clang, -O0):
<el_true_anomalyf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xeb1(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <cosf@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
mulss  %xmm2,%xmm1
movss  0xe77(%rip),%xmm2
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<el_true_anomalyf>:
push   %rax
movss  %xmm1,0x4(%rsp)
movaps %xmm1,%xmm3
mulss  %xmm1,%xmm3
movss  0xeda(%rip),%xmm1
subss  %xmm3,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,(%rsp)
movaps %xmm2,%xmm0
call   1030 <cosf@plt>
mulss  0x4(%rsp),%xmm0
addss  0xeb7(%rip),%xmm0
movss  (%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @el_true_anomalyf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %5
%10 = fneg float %8
%11 = call float @llvm.fmuladd.f32(float %10, float %9, float 1.000000e+00)
%12 = fmul float %7, %11
%13 = load float, float* %5
%14 = load float, float* %6
%15 = call float @cosf(float %14)
%16 = call float @llvm.fmuladd.f32(float %13, float %15, float 1.000000e+00)
%17 = fdiv float %12, %16
ret float %17
}

LLVM IR (-O2):
define float @el_true_anomalyf(float %0, float %1, float %2) {
%4 = fneg float %1
%5 = tail call float @llvm.fmuladd.f32(float %4, float %1, float 1.000000e+00)
%6 = fmul float %5, %0
%7 = tail call float @cosf(float %2)
%8 = tail call float @llvm.fmuladd.f32(float %1, float %7, float 1.000000e+00)
%9 = fdiv float %6, %8
ret float %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t getpin() {
  return !!((*(volatile unsigned long *)(0x3FFFC000 + 0x14)) & (1 << 7));
}


x86 assembly (clang, -O0):
<getpin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fffc014,%eax
mov    (%rax),%rax
and    $0x80,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpin>:
mov    0x3fffc014,%rax
3f
shr    $0x7,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getpin() {
%1 = load volatile i64, i64* inttoptr (i64 1073725460 to i64*)
%2 = and i64 %1, 128
%3 = icmp ne i64 %2, 0
%4 = xor i1 %3, true
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @getpin() {
%1 = load volatile i64, i64* inttoptr (i64 1073725460 to i64*)
%2 = trunc i64 %1 to i32
%3 = lshr i32 %2, 7
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ lg(int /*<<< orphan*/);
size_t decimalw(uint64_t u) { return (size_t)(lg(u) + 1 + !u); }


x86 assembly (clang, -O0):
<decimalw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lg@plt>
add    $0x1,%rax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimalw>:
push   %rbx
mov    %edi,%ebx
call   1030 <lg@plt>
cmp    $0x1,%ebx
adc    $0x0,%rax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @decimalw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @lg(i32 %3)
%5 = add nsw i64 %4, 1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = sext i32 %9 to i64
%11 = add nsw i64 %5, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @decimalw(i32 %0) {
%2 = tail call i64 @lg(i32 %0)
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i64 2, i64 1
%5 = add i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int syscall_1(int, int);
int close(int fd) { return syscall_1(5, fd); }


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

x86 assembly (clang, -O2):
<close>:
mov    %edi,%esi
mov    $0x5,%edi
jmp    1030 <syscall_1@plt>

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @syscall_1(i32 5, i32 %0)
ret i32 %2
}
void mp_load_1(int n, int radix, int out[]) {
  int j;
  out[0] = 1;
  out[1] = 0;
  out[2] = 1;
  for (j = 3; j <= n + 1; j++) {
    out[j] = 0;
  }
}


x86 assembly (clang, -O0):
<mp_load_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x8(%rax)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1163 <mp_load_1+0x63>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <mp_load_1+0x35>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_load_1>:
push   %rax
movq   $0x1,(%rdx)
movl   $0x1,0x8(%rdx)
cmp    $0x2,%edi
jl     113e <mp_load_1+0x2e>
mov    %edi,%eax
add    $0xc,%rdx
add    $0xffffffff,%eax
shl    $0x2,%rax
mov    %rdx,%rdi
xor    %esi,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @mp_load_1(i32 %0, i32 %1, i32* nocapture writeonly %2) {
store i32 1, i32* %2
%4 = getelementptr inbounds i32, i32* %2, i64 1
store i32 0, i32* %4
%5 = getelementptr inbounds i32, i32* %2, i64 2
store i32 1, i32* %5
%6 = icmp slt i32 %0, 2
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = getelementptr i32, i32* %2, i64 3
%9 = bitcast i32* %8 to i8*
%10 = add nsw i32 %0, -1
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 2
br label %13
13: ; preds = %7, %3
ret void
}