xunge/DecIR huggingface dataset:
void gl_putc(c) int c;
{
  char ch = c;
  write(1, &ch, 1);
  if (ch == '\n') {
    ch = '\r';
    write(1, &ch, 1);
  }
}


x86 assembly (clang, -O0):
<gl_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
mov    $0x0,%al
call   1030 <write@plt>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1156 <gl_putc+0x46>
movb   $0xd,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
mov    $0x0,%al
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_putc>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmpb   $0xa,0x7(%rsp)
jne    114e <gl_putc+0x3e>
movb   $0xd,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @gl_putc(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %2, i32 1)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %1
store i8 13, i8* %2
%8 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %2, i32 1)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char, void *);
void __attribute__((no)) sherbrook(int a, char *b, char c, void *d) {
  printf("%d .%s, %c, %p\n", a, b, c, d);
  return;
}


x86 assembly (clang, -O0):
<sherbrook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x11(%rbp),%al
mov    -0x20(%rbp),%r8
lea    0xec3(%rip),%rdi
movsbl %al,%ecx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sherbrook>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%d .%s, %c, %p\0A\00"
define void @sherbrook(i32 %0, i8* %1, i8 signext %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8 %2, i8* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8, i8* %7
%12 = load i8*, i8** %8
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i8 signext %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d .%s, %c, %p\0A\00"
define void @sherbrook(i32 %0, i8* %1, i8 signext %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8 signext %2, i8* %3)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int htons(int);
int ntohs(int);
int /*<<< orphan*/ printf(char *, int, char *, int);
int main(int argc, char **argv) {
  uint16_t var16bit;
  uint16_t var16bitResult;
  var16bit = 0x3210;
  var16bitResult = htons(var16bit);
  var16bitResult = ntohs(var16bit);
  printf("Argc = %i\nArgv[0] = %s\nResult 16bit = %"
         "u"
         "\n",
         argc, argv[0], var16bitResult);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3210,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <ntohs@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%ecx
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x3210,%edi
call   1030 <htons@plt>
mov    $0x3210,%edi
call   1050 <ntohs@plt>
mov    (%rbx),%rdx
lea    0xeaa(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Argc = %i\0AArgv[0] = %s\0AResult 16bit = %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 12816, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @htons(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = call i32 @ntohs(i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = load i32, i32* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"Argc = %i\0AArgv[0] = %s\0AResult 16bit = %u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @htons(i32 12816)
%4 = tail call i32 @ntohs(i32 12816)
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %5, i32 %4)
ret i32 0
}
void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @usb_asmedia_modifyflowcontrol(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @usb_asmedia_modifyflowcontrol(%struct.pci_dev* nocapture %0) {
ret void
}
/* Type definitions */
struct proctal {
  int dummy;
};

/* Variables and functions */
void proctal_implementation_close(struct proctal *);
void proctal_close(struct proctal *p) {
  return proctal_implementation_close(p);
}


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

x86 assembly (clang, -O2):
<proctal_close>:
jmp    1030 <proctal_implementation_close@plt>

LLVM IR (-O0):
%struct.proctal = type { i32 }
define void @proctal_close(%struct.proctal* %0) {
%2 = alloca %struct.proctal*
store %struct.proctal* %0, %struct.proctal** %2
%3 = load %struct.proctal*, %struct.proctal** %2
ret void
}

LLVM IR (-O2):
%struct.proctal = type { i32 }
define void @proctal_close(%struct.proctal* %0) {
tail call void @proctal_implementation_close(%struct.proctal* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void free_u64(uint64_t *val) {}


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

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

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

LLVM IR (-O2):
define void @free_u64(i32* nocapture %0) {
ret void
}
void aofReadDiffFromParent(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               47, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<aofReadDiffFromParent>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2f,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aofReadDiffFromParent>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x2f,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aofReadDiffFromParent = [22 x i8] c"aofReadDiffFromParent\00"
define void @aofReadDiffFromParent() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 47, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.aofReadDiffFromParent, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aofReadDiffFromParent = [22 x i8] c"aofReadDiffFromParent\00"
define void @aofReadDiffFromParent() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 47, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.aofReadDiffFromParent, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_event_all(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ audio_toggle_mixer_channel();
void req_toggle_mixer_channel() {
  audio_toggle_mixer_channel();
  add_event_all(0x10, NULL);
}


x86 assembly (clang, -O0):
<req_toggle_mixer_channel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <audio_toggle_mixer_channel@plt>
mov    $0x10,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <add_event_all@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<req_toggle_mixer_channel>:
push   %rax
xor    %eax,%eax
call   1030 <audio_toggle_mixer_channel@plt>
mov    $0x10,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <add_event_all@plt>

LLVM IR (-O0):
define void @req_toggle_mixer_channel() {
%1 = call i32 (...) @audio_toggle_mixer_channel()
%2 = call i32 @add_event_all(i32 16, i32* null)
ret void
}

LLVM IR (-O2):
define void @req_toggle_mixer_channel() {
%1 = tail call i32 (...) @audio_toggle_mixer_channel()
%2 = tail call i32 @add_event_all(i32 16, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __sys_outc(int /*<<< orphan*/);
void print_str(char *s) {
  while (*s) {
    __sys_outc(*s++);
  }
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <print_str+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <__sys_outc@plt>
jmp    111c <print_str+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <__sys_outc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @__sys_outc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
AR0A1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[10000000]) = (*((float *)11111111)); }


x86 assembly (clang, -O0):
<AR0A1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa98ac7,%eax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x2625a00(%rax)
02
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0A1>:
movss  0xa98ac7,%xmm0
movss  %xmm0,0x2625a00(%rdx)
02
ret

LLVM IR (-O0):
define i32 @AR0A1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* inttoptr (i64 11111111 to float*)
%17 = load float*, float** %12
%18 = getelementptr inbounds float, float* %17, i64 10000000
store float %16, float* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @AR0A1(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = load float, float* inttoptr (i64 11111111 to float*)
%8 = getelementptr inbounds float, float* %4, i64 10000000
store float %7, float* %8
ret i32 undef
}
/* Type definitions */
struct ns_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ns_mqtt_prepend_header(struct ns_connection *, int,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void ns_mqtt_ping(struct ns_connection *nc) {
  ns_mqtt_prepend_header(nc, 12, 0, 0);
}


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

x86 assembly (clang, -O2):
<ns_mqtt_ping>:
mov    $0xc,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ns_mqtt_prepend_header@plt>

LLVM IR (-O0):
%struct.ns_connection = type { i32 }
define void @ns_mqtt_ping(%struct.ns_connection* %0) {
%2 = alloca %struct.ns_connection*
store %struct.ns_connection* %0, %struct.ns_connection** %2
%3 = load %struct.ns_connection*, %struct.ns_connection** %2
%4 = call i32 @ns_mqtt_prepend_header(%struct.ns_connection* %3, i32 12, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ns_connection = type { i32 }
define void @ns_mqtt_ping(%struct.ns_connection* %0) {
%2 = tail call i32 @ns_mqtt_prepend_header(%struct.ns_connection* %0, i32 12, i32 0, i32 0)
ret void
}
void perf_output_results(void) {}


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

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

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

LLVM IR (-O2):
define void @perf_output_results() {
ret void
}
/* Variables and functions */
char const *COM_GetToken(char **, int);
const char *COM_Parse(char **data_p) { return COM_GetToken(data_p, 1); }


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

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

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

LLVM IR (-O2):
define i8* @COM_Parse(i8** %0) {
%2 = tail call i8* @COM_GetToken(i8** %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memchunk_memcpy() {
  printf("NOT IMPLEMENTED:"
         "pa_memchunk_memcpy"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_memchunk_memcpy\00"
define i32 @pa_memchunk_memcpy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
void gen_name_mesh_dir(const char *name, char *mesh_dir) {
  strcpy(mesh_dir, "ply/");
  strcat(mesh_dir, name);
}


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

x86 assembly (clang, -O2):
<gen_name_mesh_dir>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ply/\00"
define void @gen_name_mesh_dir(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 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @strcat(i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ply/\00"
define void @gen_name_mesh_dir(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %1, i8* %0)
ret void
}
void PushFalseArgumentSyntaxMapping(void) {}


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

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

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

LLVM IR (-O2):
define void @PushFalseArgumentSyntaxMapping() {
ret void
}
/* Variables and functions */
int lambda_precomp(int);
double lambda_ij_precomp(int spec_i, int spec_j) {
  return (lambda_precomp(spec_i) + lambda_precomp(spec_j)) / 2;
}


x86 assembly (clang, -O0):
<lambda_ij_precomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lambda_precomp@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <lambda_precomp@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lambda_ij_precomp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <lambda_precomp@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <lambda_precomp@plt>
add    %ebp,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cvtsi2sd %ecx,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @lambda_ij_precomp(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 = call i32 @lambda_precomp(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @lambda_precomp(i32 %7)
%9 = add nsw i32 %6, %8
%10 = sdiv i32 %9, 2
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @lambda_ij_precomp(i32 %0, i32 %1) {
%3 = tail call i32 @lambda_precomp(i32 %0)
%4 = tail call i32 @lambda_precomp(i32 %1)
%5 = add nsw i32 %4, %3
%6 = sdiv i32 %5, 2
%7 = sitofp i32 %6 to double
ret double %7
}
int test_imm_C9uint16_mem(unsigned short *val) {
  return ((*val) & (-0xC9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C9uint16_mem>:
movzwl (%rdi),%eax
test   $0xff37,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C9uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -201
%7 = icmp ne i32 %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_C9uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -201
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int statx(char const *, struct stat *, int, int);
int __xstat(int ver, const char *pathname, struct stat *st) {
  assert(ver == 0);
  return statx(pathname, st, sizeof(*st), 0x00);
}


x86 assembly (clang, -O0):
<__xstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <statx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xstat>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
xor    %eax,%eax
test   %edi,%edi
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <statx@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @__xstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat* %2, %struct.stat** %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %5
%12 = load %struct.stat*, %struct.stat** %6
%13 = call i32 @statx(i8* %11, %struct.stat* %12, i32 4, i32 0)
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @__xstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = icmp eq i32 %0, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @statx(i8* %1, %struct.stat* %2, i32 4, i32 0)
ret i32 %7
}
/* Type definitions */
struct dnaSeq {
  int dummy;
};

/* Variables and functions */
struct dnaSeq *faNextSeqFromMemText(char **, int);
struct dnaSeq *faFromMemText(char *text) {
  return faNextSeqFromMemText(&text, 1);
}


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

x86 assembly (clang, -O2):
<faFromMemText>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <faNextSeqFromMemText@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faFromMemText(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call %struct.dnaSeq* @faNextSeqFromMemText(i8** %2, i32 1)
ret %struct.dnaSeq* %3
}

LLVM IR (-O2):
%struct.dnaSeq = type { i32 }
define %struct.dnaSeq* @faFromMemText(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call %struct.dnaSeq* @faNextSeqFromMemText(i8** %2, i32 1)
ret %struct.dnaSeq* %3
}
/* Variables and functions */
scalar_t__ isLittleEndian();
unsigned short little2bigus(unsigned short);
unsigned short little2hostus(unsigned short num) {
  if (isLittleEndian())
    return num;
  return little2bigus(num);
}


x86 assembly (clang, -O0):
<little2hostus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <isLittleEndian@plt>
cmp    $0x0,%rax
je     114d <little2hostus+0x2d>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115a <little2hostus+0x3a>
movzwl -0x4(%rbp),%edi
call   1030 <little2bigus@plt>
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little2hostus>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <isLittleEndian@plt>
test   %rax,%rax
je     1133 <little2hostus+0x13>
mov    %ebx,%eax
pop    %rbx
ret
movzwl %bx,%edi
pop    %rbx
jmp    1030 <little2bigus@plt>

LLVM IR (-O0):
define zeroext i16 @little2hostus(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = call i64 (...) @isLittleEndian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i16, i16* %3
store i16 %7, i16* %2
br label %11
8: ; preds = %1
%9 = load i16, i16* %3
%10 = call zeroext i16 @little2bigus(i16 zeroext %9)
store i16 %10, i16* %2
br label %11
11: ; preds = %8, %6
%12 = load i16, i16* %2
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @little2hostus(i16 zeroext %0) {
%2 = tail call i64 (...) @isLittleEndian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call zeroext i16 @little2bigus(i16 zeroext %0)
br label %6
6: ; preds = %1, %4
%7 = phi i16 [ %5, %4 ], [ %0, %1 ]
ret i16 %7
}
void WriteJoy(int port, int channel, float value) {}


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

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

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

LLVM IR (-O2):
define void @WriteJoy(i32 %0, i32 %1, float %2) {
ret void
}
char *tfForInt(int i) {
  if (i)
    return "T";
  else
    return "F";
}


x86 assembly (clang, -O0):
<tfForInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <tfForInt+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <tfForInt+0x2c>
lea    0xeda(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfForInt>:
test   %edi,%edi
lea    0xef9(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"T\00"
@.str.1 = [2 x i8] c"F\00"
define i8* @tfForInt(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [2 x i8] c"T\00"
@.str.1 = [2 x i8] c"F\00"
define i8* @tfForInt(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
int subtraction(int val1, int val2) { return (val1 - val2); }


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

x86 assembly (clang, -O2):
<subtraction>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @subtraction(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subtraction(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
void disconnect_proxy1() {}


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

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

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

LLVM IR (-O2):
define void @disconnect_proxy1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ even_or_odd(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  printf("Enter the number\n");
  scanf("%d", &num);
  even_or_odd(num);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <even_or_odd@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [17 x i8] c"Enter the number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @even_or_odd(i32 %5)
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
                socklen_t hostlen, char *serv, socklen_t servlen,
                unsigned int flags) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<getnameinfo>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%ecx
mov    0x2eab(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnameinfo>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getnameinfo(%struct.sockaddr* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5, i32 %6) {
%8 = alloca %struct.sockaddr*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store %struct.sockaddr* %0, %struct.sockaddr** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* @ENOSYS
store i32 %15, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getnameinfo(%struct.sockaddr* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i32 %5, i32 %6) {
%8 = load i32, i32* @ENOSYS
store i32 %8, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ crc8_p93_next(int /*<<< orphan*/, int /*<<< orphan*/ const);
uint8_t crc8_p93_3b(uint8_t const data1, uint8_t const data2,
                    uint8_t const data3) {
  uint8_t crc = 0;
  crc = crc8_p93_next(crc, data1);
  crc = crc8_p93_next(crc, data2);
  crc = crc8_p93_next(crc, data3);
  return crc;
}


x86 assembly (clang, -O0):
<crc8_p93_3b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <crc8_p93_next@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <crc8_p93_next@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <crc8_p93_next@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc8_p93_3b>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%esi
xor    %edi,%edi
call   1030 <crc8_p93_next@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <crc8_p93_next@plt>
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <crc8_p93_next@plt>

LLVM IR (-O0):
define i32 @crc8_p93_3b(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
store i32 0, i32* %7
%8 = load i32, i32* %7
%9 = load i32, i32* %4
%10 = call i32 @crc8_p93_next(i32 %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = call i32 @crc8_p93_next(i32 %11, i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = call i32 @crc8_p93_next(i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @crc8_p93_3b(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @crc8_p93_next(i32 0, i32 %0)
%5 = tail call i32 @crc8_p93_next(i32 %4, i32 %1)
%6 = tail call i32 @crc8_p93_next(i32 %5, i32 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printPrime(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int num = 0;
  printf("Enter a number\n");
  scanf("%5d", &num);
  printf("Prime number in range 1 to %d:", num);
  printPrime(num);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
call   1060 <printPrime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a number\0A\00"
@.str.1 = [4 x i8] c"%5d\00"
@.str.2 = [31 x i8] c"Prime number in range 1 to %d:\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%8 = load i32, i32* %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %5
%11 = call i32 @printPrime(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%5d\00"
@.str.2 = [31 x i8] c"Prime number in range 1 to %d:\00"
@str = [15 x i8] c"Enter a number\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @printPrime(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void mi_write_op(void) {
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008);
  udelay(100);
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008 | 0x0004);
  udelay(100);
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008 | 0x0001);
  udelay(100);
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008 | 0x0001 | 0x0004);
  udelay(100);
}


x86 assembly (clang, -O0):
<mi_write_op>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc000c20,%eax
movw   $0x8,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0xc,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0x9,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0xd,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_write_op>:
push   %rax
movw   $0x8,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0xc,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0x9,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0xd,0xc000c20
mov    $0x64,%edi
pop    %rax
jmp    1030 <udelay@plt>

LLVM IR (-O0):
define void @mi_write_op() {
store volatile i16 8, i16* inttoptr (i64 201329696 to i16*)
%1 = call i32 @udelay(i32 100)
store volatile i16 12, i16* inttoptr (i64 201329696 to i16*)
%2 = call i32 @udelay(i32 100)
store volatile i16 9, i16* inttoptr (i64 201329696 to i16*)
%3 = call i32 @udelay(i32 100)
store volatile i16 13, i16* inttoptr (i64 201329696 to i16*)
%4 = call i32 @udelay(i32 100)
ret void
}

LLVM IR (-O2):
define void @mi_write_op() {
store volatile i16 8, i16* inttoptr (i64 201329696 to i16*)
%1 = tail call i32 @udelay(i32 100)
store volatile i16 12, i16* inttoptr (i64 201329696 to i16*)
%2 = tail call i32 @udelay(i32 100)
store volatile i16 9, i16* inttoptr (i64 201329696 to i16*)
%3 = tail call i32 @udelay(i32 100)
store volatile i16 13, i16* inttoptr (i64 201329696 to i16*)
%4 = tail call i32 @udelay(i32 100)
ret void
}
void test__tolower(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, _tolower(i++));
}


x86 assembly (clang, -O0):
<test__tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1179 <test__tolower+0x59>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_tolower@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe9a(%rip),%rdi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test__tolower+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test__tolower>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <_tolower@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test__tolower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test__tolower = [14 x i8] c"test__tolower\00"
define void @test__tolower() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @_tolower to i32 (i32, ...)*)(i32 %2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.test__tolower, i64 0, i64 0), i32 %2, i32 %4)
%6 = icmp eq i32 %3, 256
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
/* Variables and functions */
char *ch_ltoa(char *, unsigned long, int);
char *utoa(unsigned long val, char *s, int radix) {
  return ch_ltoa(s, val, radix);
}


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

x86 assembly (clang, -O2):
<utoa>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <ch_ltoa@plt>

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

LLVM IR (-O2):
define i8* @utoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ch_ltoa(i8* %1, i64 %0, i32 %2)
ret i8* %4
}
/* Variables and functions */
float maths_fast_sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vectors_norm_sqr(float const *);
float vectors_norm(const float u[3]) {
  return maths_fast_sqrt(vectors_norm_sqr(u));
}


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

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

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

LLVM IR (-O2):
define float @vectors_norm(float* %0) {
%2 = tail call i32 @vectors_norm_sqr(float* %0)
%3 = tail call float @maths_fast_sqrt(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void UI_SetupMenu_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/art/back_0");
  trap_R_RegisterShaderNoMip("menu/art/back_1");
  trap_R_RegisterShaderNoMip("menu/art/frame2_l");
  trap_R_RegisterShaderNoMip("menu/art/frame1_r");
}


x86 assembly (clang, -O0):
<UI_SetupMenu_Cache>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xee9(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xeed(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef3(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_SetupMenu_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xeec(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef0(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef6(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"menu/art/back_0\00"
@.str.1 = [16 x i8] c"menu/art/back_1\00"
@.str.2 = [18 x i8] c"menu/art/frame2_l\00"
@.str.3 = [18 x i8] c"menu/art/frame1_r\00"
define void @UI_SetupMenu_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"menu/art/back_0\00"
@.str.1 = [16 x i8] c"menu/art/back_1\00"
@.str.2 = [18 x i8] c"menu/art/frame2_l\00"
@.str.3 = [18 x i8] c"menu/art/frame1_r\00"
define void @UI_SetupMenu_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
#define FE_DOWNWARD 131
#define FE_TONEAREST 130
#define FE_TOWARDZERO 129
#define FE_UPWARD 128
int /*<<< orphan*/ _FPU_SETROUND(int);
int __fesetround(int round) {
  switch (round) {
  case FE_TONEAREST:
  case FE_TOWARDZERO:
  case FE_DOWNWARD:
  case FE_UPWARD:
    _FPU_SETROUND(round);
    return 0;
  default:
    return round;
  }
}


x86 assembly (clang, -O0):
<__fesetround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x3,%eax
ja     1143 <__fesetround+0x33>
jmp    112f <__fesetround+0x1f>
mov    -0x8(%rbp),%edi
call   1030 <_FPU_SETROUND@plt>
movl   $0x0,-0x4(%rbp)
jmp    1149 <__fesetround+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fesetround>:
mov    %edi,%eax
and    $0xfffffffc,%eax
cmp    $0x80,%eax
jne    1128 <__fesetround+0x18>
push   %rax
call   1030 <_FPU_SETROUND@plt>
xor    %edi,%edi
add    $0x8,%rsp
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @__fesetround(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 130, label %5
i32 129, label %5
i32 131, label %5
i32 128, label %5
]
5: ; preds = %1, %1, %1, %1
%6 = load i32, i32* %3
%7 = call i32 @_FPU_SETROUND(i32 %6)
store i32 0, i32* %2
br label %10
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @__fesetround(i32 %0) {
%2 = and i32 %0, -4
%3 = icmp eq i32 %2, 128
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @_FPU_SETROUND(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ %0, %1 ]
ret i32 %7
}