xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ new_local_tbl(char *, int);
int /*<<< orphan*/ push_local_table(int /*<<< orphan*/);
void op_llt(int index) { push_local_table(new_local_tbl("Local", index)); }


x86 assembly (clang, -O0):
<op_llt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <new_local_tbl@plt>
mov    %eax,%edi
call   1040 <push_local_table@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_llt>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <new_local_tbl@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <push_local_table@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Local\00"
define void @op_llt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @new_local_tbl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @push_local_table(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Local\00"
define void @op_llt(i32 %0) {
%2 = tail call i32 @new_local_tbl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @push_local_table(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void redfish_log_to_stderr(void *log_ctx __attribute__((unused)),
                           const char *str) {
  fputs(str, stderr);
}


x86 assembly (clang, -O0):
<redfish_log_to_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redfish_log_to_stderr>:
mov    %rsi,%rdi
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @redfish_log_to_stderr(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 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @redfish_log_to_stderr(i8* nocapture readnone %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
const char *route_unknown(int num) {
  static char buf[64];
  snprintf(buf, sizeof(buf), "unknown (%u)", num);
  return buf;
}


x86 assembly (clang, -O0):
<route_unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x40,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<route_unknown>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@route_unknown.buf = internal global [64 x i8] zeroinitializer
@.str = [13 x i8] c"unknown (%u)\00"
define i8* @route_unknown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @route_unknown.buf, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @route_unknown.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@route_unknown.buf = internal global [64 x i8] zeroinitializer
@.str = [13 x i8] c"unknown (%u)\00"
define i8* @route_unknown(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @route_unknown.buf, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @route_unknown.buf, i64 0, i64 0)
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ dirname(char *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(int argc, char **argv) {
  puts(dirname(argv[1]));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <dirname@plt>
mov    %eax,%edi
call   1030 <puts@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <dirname@plt>
mov    %eax,%edi
call   1030 <puts@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @dirname(i8* %8)
%10 = call i32 @puts(i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @dirname(i8* %4)
%6 = tail call i32 @puts(i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
unsigned long wsh_strtoul(char const *, char **, int /*<<< orphan*/);
unsigned long extract_val(const char *nptr) {
  char *end;
  return wsh_strtoul(nptr, &end, 0);
}


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

x86 assembly (clang, -O2):
<extract_val>:
push   %rax
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <wsh_strtoul@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @extract_val(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @wsh_strtoul(i8* %0, i8** %2, i32 0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void nao_troca(int x, int y) {
  int aux;
  aux = x;
  x = y;
  y = aux;
  printf("Dentro da funcao nao_troca: x = %d, y = %d\n", x, y);
}


x86 assembly (clang, -O0):
<nao_troca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nao_troca>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Dentro da funcao nao_troca: x = %d, y = %d\0A\00"
define void @nao_troca(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Dentro da funcao nao_troca: x = %d, y = %d\0A\00"
define void @nao_troca(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ argument();
int /*<<< orphan*/ get_lexval();
int yyselect();
arguments() {
  switch (yyselect()) {
  case 9: {
    argument();
  } break;
  case 10: {
    argument();
    get_lexval();
    arguments();
  } break;
  }
}


x86 assembly (clang, -O0):
<arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x9,%eax
je     1173 <arguments+0x33>
jmp    1162 <arguments+0x22>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
je     117f <arguments+0x3f>
jmp    1192 <arguments+0x52>
mov    $0x0,%al
call   1040 <argument@plt>
jmp    1192 <arguments+0x52>
mov    $0x0,%al
call   1040 <argument@plt>
mov    $0x0,%al
call   1060 <get_lexval@plt>
call   1030 <arguments@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arguments>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0xa,%eax
jne    115c <arguments+0x2c>
xor    %eax,%eax
call   1030 <argument@plt>
xor    %eax,%eax
call   1050 <get_lexval@plt>
jmp    1140 <arguments+0x10>
cmp    $0x9,%eax
jne    1168 <arguments+0x38>
xor    %eax,%eax
call   1030 <argument@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @arguments() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %9 [
i32 9, label %3
i32 10, label %5
]
3: ; preds = %0
%4 = call i32 (...) @argument()
br label %9
5: ; preds = %0
%6 = call i32 (...) @argument()
%7 = call i32 (...) @get_lexval()
%8 = call i32 @arguments()
br label %9
9: ; preds = %0, %5, %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @arguments() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @yyselect()
switch i32 %2, label %8 [
i32 9, label %3
i32 10, label %5
]
3: ; preds = %1
%4 = tail call i32 (...) @argument()
br label %8
5: ; preds = %1
%6 = tail call i32 (...) @argument()
%7 = tail call i32 (...) @get_lexval()
br label %1
8: ; preds = %1, %3
ret i32 undef
}
int is_ascii(char a) {
  if (a >= ' ' && a <= '~')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jl     1130 <is_ascii+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jg     1130 <is_ascii+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_ascii+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ascii>:
add    $0xe0,%dil
xor    %eax,%eax
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_ascii(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 126
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_ascii(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
IR0AR1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    0x10f444(%rcx),%eax
ja     113a <IR0AR1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <IR0AR1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AR1>:
mov    (%r8),%ecx
xor    %eax,%eax
cmp    0x10f444(%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %4
%8 = getelementptr inbounds i32, i32* %5, i64 277777
%9 = load i32, i32* %8
%10 = icmp ule i32 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t int_hash(uint32_t key) {
  uint32_t c2 = 0x27d4eb2du;
  key = (key ^ 61) ^ (key >> 16);
  key = key + (key << 3);
  key = key ^ (key >> 4);
  key = key * c2;
  key = key ^ (key >> 15);
  return key;
}


x86 assembly (clang, -O0):
<int_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x27d4eb2d,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x3d,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xf,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_hash>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
xor    $0x3d,%eax
lea    (%rax,%rax,8),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
xor    %eax,%ecx
imul   $0x27d4eb2d,%ecx,%ecx
mov    %ecx,%eax
sar    $0xf,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @int_hash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 668265261, i32* %3
%4 = load i32, i32* %2
%5 = xor i32 %4, 61
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = xor i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = shl i32 %10, 3
%12 = add nsw i32 %9, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = ashr i32 %14, 4
%16 = xor i32 %13, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = mul nsw i32 %17, %18
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 15
%23 = xor i32 %20, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @int_hash(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = xor i32 %3, 61
%5 = mul i32 %4, 9
%6 = ashr i32 %5, 4
%7 = xor i32 %6, %5
%8 = mul nsw i32 %7, 668265261
%9 = ashr i32 %8, 15
%10 = xor i32 %9, %8
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ wip_pwm_validate_map(int /*<<< orphan*/ volatile *);
void wip_reg_write(volatile uint32_t *ptr, int reg, uint32_t value) {
  if (wip_pwm_validate_map(ptr) >= 0) {
    *(ptr + (reg >> 2)) = value;
  }
}


x86 assembly (clang, -O0):
<wip_reg_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wip_pwm_validate_map@plt>
cmp    $0x0,%rax
jl     1148 <wip_reg_write+0x38>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wip_reg_write>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <wip_pwm_validate_map@plt>
test   %rax,%rax
js     1130 <wip_reg_write+0x20>
sar    $0x2,%ebp
movslq %ebp,%rax
mov    %r14d,(%rbx,%rax,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @wip_reg_write(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 = call i64 @wip_pwm_validate_map(i32* %7)
%9 = icmp sge i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i32, i32* %6
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = ashr i32 %13, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
store volatile i32 %11, i32* %16
br label %17
17: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
define void @wip_reg_write(i32* %0, i32 %1, i32 %2) {
%4 = tail call i64 @wip_pwm_validate_map(i32* %0)
%5 = icmp sgt i64 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = ashr i32 %1, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
store volatile i32 %2, i32* %9
br label %10
10: ; preds = %6, %3
ret void
}
int waitpid(pid, stat_loc, options)
int pid, *stat_loc, options;
{
  for (;;) {
    int wpid = wait(stat_loc);
    if (wpid == pid || wpid == -1)
      return wpid;
  }
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <wait@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1146 <waitpid+0x36>
cmpl   $0xffffffff,-0x18(%rbp)
jne    114f <waitpid+0x3f>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    1122 <waitpid+0x12>

x86 assembly (clang, -O2):
<waitpid>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <wait@plt>
cmp    %ebp,%eax
je     1133 <waitpid+0x23>
cmp    $0xffffffff,%eax
jne    1120 <waitpid+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 (i32*, ...) bitcast (i32 (...)* @wait to i32 (i32*, ...)*)(i32* %1)
%6 = icmp eq i32 %5, %0
%7 = icmp eq i32 %5, -1
%8 = or i1 %6, %7
br i1 %8, label %9, label %4
9: ; preds = %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ threadname;

/* Variables and functions */
int /*<<< orphan*/ PR_SET_NAME;
int /*<<< orphan*/ prctl(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ strncpy(char *, char const *, int);
void set_threadname(const char *name) {
  char threadname[17];
  strncpy(threadname, name, sizeof(threadname));
  threadname[16] = 0;
  prctl(PR_SET_NAME, (unsigned long)&threadname);
}


x86 assembly (clang, -O0):
<set_threadname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x11,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x10(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1040 <prctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_threadname>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x11,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x10(%rsp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <prctl@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@PR_SET_NAME = global i32 0
define void @set_threadname(i8* %0) {
%2 = alloca i8*
%3 = alloca [17 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 17)
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 16
store i8 0, i8* %7
%8 = load i32, i32* @PR_SET_NAME
%9 = ptrtoint [17 x i8]* %3 to i64
%10 = call i32 @prctl(i32 %8, i64 %9)
ret void
}

LLVM IR (-O2):
@PR_SET_NAME = global i32 0
define void @set_threadname(i8* %0) {
%2 = alloca [17 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 17)
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 16
store i8 0, i8* %5
%6 = load i32, i32* @PR_SET_NAME
%7 = ptrtoint [17 x i8]* %2 to i64
%8 = call i32 @prctl(i32 %6, i64 %7)
ret void
}
int length_str(char *x) {
  int i = 0;
  while (x[i])
    i++;
  return i;
}


x86 assembly (clang, -O0):
<length_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <length_str+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length_str+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_str>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length_str+0x10>
ret

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

LLVM IR (-O2):
define i32 @length_str(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
void notified(int sig, pid_t pid, int value) {
  (void)sig;
  (void)pid;
  (void)value;
  ;
}


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

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

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

LLVM IR (-O2):
define void @notified(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  printf("%d\n", EOF);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EOF
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int rand();
int generate_rand_number() {
  int num;
  num = rand() % 100 + 1;
  return num;
}


x86 assembly (clang, -O0):
<generate_rand_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_rand_number>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @generate_rand_number() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @generate_rand_number() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
ret i32 %3
}
int test_imm_ACint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xAC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ACint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11272192
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ IsItMagic(int **, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int inp;
  do {
    scanf("%d", &inp);
    printf("\n");
  } while (inp < 0 && inp > 999);
  int square[999][999];
  IsItMagic(square, inp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3ce9e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x3ce9d1(%rbp)
jge    1180 <main+0x50>
cmpl   $0x3e7,-0x8(%rbp)
setg   %al
mov    %al,-0x3ce9d1(%rbp)
mov    -0x3ce9d1(%rbp),%al
test   $0x1,%al
jne    1142 <main+0x12>
lea    -0x3ce9d0(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <IsItMagic@plt>
xor    %eax,%eax
add    $0x3ce9e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x3ce9d8,%rsp
lea    0xec2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1040 <IsItMagic@plt>
xor    %eax,%eax
add    $0x3ce9d8,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [999 x [999 x i32]]
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = call i32 @putchar(i32 10)
%6 = bitcast [999 x [999 x i32]]* %2 to i8*
%7 = bitcast [999 x [999 x i32]]* %2 to i32**
%8 = load i32, i32* %1
%9 = call i32 @IsItMagic(i32** %7, i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ RB_XMLDB_Generate_String(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void RB_XMLDB_Generate_Item_Name(FILE *dest_doc, char *name) {
  fprintf(dest_doc, "<formalpara><title>");
  RB_XMLDB_Generate_String(dest_doc, name);
  fprintf(dest_doc, "</title><para></para></formalpara>\n");
}


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

x86 assembly (clang, -O2):
<RB_XMLDB_Generate_Item_Name>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <RB_XMLDB_Generate_String@plt>
lea    0xebf(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"<formalpara><title>\00"
@.str.1 = [36 x i8] c"</title><para></para></formalpara>\0A\00"
define void @RB_XMLDB_Generate_Item_Name(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 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = call i32 @RB_XMLDB_Generate_String(i32* %7, i8* %8)
%10 = load i32*, i32** %3
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"<formalpara><title>\00"
@.str.1 = [36 x i8] c"</title><para></para></formalpara>\0A\00"
define void @RB_XMLDB_Generate_Item_Name(i32* %0, i8* %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 19, i64 1, i32* %0)
%4 = tail call i32 @RB_XMLDB_Generate_String(i32* %0, i8* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i64 35, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ board_fen(char *);
int /*<<< orphan*/ xm(char *);
void xfen(void) {
  char fen[256];
  board_fen(fen);
  xm(fen);
}


x86 assembly (clang, -O0):
<xfen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
call   1030 <board_fen@plt>
lea    -0x100(%rbp),%rdi
call   1040 <xm@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfen>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <board_fen@plt>
mov    %rbx,%rdi
call   1040 <xm@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @xfen() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @board_fen(i8* %2)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @xm(i8* %4)
ret void
}

LLVM IR (-O2):
define void @xfen() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @board_fen(i8* %2)
%4 = call i32 @xm(i8* %2)
ret void
}
int disconnectFromServer(struct conn *conn) {}


x86 assembly (clang, -O0):
<disconnectFromServer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.conn = type opaque
define i32 @disconnectFromServer(%struct.conn* %0) {
%2 = alloca i32
%3 = alloca %struct.conn*
store %struct.conn* %0, %struct.conn** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.conn = type opaque
define i32 @disconnectFromServer(%struct.conn* nocapture readnone %0) {
ret i32 undef
}
void *rt_texture_copy_vcstri(void *sc, void *oldtex) {
  struct anon$25 *newtex;
  newtex = new_vcstri_texture();
  memcpy((void *)newtex, oldtex, 104ul);
  return (void *)newtex;
}


x86 assembly (clang, -O0):
<rt_texture_copy_vcstri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <new_vcstri_texture@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x68,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_texture_copy_vcstri>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <new_vcstri_texture@plt>
cltq
movups (%rbx),%xmm0
movups 0x10(%rbx),%xmm1
movups 0x20(%rbx),%xmm2
movups 0x30(%rbx),%xmm3
movups %xmm0,(%rax)
movups %xmm1,0x10(%rax)
movups %xmm2,0x20(%rax)
movups %xmm3,0x30(%rax)
movups 0x40(%rbx),%xmm0
movups %xmm0,0x40(%rax)
movups 0x50(%rbx),%xmm0
movups %xmm0,0x50(%rax)
mov    0x60(%rbx),%rcx
mov    %rcx,0x60(%rax)
pop    %rbx
ret

LLVM IR (-O0):
%"struct.anon$25" = type opaque
define i8* @rt_texture_copy_vcstri(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %"struct.anon$25"*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 (...) @new_vcstri_texture()
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %"struct.anon$25"*
store %"struct.anon$25"* %8, %"struct.anon$25"** %5
%9 = load %"struct.anon$25"*, %"struct.anon$25"** %5
%10 = bitcast %"struct.anon$25"* %9 to i8*
%11 = load i8*, i8** %4
%12 = load %"struct.anon$25"*, %"struct.anon$25"** %5
%13 = bitcast %"struct.anon$25"* %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @rt_texture_copy_vcstri(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 (...) @new_vcstri_texture()
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(104) %5, i8* align 1 dereferenceable(104) %1, i64 104, i1 false)
ret i8* %5
}
int player_sprite_creation_update(int charinput) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @player_sprite_creation_update(i32 %0) {
ret i32 0
}
unsigned long read_be32(unsigned char *in) {
  unsigned long result = 0;
  result |= (unsigned long)in[0] << 24;
  result |= (unsigned long)in[1] << 16;
  result |= (unsigned long)in[2] << 8;
  result |= (unsigned long)in[3];
  return result;
}


x86 assembly (clang, -O0):
<read_be32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_be32>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @read_be32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
const char *zlibVersion() { return "my"; }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"my\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int fchownat(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/, int);
int lchownat(int fd, char const *file, uid_t owner, gid_t group) {
  return fchownat(fd, file, owner, group, 4096);
}


x86 assembly (clang, -O0):
<lchownat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1000,%r8d
call   1030 <fchownat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lchownat>:
mov    $0x1000,%r8d
jmp    1030 <fchownat@plt>

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

LLVM IR (-O2):
define i32 @lchownat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @fchownat(i32 %0, i8* %1, i32 %2, i32 %3, i32 4096)
ret i32 %5
}
void PUT_ITGR_PAD(n, p) int n;
int p;
{
  if (n >= 0)
    printf("+");
  else
    printf("-");
  if (p > 0)
    PUT_NAT_PAD(n, p - 1);
  else
    printf("%d", n);
}


x86 assembly (clang, -O0):
<PUT_ITGR_PAD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     114b <PUT_ITGR_PAD+0x2b>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1159 <PUT_ITGR_PAD+0x39>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1178 <PUT_ITGR_PAD+0x58>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    $0x0,%al
call   1040 <PUT_NAT_PAD@plt>
jmp    1189 <PUT_ITGR_PAD+0x69>
mov    -0x4(%rbp),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUT_ITGR_PAD>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x1f,%eax
lea    (%rax,%rax,1),%edi
add    $0x2b,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
jle    115f <PUT_ITGR_PAD+0x2f>
add    $0xffffffff,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <PUT_NAT_PAD@plt>
lea    0xe9a(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"+\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [3 x i8] c"%d\00"
define void @PUT_ITGR_PAD(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = call i32 (i32, i32, ...) bitcast (i32 (...)* @PUT_NAT_PAD to i32 (i32, i32, ...)*)(i32 %15, i32 %17)
br label %22
19: ; preds = %11
%20 = load i32, i32* %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %14
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
define void @PUT_ITGR_PAD(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
%4 = select i1 %3, i32 43, i32 45
%5 = tail call i32 @putchar(i32 %4)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = add nsw i32 %1, -1
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @PUT_NAT_PAD to i32 (i32, i32, ...)*)(i32 %0, i32 %8)
br label %12
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %12
12: ; preds = %10, %7
ret void
}
int add_values(int x, int y) { return x + y; }


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

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

LLVM IR (-O0):
define i32 @add_values(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add_values(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
__attribute__((always_)) void vector_copy(short *VD, short *VS) {
  register int i;
  for (i = 0; i < 8; i++)
    VD[i] = VS[i];
  return;
}


x86 assembly (clang, -O0):
<vector_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1143 <vector_copy+0x43>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <vector_copy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_copy>:
movzwl (%rsi),%eax
mov    %ax,(%rdi)
movzwl 0x2(%rsi),%eax
mov    %ax,0x2(%rdi)
movzwl 0x4(%rsi),%eax
mov    %ax,0x4(%rdi)
movzwl 0x6(%rsi),%eax
mov    %ax,0x6(%rdi)
movzwl 0x8(%rsi),%eax
mov    %ax,0x8(%rdi)
movzwl 0xa(%rsi),%eax
mov    %ax,0xa(%rdi)
movzwl 0xc(%rsi),%eax
mov    %ax,0xc(%rdi)
movzwl 0xe(%rsi),%eax
mov    %ax,0xe(%rdi)
ret

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

LLVM IR (-O2):
define void @vector_copy(i16* nocapture writeonly %0, i16* nocapture %1) {
%3 = load i16, i16* %1
store i16 %3, i16* %0
%4 = getelementptr inbounds i16, i16* %1, i64 1
%5 = load i16, i16* %4
%6 = getelementptr inbounds i16, i16* %0, i64 1
store i16 %5, i16* %6
%7 = getelementptr inbounds i16, i16* %1, i64 2
%8 = load i16, i16* %7
%9 = getelementptr inbounds i16, i16* %0, i64 2
store i16 %8, i16* %9
%10 = getelementptr inbounds i16, i16* %1, i64 3
%11 = load i16, i16* %10
%12 = getelementptr inbounds i16, i16* %0, i64 3
store i16 %11, i16* %12
%13 = getelementptr inbounds i16, i16* %1, i64 4
%14 = load i16, i16* %13
%15 = getelementptr inbounds i16, i16* %0, i64 4
store i16 %14, i16* %15
%16 = getelementptr inbounds i16, i16* %1, i64 5
%17 = load i16, i16* %16
%18 = getelementptr inbounds i16, i16* %0, i64 5
store i16 %17, i16* %18
%19 = getelementptr inbounds i16, i16* %1, i64 6
%20 = load i16, i16* %19
%21 = getelementptr inbounds i16, i16* %0, i64 6
store i16 %20, i16* %21
%22 = getelementptr inbounds i16, i16* %1, i64 7
%23 = load i16, i16* %22
%24 = getelementptr inbounds i16, i16* %0, i64 7
store i16 %23, i16* %24
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void szof(char array[]) { printf("szof array %d\n", sizeof(array)); }


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

x86 assembly (clang, -O2):
<szof>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"szof array %d\0A\00"
define void @szof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"szof array %d\0A\00"
define void @szof(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}