xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void hirc_init_env() {
  setlocale(LC_ALL, "C");
  signal(SIGPIPE, SIG_IGN);
}


x86 assembly (clang, -O0):
<hirc_init_env>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <setlocale@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hirc_init_env>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <setlocale@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
pop    %rax
jmp    1030 <signal@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @hirc_init_env() {
%1 = load i32, i32* @LC_ALL
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SIGPIPE
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @hirc_init_env() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SIGPIPE
%4 = load i32, i32* @SIG_IGN
%5 = tail call i32 @signal(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemIdentHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void SystemIdentRequestUpdate() { UAVObjRequestUpdate(SystemIdentHandle()); }


x86 assembly (clang, -O0):
<SystemIdentRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SystemIdentHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemIdentRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <SystemIdentHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @SystemIdentRequestUpdate() {
%1 = call i32 (...) @SystemIdentHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SystemIdentRequestUpdate() {
%1 = tail call i32 (...) @SystemIdentHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(int);
main() {
  printf("EOF: %c\n", EOF);
  int c;
  while ((c = getchar()) != EOF)
    putchar(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%eax
je     117a <main+0x4a>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1154 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%esi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
je     1164 <main+0x34>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"EOF: %c\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ %3, %0 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ loopForever(int);
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
void printInputThenLoop1(unsigned long a, unsigned long b) {
  printf("\na: %lu, b: %lu\n", a, b);
  loopForever(1);
}


x86 assembly (clang, -O0):
<printInputThenLoop1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <loopForever@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInputThenLoop1>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <loopForever@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\0Aa: %lu, b: %lu\0A\00"
define void @printInputThenLoop1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6)
%8 = call i32 @loopForever(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0Aa: %lu, b: %lu\0A\00"
define void @printInputThenLoop1(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%4 = tail call i32 @loopForever(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pci_config_writeb(int const, int, int);
void setup_piix(void) {
  const int bdf = (1 << 3);
  pci_config_writeb(bdf, 0x60, 10);
  pci_config_writeb(bdf, 0x60 + 1, 10);
  pci_config_writeb(bdf, 0x60 + 2, 11);
  pci_config_writeb(bdf, 0x60 + 3, 11);
}


x86 assembly (clang, -O0):
<setup_piix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x8,-0x4(%rbp)
mov    $0x8,%edi
mov    $0x60,%esi
mov    $0xa,%edx
call   1030 <pci_config_writeb@plt>
mov    $0x8,%edi
mov    $0x61,%esi
mov    $0xa,%edx
call   1030 <pci_config_writeb@plt>
mov    $0x8,%edi
mov    $0x62,%esi
mov    $0xb,%edx
call   1030 <pci_config_writeb@plt>
mov    $0x8,%edi
mov    $0x63,%esi
mov    $0xb,%edx
call   1030 <pci_config_writeb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_piix>:
push   %rax
mov    $0x8,%edi
mov    $0x60,%esi
mov    $0xa,%edx
call   1030 <pci_config_writeb@plt>
mov    $0x8,%edi
mov    $0x61,%esi
mov    $0xa,%edx
call   1030 <pci_config_writeb@plt>
mov    $0x8,%edi
mov    $0x62,%esi
mov    $0xb,%edx
call   1030 <pci_config_writeb@plt>
mov    $0x8,%edi
mov    $0x63,%esi
mov    $0xb,%edx
pop    %rax
jmp    1030 <pci_config_writeb@plt>

LLVM IR (-O0):
define void @setup_piix() {
%1 = alloca i32
store i32 8, i32* %1
%2 = call i32 @pci_config_writeb(i32 8, i32 96, i32 10)
%3 = call i32 @pci_config_writeb(i32 8, i32 97, i32 10)
%4 = call i32 @pci_config_writeb(i32 8, i32 98, i32 11)
%5 = call i32 @pci_config_writeb(i32 8, i32 99, i32 11)
ret void
}

LLVM IR (-O2):
define void @setup_piix() {
%1 = tail call i32 @pci_config_writeb(i32 8, i32 96, i32 10)
%2 = tail call i32 @pci_config_writeb(i32 8, i32 97, i32 10)
%3 = tail call i32 @pci_config_writeb(i32 8, i32 98, i32 11)
%4 = tail call i32 @pci_config_writeb(i32 8, i32 99, i32 11)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ width;
};
typedef TYPE_1__ XExposeEvent;

/* Variables and functions */
int get_XExposeEvent_width(void *_p) {
  return (int)((XExposeEvent *)_p)->width;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XExposeEvent_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XExposeEvent_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
const char *ajRefseqinTypeGetFields(void) { return "id acc"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"id acc\00"
define i8* @ajRefseqinTypeGetFields() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"id acc\00"
define i8* @ajRefseqinTypeGetFields() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct bladerf_devinfo {
  int dummy;
};

/* Variables and functions */
int str2devinfo(char const *, struct bladerf_devinfo *);
int bladerf_get_devinfo_from_str(const char *devstr,
                                 struct bladerf_devinfo *info) {
  return str2devinfo(devstr, info);
}


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

x86 assembly (clang, -O2):
<bladerf_get_devinfo_from_str>:
jmp    1030 <str2devinfo@plt>

LLVM IR (-O0):
%struct.bladerf_devinfo = type { i32 }
define i32 @bladerf_get_devinfo_from_str(i8* %0, %struct.bladerf_devinfo* %1) {
%3 = alloca i8*
%4 = alloca %struct.bladerf_devinfo*
store i8* %0, i8** %3
store %struct.bladerf_devinfo* %1, %struct.bladerf_devinfo** %4
%5 = load i8*, i8** %3
%6 = load %struct.bladerf_devinfo*, %struct.bladerf_devinfo** %4
%7 = call i32 @str2devinfo(i8* %5, %struct.bladerf_devinfo* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.bladerf_devinfo = type { i32 }
define i32 @bladerf_get_devinfo_from_str(i8* %0, %struct.bladerf_devinfo* %1) {
%3 = tail call i32 @str2devinfo(i8* %0, %struct.bladerf_devinfo* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ SO_RCVTIMEO;
int /*<<< orphan*/ setTimeout(int, int /*<<< orphan*/, int /*<<< orphan*/);
void setReadTimeout(int sock, time_t timeout) {
  setTimeout(sock, timeout, SO_RCVTIMEO);
}


x86 assembly (clang, -O0):
<setReadTimeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
call   1030 <setTimeout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setReadTimeout>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <setTimeout@plt>

LLVM IR (-O0):
@SO_RCVTIMEO = global i32 0
define void @setReadTimeout(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 = load i32, i32* @SO_RCVTIMEO
%8 = call i32 @setTimeout(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@SO_RCVTIMEO = global i32 0
define void @setReadTimeout(i32 %0, i32 %1) {
%3 = load i32, i32* @SO_RCVTIMEO
%4 = tail call i32 @setTimeout(i32 %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pageframe_index(void *);
int /*<<< orphan*/ pageframe_span(void *, size_t);
int /*<<< orphan*/ pmem_unref_frames(int /*<<< orphan*/, int /*<<< orphan*/);
void unref_frames(void *ptr, size_t siz, void *data) {
  pmem_unref_frames(pageframe_index(ptr), pageframe_span(ptr, siz));
}


x86 assembly (clang, -O0):
<unref_frames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pageframe_index@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <pageframe_span@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1040 <pmem_unref_frames@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unref_frames>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <pageframe_index@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <pageframe_span@plt>
mov    %ebp,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <pmem_unref_frames@plt>

LLVM IR (-O0):
define void @unref_frames(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** %4
%8 = call i32 @pageframe_index(i8* %7)
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = call i32 @pageframe_span(i8* %9, i64 %10)
%12 = call i32 @pmem_unref_frames(i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
define void @unref_frames(i8* %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @pageframe_index(i8* %0)
%5 = tail call i32 @pageframe_span(i8* %0, i64 %1)
%6 = tail call i32 @pmem_unref_frames(i32 %4, i32 %5)
ret void
}
void g_type_module_get_type() {}


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

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

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

LLVM IR (-O2):
define void @g_type_module_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ printf(char *, int);
int suma(int, int);
int main() {
  int n = 0;
  printf("Llamada a la funcion que suma dos numeros en el main: %d\n",
         suma(n, n));
  f1();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"Llamada a la funcion que suma dos numeros en el main: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @suma(i32 %3, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @f1()
ret i32 0
}

LLVM IR (-O2):
@.str = [58 x i8] c"Llamada a la funcion que suma dos numeros en el main: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @suma(i32 0, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @f1()
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int *mallocWrongArraySize() {
  static const double sTable[10];
  int *table = malloc(sizeof sTable);
  return table;
}


x86 assembly (clang, -O0):
<mallocWrongArraySize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x50,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocWrongArraySize>:
mov    $0x50,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
@mallocWrongArraySize.sTable = internal constant [10 x double] zeroinitializer
define i32* @mallocWrongArraySize() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 80)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
ret i32* %3
}

LLVM IR (-O2):
define noalias i32* @mallocWrongArraySize() {
%1 = tail call i32* @malloc(i32 80)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ idName(long);
int /*<<< orphan*/ prStr(int /*<<< orphan*/);
void prId(long id) { prStr(idName(id)); }


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

x86 assembly (clang, -O2):
<prId>:
push   %rax
call   1040 <idName@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <prStr@plt>

LLVM IR (-O0):
define void @prId(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @idName(i64 %3)
%5 = call i32 @prStr(i32 %4)
ret void
}

LLVM IR (-O2):
define void @prId(i64 %0) {
%2 = tail call i32 @idName(i64 %0)
%3 = tail call i32 @prStr(i32 %2)
ret void
}
/* Variables and functions */
int atoi(char *);
char *malloc(int);
int /*<<< orphan*/ myFunction();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[1]) {
  char *buffer = malloc(50 * sizeof(char));
  myFunction();
  printf("%c\n", argv[1][0]);
  int num = atoi(argv[1]);
  printf("%d\n", num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x32,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <myFunction@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <myFunction@plt>
mov    0x8(%rbx),%rax
movsbl (%rax),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i8* @malloc(i32 50)
store i8* %7, i8** %5
%8 = call i32 (...) @myFunction()
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @myFunction()
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %4
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
char *index(char *, char);
int int_index(char *str, char car) {
  char *res = index(str, car);
  return (res == NULL ? -1 : res - str);
}


x86 assembly (clang, -O0):
<int_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <index@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114e <int_index+0x3e>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    115d <int_index+0x4d>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_index>:
push   %rbx
mov    %rdi,%rbx
call   1030 <index@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @int_index(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i8* @index(i8* %6, i8 signext %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
br label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
br label %18
18: ; preds = %12, %11
%19 = phi i64 [ -1, %11 ], [ %17, %12 ]
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @int_index(i8* %0, i8 signext %1) {
%3 = tail call i8* @index(i8* %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ clearScreen();
int /*<<< orphan*/ print(char *);
int kmain() {
  clearScreen();
  print("Welcome to Zonnex!");
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clearScreen@plt>
lea    0xeca(%rip),%rdi
call   1030 <print@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1040 <clearScreen@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Welcome to Zonnex!\00"
define i32 @kmain() {
%1 = alloca i32
%2 = call i32 (...) @clearScreen()
%3 = call i32 @print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [19 x i8] c"Welcome to Zonnex!\00"
define i32 @kmain() {
%1 = tail call i32 (...) @clearScreen()
%2 = tail call i32 @print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int ft_strequ(char const *s1, char const *s2) {
  while ((int)*s1 == (int)*s2) {
    if (*s1 == '\0')
      return (1);
    s1++;
    s2++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_strequ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <ft_strequ+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <ft_strequ+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1162 <ft_strequ+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <ft_strequ+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strequ>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1124 <ft_strequ+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <ft_strequ+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <ft_strequ+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strequ(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ 0, %2 ], [ 0, %11 ], [ 1, %6 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ init_matrices();
int /*<<< orphan*/ sanity_check();
int main(int argc, char **argv) {
  int rank, nproc;
  int idx_start, idx_end;
  init_matrices();
  sanity_check();
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = call i32 (...) @init_matrices()
%10 = call i32 (...) @sanity_check()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_matrices()
%4 = tail call i32 (...) @sanity_check()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ base64_to_nick(char *);
int /*<<< orphan*/ do_join(int /*<<< orphan*/, char *, char *);
void m_create(char *origin, char **argv, int argc, int srv) {
  do_join(base64_to_nick(origin), argv[0], argv[1]);
}


x86 assembly (clang, -O0):
<m_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <base64_to_nick@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
call   1040 <do_join@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_create>:
push   %rbx
mov    %rsi,%rbx
call   1030 <base64_to_nick@plt>
mov    (%rbx),%rsi
mov    0x8(%rbx),%rdx
mov    %eax,%edi
pop    %rbx
jmp    1040 <do_join@plt>

LLVM IR (-O0):
define void @m_create(i8* %0, i8** %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 @base64_to_nick(i8* %9)
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %6
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @do_join(i32 %10, i8* %13, i8* %16)
ret void
}

LLVM IR (-O2):
define void @m_create(i8* %0, i8** nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32 @base64_to_nick(i8* %0)
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @do_join(i32 %5, i8* %6, i8* %8)
ret void
}
int fun1215() { return 1215; }


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

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

LLVM IR (-O0):
define i32 @fun1215() {
ret i32 1215
}

LLVM IR (-O2):
define i32 @fun1215() {
ret i32 1215
}
/* Type definitions */
typedef int ulong;

/* Variables and functions */
int bitLength(ulong v) {
  int result = 0;
  while (v > 0) {
    v >>= 1;
    result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<bitLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <bitLength+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bitLength+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitLength>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <bitLength+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitLength(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int increment() {
  static int i = 42;
  i += 5;
  printf("increment returns %d\n", i);
  return i;
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%eax
add    $0x5,%eax
mov    %eax,0x2f05(%rip)
mov    0x2eff(%rip),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eed(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
push   %rax
mov    0x2f11(%rip),%esi
add    $0x5,%esi
mov    %esi,0x2f08(%rip)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ef6(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
@increment.i = internal global i32 42
@.str = [22 x i8] c"increment returns %d\0A\00"
define i32 @increment() {
%1 = load i32, i32* @increment.i
%2 = add nsw i32 %1, 5
store i32 %2, i32* @increment.i
%3 = load i32, i32* @increment.i
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @increment.i
ret i32 %5
}

LLVM IR (-O2):
@increment.i = internal unnamed_addr global i32 42
@.str = [22 x i8] c"increment returns %d\0A\00"
define i32 @increment() {
%1 = load i32, i32* @increment.i
%2 = add nsw i32 %1, 5
store i32 %2, i32* @increment.i
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @increment.i
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pendfunc1();
void pendfunc(int x) { pendfunc1(); }


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

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

LLVM IR (-O0):
define void @pendfunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pendfunc1()
ret void
}

LLVM IR (-O2):
define void @pendfunc(i32 %0) {
%2 = tail call i32 (...) @pendfunc1()
ret void
}
int bar(int a, int b, int c) { return a + b + c; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
const char *TA_GetVersionString(void) {
  return "0"
         "."
         "4"
         "."
         "0"
         " ("
         "Mar 18 2022"
         " "
         "06:18:21"
         ")";
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"0.4.0 (Mar 18 2022 06:18:21)\00"
define i8* @TA_GetVersionString() {
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [29 x i8] c"0.4.0 (Mar 18 2022 06:18:21)\00"
define i8* @TA_GetVersionString() {
ret i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ HwNazeHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void HwNazeUpdated() { UAVObjUpdated(HwNazeHandle()); }


x86 assembly (clang, -O0):
<HwNazeUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <HwNazeHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwNazeUpdated>:
push   %rax
xor    %eax,%eax
call   1040 <HwNazeHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @HwNazeUpdated() {
%1 = call i32 (...) @HwNazeHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwNazeUpdated() {
%1 = tail call i32 (...) @HwNazeHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
int gcd(int a, int b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1139 <gcd+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <gcd+0x3d>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(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 = srem i32 %6, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %5
store i32 %11, i32* %3
br label %18
12: ; preds = %2
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = srem i32 %14, %15
%17 = call i32 @gcd(i32 %13, i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %6, %3 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debugPrintStr(char *, char *);
void newChallangeRecvd(char *line) {
  debugPrintStr("command parser: newChallangeRecvd: ", line);
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"command parser: newChallangeRecvd: \00"
define void @newChallangeRecvd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @debugPrintStr(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"command parser: newChallangeRecvd: \00"
define void @newChallangeRecvd(i8* %0) {
%2 = tail call i32 @debugPrintStr(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int smack_label_path(const char *path, const char *label) { return 0; }


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

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

LLVM IR (-O0):
define i32 @smack_label_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @smack_label_path(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int check_words(char a, const char *delim) {
  int i;
  i = 0;
  while (delim[i] != 0) {
    if (a == delim[i] || a == '\t')
      return (0);
    i++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<check_words>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1169 <check_words+0x69>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114f <check_words+0x4f>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    115b <check_words+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1170 <check_words+0x70>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <check_words+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_words>:
mov    (%rsi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1130 <check_words+0x30>
cmp    $0x9,%dil
jne    1115 <check_words+0x15>
xor    %eax,%eax
jmp    1130 <check_words+0x30>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1111 <check_words+0x11>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <check_words+0x20>
ret

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

LLVM IR (-O2):
define i32 @check_words(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2
%6 = icmp eq i8 %0, 9
br i1 %6, label %16, label %11
7: ; preds = %11
%8 = getelementptr inbounds i8, i8* %1, i64 %15
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %5, %7
%12 = phi i64 [ %15, %7 ], [ 0, %5 ]
%13 = phi i8 [ %9, %7 ], [ %3, %5 ]
%14 = icmp eq i8 %13, %0
%15 = add nuw i64 %12, 1
br i1 %14, label %16, label %7
16: ; preds = %11, %7, %5, %2
%17 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 1, %7 ], [ 0, %11 ]
ret i32 %17
}
/* Variables and functions */
char *dstrndup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *dstrdup(const char *src) { return dstrndup(src, strlen(src)); }


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

x86 assembly (clang, -O2):
<dstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <dstrndup@plt>

LLVM IR (-O0):
define i8* @dstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @dstrndup(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @dstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @dstrndup(i8* %0, i32 %2)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int write_u16_to_buf(uint8_t **ptr, uint16_t val) {
  *(*ptr)++ = (val >> 8) & 0xff;
  *(*ptr)++ = val & 0xff;
  return 2;
}


x86 assembly (clang, -O0):
<write_u16_to_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x4,%rsi
mov    %rsi,(%rdx)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x4,%rsi
mov    %rsi,(%rdx)
mov    %ecx,(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_u16_to_buf>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    (%rdi),%rdx
mov    %ecx,(%rdx)
movzbl %al,%eax
lea    0x8(%rdx),%rcx
mov    %rcx,(%rdi)
mov    %eax,0x4(%rdx)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @write_u16_to_buf(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32**, i32*** %3
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %8
store i32 %7, i32* %9
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = load i32**, i32*** %3
%14 = load i32*, i32** %13
%15 = getelementptr inbounds i32, i32* %14, i32 1
store i32* %15, i32** %13
store i32 %12, i32* %14
ret i32 2
}

LLVM IR (-O2):
define i32 @write_u16_to_buf(i32** nocapture %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = load i32*, i32** %0
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %4, i32* %5
%7 = and i32 %1, 255
%8 = getelementptr inbounds i32, i32* %5, i64 2
store i32* %8, i32** %0
store i32 %7, i32* %6
ret i32 2
}
int func() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
int EOVERFLOW;
int math_addull(unsigned long long *x, unsigned long long a,
                unsigned long long b) {
  if (~a < b) {
    *x = ~0ULL;
    return EOVERFLOW;
  } else {
    *x = a + b;
    return 0;
  }
}


x86 assembly (clang, -O0):
<math_addull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
cmp    -0x20(%rbp),%rax
jae    113e <math_addull+0x3e>
mov    -0x10(%rbp),%rax
movq   $0xffffffffffffffff,(%rax)
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <math_addull+0x54>
mov    -0x18(%rbp),%rcx
add    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_addull>:
add    %rdx,%rsi
jae    1116 <math_addull+0x16>
movq   $0xffffffffffffffff,(%rdi)
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
ret
mov    %rsi,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
@EOVERFLOW = global i32 0
define i32 @math_addull(i64* %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %6
%9 = xor i64 %8, -1
%10 = load i64, i64* %7
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i64*, i64** %5
store i64 -1, i64* %13
%14 = load i32, i32* @EOVERFLOW
store i32 %14, i32* %4
br label %20
15: ; preds = %3
%16 = load i64, i64* %6
%17 = load i64, i64* %7
%18 = add i64 %16, %17
%19 = load i64*, i64** %5
store i64 %18, i64* %19
store i32 0, i32* %4
br label %20
20: ; preds = %15, %12
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@EOVERFLOW = global i32 0
define i32 @math_addull(i64* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = xor i64 %1, -1
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
store i64 -1, i64* %0
%7 = load i32, i32* @EOVERFLOW
br label %10
8: ; preds = %3
%9 = add i64 %2, %1
store i64 %9, i64* %0
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ 0, %8 ]
ret i32 %11
}
int is_blocked_ip(const char *ip) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @is_blocked_ip(i8* nocapture readnone %0) {
ret i32 1
}