xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ llog(int /*<<< orphan*/, char *, char *, int);
void xmalloc_fatal_default(char *errstr, int code, int size) {
  llog(0, "%s: failed to allocate %d bytes\n", errstr, size);
  exit(code);
}


x86 assembly (clang, -O0):
<xmalloc_fatal_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%ecx
xor    %edi,%edi
lea    0xebe(%rip),%rsi
call   1030 <llog@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc_fatal_default>:
push   %rbx
mov    %edx,%ecx
mov    %esi,%ebx
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
xor    %edi,%edi
call   1030 <llog@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"%s: failed to allocate %d bytes\0A\00"
define void @xmalloc_fatal_default(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = call i32 @llog(i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = load i32, i32* %5
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s: failed to allocate %d bytes\0A\00"
define void @xmalloc_fatal_default(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @llog(i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
scalar_t__ isalnum(unsigned char);
bool kcn_uri_str_isnormal(char c) {
  if (isalnum((unsigned char)c) || c == '.' || c == '-' || c == '_')
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<kcn_uri_str_isnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
jne    1158 <kcn_uri_str_isnormal+0x48>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
je     1158 <kcn_uri_str_isnormal+0x48>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     1158 <kcn_uri_str_isnormal+0x48>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
jne    1164 <kcn_uri_str_isnormal+0x54>
movl   $0x1,-0x4(%rbp)
jmp    116b <kcn_uri_str_isnormal+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcn_uri_str_isnormal>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112a <kcn_uri_str_isnormal+0x1a>
pop    %rbx
ret
add    $0xd3,%bl
cmp    $0x32,%bl
ja     1145 <kcn_uri_str_isnormal+0x35>
movzbl %bl,%ecx
movabs $0x4000000000003,%rdx
bt     %rcx,%rdx
jb     1128 <kcn_uri_str_isnormal+0x18>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @kcn_uri_str_isnormal(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalnum(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 46
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 95
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @kcn_uri_str_isnormal(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 zeroext %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
switch i8 %0, label %6 [
i8 95, label %7
i8 46, label %7
i8 45, label %7
]
6: ; preds = %5
br label %7
7: ; preds = %1, %5, %5, %5, %6
%8 = phi i32 [ 0, %6 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xc2() {
  Assert_real((iscntrl(194) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              975, ("iscntrl should be 0 for 0xc2"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xc2\00"
define void @t_iscntrl_0xc2() {
%1 = call i64 @iscntrl(i32 194)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 975, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xc2\00"
define void @t_iscntrl_0xc2() {
%1 = tail call i64 @iscntrl(i32 194)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 975, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int fp_msg(char *msg) {
  printf("%s", msg);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @fp_msg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *display;
};
struct TYPE_4__ {
  TYPE_1__ xnoexpose;
};
typedef TYPE_2__ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEvent_xnoexpose_display(void *_p, void *_v) {
  ((XEvent *)_p)->xnoexpose.display = (Display *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32* }
define void @set_XEvent_xnoexpose_display(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 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i32* %6, i32** %10
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xnoexpose_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
void out_long(long long a) {}


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

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

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

LLVM IR (-O2):
define void @out_long(i64 %0) {
ret void
}
/* Type definitions */
typedef int ulong;

/* Variables and functions */
ulong mul_ulong(ulong arg1, ulong arg2) { return arg1 * arg2; }


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

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

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

LLVM IR (-O2):
define i32 @mul_ulong(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
void fild_UsbStackInit(void) {}


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

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

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

LLVM IR (-O2):
define void @fild_UsbStackInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strlen(char *);
int main(void) {
  char mystring[255];
  scanf("%s", mystring);
  printf("%d\n", (int)strlen(mystring));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @strlen(i8* %2)
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int sysapi_get_mtu(char *);
int get_mtu(char *mtu_ifname) {
  int mtu = sysapi_get_mtu(mtu_ifname);
  if (mtu < 0) {
    printf("get mtu test fails\n");
    return -1;
  }
  printf("mtu %d\n", mtu);
  return 0;
}


x86 assembly (clang, -O0):
<get_mtu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <sysapi_get_mtu@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115c <get_mtu+0x3c>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <get_mtu+0x54>
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mtu>:
push   %rbx
call   1050 <sysapi_get_mtu@plt>
test   %eax,%eax
js     114e <get_mtu+0x1e>
lea    0xebf(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    115f <get_mtu+0x2f>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"get mtu test fails\0A\00"
@.str.1 = [8 x i8] c"mtu %d\0A\00"
define i32 @get_mtu(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @sysapi_get_mtu(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %12)
store i32 0, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"mtu %d\0A\00"
@str = [19 x i8] c"get mtu test fails\00"
define i32 @get_mtu(i8* %0) {
%2 = tail call i32 @sysapi_get_mtu(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strcasecmp(char *, char *);
void strcasecmp_diff_length_0() {
  char *x = "abcde";
  char *y = "aBd";
  clang_analyzer_eval(strcasecmp(x, y) < 0);
}


x86 assembly (clang, -O0):
<strcasecmp_diff_length_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasecmp_diff_length_0>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <strcasecmp@plt>
shr    $0x3f,%rax
mov    %eax,%edi
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [4 x i8] c"aBd\00"
define void @strcasecmp_diff_length_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strcasecmp(i8* %3, i8* %4)
%6 = icmp slt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [4 x i8] c"aBd\00"
define void @strcasecmp_diff_length_0() {
%1 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = lshr i64 %1, 63
%3 = trunc i64 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
void McASPTxRxClkSyncDisable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0xB0)))) |= (0x00000040u);
}


x86 assembly (clang, -O0):
<McASPTxRxClkSyncDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x40,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPTxRxClkSyncDisable>:
add    $0xb0,%edi
orl    $0x40,(%rdi)
ret

LLVM IR (-O0):
define void @McASPTxRxClkSyncDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 176
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 64
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @McASPTxRxClkSyncDisable(i32 %0) {
%2 = add i32 %0, 176
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 64
store volatile i32 %6, i32* %4
ret void
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int _buffer_write_array(struct ac_buffer *, int /*<<< orphan*/ *, int, int);
int buffer_write_int_array(struct ac_buffer *buffer, int32_t *value, int size) {
  return _buffer_write_array(buffer, value, size, sizeof(int));
}


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

x86 assembly (clang, -O2):
<buffer_write_int_array>:
mov    $0x4,%ecx
jmp    1030 <_buffer_write_array@plt>

LLVM IR (-O0):
%struct.ac_buffer = type { i32 }
define i32 @buffer_write_int_array(%struct.ac_buffer* %0, i32* %1, i32 %2) {
%4 = alloca %struct.ac_buffer*
%5 = alloca i32*
%6 = alloca i32
store %struct.ac_buffer* %0, %struct.ac_buffer** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load %struct.ac_buffer*, %struct.ac_buffer** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @_buffer_write_array(%struct.ac_buffer* %7, i32* %8, i32 %9, i32 4)
ret i32 %10
}

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_write_int_array(%struct.ac_buffer* %0, i32* %1, i32 %2) {
%4 = tail call i32 @_buffer_write_array(%struct.ac_buffer* %0, i32* %1, i32 %2, i32 4)
ret i32 %4
}
void TransposeWx8_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @TransposeWx8_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ uart_puts(char *);
void kernel_init(void) {
  uart_init();
  uart_puts("Hello, in kernel_init\r\n");
}


x86 assembly (clang, -O0):
<kernel_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uart_init@plt>
lea    0xece(%rip),%rdi
call   1040 <uart_puts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Hello, in kernel_init\0D\0A\00"
define void @kernel_init() {
%1 = call i32 (...) @uart_init()
%2 = call i32 @uart_puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Hello, in kernel_init\0D\0A\00"
define void @kernel_init() {
%1 = tail call i32 (...) @uart_init()
%2 = tail call i32 @uart_puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
typedef int /*<<< orphan*/ client_name;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct sockaddr_in client_name;
  int client_name_len = sizeof(client_name);
  printf("%d\n", client_name_len);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void SysCtlSleepPowerSet(uint32_t ui32Config) {
  (*((volatile uint32_t *)(0x400FE188))) = ui32Config;
}


x86 assembly (clang, -O0):
<SysCtlSleepPowerSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fe188,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlSleepPowerSet>:
mov    %edi,0x400fe188
ret

LLVM IR (-O0):
define void @SysCtlSleepPowerSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1074782600 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlSleepPowerSet(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1074782600 to i32*)
ret void
}
int mystrlen(const char *s) {
  int i = 0;
  while (*(s + i))
    i++;
  return i;
}


x86 assembly (clang, -O0):
<mystrlen>:
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 <mystrlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mystrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mystrlen(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 @mystrlen(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
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
struct TYPE_3__ {
  int /*<<< orphan*/ __sd;
};
typedef TYPE_1__ posix_spawnattr_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
int posix_spawnattr_setsigdefault(posix_spawnattr_t *attr,
                                  const sigset_t *sigdefault) {
  memcpy(&attr->__sd, sigdefault, sizeof(sigset_t));
  return 0;
}


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

x86 assembly (clang, -O2):
<posix_spawnattr_setsigdefault>:
push   %rax
mov    $0x4,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_setsigdefault(%struct.TYPE_3__* %0, i32* %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i32*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i32* %1, i32** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32*, i32** %4
%8 = call i32 @memcpy(i32* %6, i32* %7, i32 4)
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_setsigdefault(%struct.TYPE_3__* %0, i32* %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%4 = tail call i32 @memcpy(i32* %3, i32* %1, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void term_attr_reset() { fputs("\033[0m", stdout); }


x86 assembly (clang, -O0):
<term_attr_reset>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_attr_reset>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define void @term_attr_reset() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define void @term_attr_reset() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_allocation(char *, size_t, void *);
int /*<<< orphan*/ real_posix_memalign(void **, size_t, size_t);
int posix_memalign(void **memptr, size_t alignment, size_t size) {
  int ret;
  if (ret = !real_posix_memalign(memptr, alignment, size)) {
    log_allocation("posix_memalign", size, *memptr);
  }
  return ret;
}


x86 assembly (clang, -O0):
<posix_memalign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <real_posix_memalign@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x1c(%rbp)
test   $0x1,%al
jne    1165 <posix_memalign+0x45>
jmp    117c <posix_memalign+0x5c>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xe89(%rip),%rdi
call   1040 <log_allocation@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_memalign>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <real_posix_memalign@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1147 <posix_memalign+0x27>
mov    (%rbx),%rdx
lea    0xec1(%rip),%rdi
mov    %r14,%rsi
call   1040 <log_allocation@plt>
xor    %eax,%eax
test   %ebp,%ebp
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"posix_memalign\00"
define i32 @posix_memalign(i8** %0, i64 %1, i64 %2) {
%4 = tail call i32 @real_posix_memalign(i8** %0, i64 %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = tail call i32 @log_allocation(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %2, i8* %7)
br label %9
9: ; preds = %6, %3
%10 = zext i1 %5 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showinfo(void) { printf("\nnanoc <source>\n\n"); }


x86 assembly (clang, -O0):
<showinfo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"\0Ananoc <source>\0A\0A\00"
define void @showinfo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"\0Ananoc <source>\0A\00"
define void @showinfo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void mg_usleep(unsigned long usecs) { usleep(usecs); }


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

x86 assembly (clang, -O2):
<mg_usleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @mg_usleep(i64 %0) {
%2 = tail call i32 @usleep(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ pthread_self();
void task() { printf("Thread #%u working on task\n", (int)pthread_self()); }


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<task>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Thread #%u working on task\0A\00"
define void @task() {
%1 = call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Thread #%u working on task\0A\00"
define void @task() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t cu_PrevPos(uint8_t pos) {
  pos--;
  if ((pos & 0x80) != 0)
    pos = 0x077;
  else if ((pos & 0x08) != 0) {
    pos &= 0xf0;
    pos |= 0x07;
  }
  return pos;
}


x86 assembly (clang, -O0):
<cu_PrevPos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112d <cu_PrevPos+0x2d>
movl   $0x77,-0x4(%rbp)
jmp    1155 <cu_PrevPos+0x55>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1150 <cu_PrevPos+0x50>
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x7,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <cu_PrevPos+0x55>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cu_PrevPos>:
add    $0xffffffff,%edi
mov    $0x77,%eax
test   $0x80,%dil
jne    111f <cu_PrevPos+0x1f>
test   $0x8,%dil
je     111d <cu_PrevPos+0x1d>
and    $0xf0,%edi
or     $0x7,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @cu_PrevPos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 119, i32* %2
br label %19
9: ; preds = %1
%10 = load i32, i32* %2
%11 = and i32 %10, 8
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* %2
%15 = and i32 %14, 240
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = or i32 %16, 7
store i32 %17, i32* %2
br label %18
18: ; preds = %13, %9
br label %19
19: ; preds = %18, %8
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @cu_PrevPos(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = and i32 %2, 8
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = and i32 %2, 240
%10 = or i32 %9, 7
br label %11
11: ; preds = %1, %5, %8
%12 = phi i32 [ %10, %8 ], [ %2, %5 ], [ 119, %1 ]
ret i32 %12
}
/* Type definitions */
struct img_str {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ img_str_to_native(struct img_str *);
char *strchr(int /*<<< orphan*/, char);
char *img_strchr(struct img_str *str, char c) {
  return strchr(img_str_to_native(str), c);
}


x86 assembly (clang, -O0):
<img_strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <img_str_to_native@plt>
mov    %eax,%edi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<img_strchr>:
push   %rbx
mov    %esi,%ebx
call   1040 <img_str_to_native@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <strchr@plt>

LLVM IR (-O0):
%struct.img_str = type { i32 }
define i8* @img_strchr(%struct.img_str* %0, i8 signext %1) {
%3 = alloca %struct.img_str*
%4 = alloca i8
store %struct.img_str* %0, %struct.img_str** %3
store i8 %1, i8* %4
%5 = load %struct.img_str*, %struct.img_str** %3
%6 = call i32 @img_str_to_native(%struct.img_str* %5)
%7 = load i8, i8* %4
%8 = call i8* @strchr(i32 %6, i8 signext %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.img_str = type { i32 }
define i8* @img_strchr(%struct.img_str* %0, i8 signext %1) {
%3 = tail call i32 @img_str_to_native(%struct.img_str* %0)
%4 = tail call i8* @strchr(i32 %3, i8 signext %1)
ret i8* %4
}
void(devfs_remove)(char const *fmt, ...) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @devfs_remove(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_SendConsoleCommand(char *);
void CG_SqlMenu_f(void) { trap_SendConsoleCommand("ui_sqlmenu"); }


x86 assembly (clang, -O0):
<CG_SqlMenu_f>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_SendConsoleCommand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"ui_sqlmenu\00"
define void @CG_SqlMenu_f() {
%1 = call i32 @trap_SendConsoleCommand(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"ui_sqlmenu\00"
define void @CG_SqlMenu_f() {
%1 = tail call i32 @trap_SendConsoleCommand(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int do_peek(FILE *f) {
  int peekch;
  ungetc((peekch = getc(f)), f);
  return peekch;
}


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

x86 assembly (clang, -O2):
<do_peek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @do_peek(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @ungetc(i32 %5, i32* %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @do_peek(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @ungetc(i32 %2, i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int truncate(char *, int);
int main() {
  int ret;
  ret = truncate("./pirate.txt", 45);
  if (ret == -1) {
    perror("truncate");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x2d,%esi
call   1030 <truncate@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1165 <main+0x45>
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <main+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2d,%esi
call   1030 <truncate@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     113d <main+0x1d>
pop    %rcx
ret
lea    0xec9(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"./pirate.txt\00"
@.str.1 = [9 x i8] c"truncate\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @truncate(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 45)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"./pirate.txt\00"
@.str.1 = [9 x i8] c"truncate\00"
define i32 @main() {
%1 = tail call i32 @truncate(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 45)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %6
}
void DebugASOverWrite() {}


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

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

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

LLVM IR (-O2):
define void @DebugASOverWrite() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
int askCharQuestion(char *question) {
  char answer = 0;
  printf("%s\n> ", question);
  scanf(" %c", &answer);
  fflush(stdin);
  return answer;
}


x86 assembly (clang, -O0):
<askCharQuestion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<askCharQuestion>:
push   %rax
mov    %rdi,%rsi
movb   $0x0,0x7(%rsp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s\0A> \00"
@.str.1 = [4 x i8] c" %c\00"
@stdin = global i32 0
define i32 @askCharQuestion(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = load i32, i32* @stdin
%8 = call i32 @fflush(i32 %7)
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s\0A> \00"
@.str.1 = [4 x i8] c" %c\00"
@stdin = global i32 0
define i32 @askCharQuestion(i8* %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
ret i32 %8
}
int is_digit(char d) {
  if (d < '0' || d > '9')
    return (0);
  else
    return (1);
}


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

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(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 slt i32 %5, 48
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 0, i32* %2
br label %13
12: ; preds = %7
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char tt_getSep();
char *macttGetSep(char *arg) {
  *arg = tt_getSep();
  arg[1] = '\0';
  return arg;
}


x86 assembly (clang, -O0):
<macttGetSep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <tt_getSep@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttGetSep>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <tt_getSep@plt>
mov    %al,(%rbx)
movb   $0x0,0x1(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @macttGetSep(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call signext i8 (...) @tt_getSep()
%4 = load i8*, i8** %2
store i8 %3, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %6
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define i8* @macttGetSep(i8* returned writeonly %0) {
%2 = tail call signext i8 (...) @tt_getSep()
store i8 %2, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %3
ret i8* %0
}
int unreferenced(int i, int j) { return i - j; }


x86 assembly (clang, -O0):
<unreferenced>:
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):
<unreferenced>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @unreferenced(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 @unreferenced(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PlaySoundExt(int, int, int, int);
void PlaySoundMusic(int nr) {
  PlaySoundExt(nr, 128, (255 / 2), ((1 << 1) | (1 << 0)));
}


x86 assembly (clang, -O0):
<PlaySoundMusic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x80,%esi
mov    $0x7f,%edx
mov    $0x3,%ecx
call   1030 <PlaySoundExt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PlaySoundMusic>:
mov    $0x80,%esi
mov    $0x7f,%edx
mov    $0x3,%ecx
jmp    1030 <PlaySoundExt@plt>

LLVM IR (-O0):
define void @PlaySoundMusic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @PlaySoundExt(i32 %3, i32 128, i32 127, i32 3)
ret void
}

LLVM IR (-O2):
define void @PlaySoundMusic(i32 %0) {
%2 = tail call i32 @PlaySoundExt(i32 %0, i32 128, i32 127, i32 3)
ret void
}
/* Type definitions */
struct client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ NFS_MNT_VERSION;
int mount_call(int, int /*<<< orphan*/, char const *, struct client *);
int umount_v2(const char *path, struct client *clnt) {
  return mount_call(3, NFS_MNT_VERSION, path, clnt);
}


x86 assembly (clang, -O0):
<umount_v2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x3,%edi
call   1030 <mount_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umount_v2>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    $0x3,%edi
jmp    1030 <mount_call@plt>

LLVM IR (-O0):
%struct.client = type { i32 }
@NFS_MNT_VERSION = global i32 0
define i32 @umount_v2(i8* %0, %struct.client* %1) {
%3 = alloca i8*
%4 = alloca %struct.client*
store i8* %0, i8** %3
store %struct.client* %1, %struct.client** %4
%5 = load i32, i32* @NFS_MNT_VERSION
%6 = load i8*, i8** %3
%7 = load %struct.client*, %struct.client** %4
%8 = call i32 @mount_call(i32 3, i32 %5, i8* %6, %struct.client* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.client = type { i32 }
@NFS_MNT_VERSION = global i32 0
define i32 @umount_v2(i8* %0, %struct.client* %1) {
%3 = load i32, i32* @NFS_MNT_VERSION
%4 = tail call i32 @mount_call(i32 3, i32 %3, i8* %0, %struct.client* %1)
ret i32 %4
}
double max1(double a, double b, double c) {
  if (a < b)
    a = b;
  if (a < c)
    a = c;
  return a;
}


x86 assembly (clang, -O0):
<max1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <max1+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114f <max1+0x4f>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max1>:
maxsd  %xmm0,%xmm1
maxsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @max1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
store double %11, double* %4
br label %12
12: ; preds = %10, %3
%13 = load double, double* %4
%14 = load double, double* %6
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load double, double* %6
store double %17, double* %4
br label %18
18: ; preds = %16, %12
%19 = load double, double* %4
ret double %19
}

LLVM IR (-O2):
define double @max1(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = select i1 %4, double %1, double %0
%6 = fcmp olt double %5, %2
%7 = select i1 %6, double %2, double %5
ret double %7
}