xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int die(const char *msg) {
  printf("Fatal error: %s", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Fatal error: %s\00"
@EXIT_FAILURE = global i32 0
define i32 @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Fatal error: %s\00"
@EXIT_FAILURE = global i32 0
define i32 @die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ stdout;
void output_color(uint32_t color) {
  uint8_t red = (color & 0x00ff0000) >> 16;
  uint8_t green = (color & 0x0000ff00) >> 8;
  uint8_t blue = color & 0x000000ff;
  fprintf(stdout, "#%02x%02x%02x\n", red & 0xff, green & 0xff, blue & 0xff);
}


x86 assembly (clang, -O0):
<output_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
and    $0xff,%edx
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%r8d
and    $0xff,%r8d
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_color>:
mov    %edi,%eax
movzbl %ah,%ecx
movzbl %al,%r8d
shr    $0x10,%eax
movzbl %al,%edx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [15 x i8] c"#%02x%02x%02x\0A\00"
define void @output_color(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = ashr i32 %7, 16
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = and i32 %12, 255
store i32 %13, i32* %5
%14 = load i32, i32* @stdout
%15 = load i32, i32* %3
%16 = and i32 %15, 255
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = load i32, i32* %5
%20 = and i32 %19, 255
%21 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %18, i32 %20)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [15 x i8] c"#%02x%02x%02x\0A\00"
define void @output_color(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = and i32 %0, 255
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_hydorder(int, char **);
int main(int argc, char *argv[]) {
  gmx_hydorder(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_hydorder(i32 %0, i8** %1)
ret i32 0
}
int iswhite(char c) {
  if (c == ' ')
    return (1);
  if (c == '\t')
    return (1);
  if (c == '\v')
    return (1);
  if (c == '\r')
    return (1);
  if (c == '\n')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1123 <iswhite+0x23>
movl   $0x1,-0x4(%rbp)
jmp    118e <iswhite+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    113c <iswhite+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    118e <iswhite+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0xb,%eax
jne    1155 <iswhite+0x55>
movl   $0x1,-0x4(%rbp)
jmp    118e <iswhite+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
jne    116e <iswhite+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    118e <iswhite+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1187 <iswhite+0x87>
movl   $0x1,-0x4(%rbp)
jmp    118e <iswhite+0x8e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhite>:
cmp    $0x20,%dil
ja     1120 <iswhite+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002e00,%rdx
bt     %rcx,%rdx
jae    1120 <iswhite+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iswhite(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 eq i32 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %29
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 9
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %29
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 11
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %2
br label %29
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 13
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %2
br label %29
23: ; preds = %18
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 10
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27, %22, %17, %12, %7
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @iswhite(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 9, label %3
i8 11, label %3
i8 13, label %3
i8 10, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  unsigned long long a = 3;
  a <<= 33;
  a |= 6;
  assert((a & 4294967295U) == 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x3,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x21,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0x6,%rax
mov    %rax,-0x10(%rbp)
movabs $0xffffffff,%rax
and    -0x10(%rbp),%rax
cmp    $0x6,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 3, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 33
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = or i64 %5, 6
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = and i64 %7, 4294967295
%9 = icmp eq i64 %8, 6
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
void xprintf(char *format, ...) {
  printf("arg0  = %p\n", &format);
  printf("format= %p\n", format);
  printf("sc    = %#x\n", getenv("sc"));
}


x86 assembly (clang, -O0):
<xprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x9(%rbp)
lea    -0x8(%rbp),%rsi
call   1040 <printf@plt>
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%esi
mov    -0x9(%rbp),%al
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xprintf>:
push   %rax
mov    %rdi,(%rsp)
lea    0xed4(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%rsi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <getenv@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"arg0 = %p\0A\00"
@.str.1 = [12 x i8] c"format= %p\0A\00"
@.str.2 = [13 x i8] c"sc = %#x\0A\00"
@.str.3 = [3 x i8] c"sc\00"
define void @xprintf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2)
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"arg0 = %p\0A\00"
@.str.1 = [12 x i8] c"format= %p\0A\00"
@.str.2 = [13 x i8] c"sc = %#x\0A\00"
@.str.3 = [3 x i8] c"sc\00"
define void @xprintf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2)
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hgoto(int /*<<< orphan*/);
int /*<<< orphan*/ vgoto(int /*<<< orphan*/);
int /*<<< orphan*/ xconv(double);
int /*<<< orphan*/ yconv(double);
void move(double x, double y) {
  hgoto(xconv(x));
  vgoto(yconv(y));
}


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <xconv@plt>
mov    %eax,%edi
call   1040 <hgoto@plt>
movsd  -0x10(%rbp),%xmm0
call   1060 <yconv@plt>
mov    %eax,%edi
call   1050 <vgoto@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <xconv@plt>
mov    %eax,%edi
call   1040 <hgoto@plt>
movsd  (%rsp),%xmm0
call   1060 <yconv@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <vgoto@plt>

LLVM IR (-O0):
define void @move(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i32 @xconv(double %5)
%7 = call i32 @hgoto(i32 %6)
%8 = load double, double* %4
%9 = call i32 @yconv(double %8)
%10 = call i32 @vgoto(i32 %9)
ret void
}

LLVM IR (-O2):
define void @move(double %0, double %1) {
%3 = tail call i32 @xconv(double %0)
%4 = tail call i32 @hgoto(i32 %3)
%5 = tail call i32 @yconv(double %1)
%6 = tail call i32 @vgoto(i32 %5)
ret void
}
int fun923() { return 923; }


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

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

LLVM IR (-O0):
define i32 @fun923() {
ret i32 923
}

LLVM IR (-O2):
define i32 @fun923() {
ret i32 923
}
int encoder_run(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @encoder_run() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @encoder_run() {
ret i32 -1
}
/* Type definitions */
struct rtattr {
  int dummy;
};
struct qdisc_util {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int hfsc_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) {
  return -1;
}


x86 assembly (clang, -O0):
<hfsc_print_xstats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @hfsc_print_xstats(%struct.qdisc_util* %0, i32* %1, %struct.rtattr* %2) {
%4 = alloca %struct.qdisc_util*
%5 = alloca i32*
%6 = alloca %struct.rtattr*
store %struct.qdisc_util* %0, %struct.qdisc_util** %4
store i32* %1, i32** %5
store %struct.rtattr* %2, %struct.rtattr** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @hfsc_print_xstats(%struct.qdisc_util* nocapture readnone %0, i32* nocapture readnone %1, %struct.rtattr* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int SerialAPI_request(unsigned char *, int);
int ZW_GetSUCNodeID() {
  unsigned char buf[255];
  buf[0] = 0x00;
  buf[1] = 0x56;
  return SerialAPI_request(buf, 2);
}


x86 assembly (clang, -O0):
<ZW_GetSUCNodeID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movb   $0x0,-0x100(%rbp)
movb   $0x56,-0xff(%rbp)
lea    -0x100(%rbp),%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZW_GetSUCNodeID>:
sub    $0x108,%rsp
movw   $0x5600,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @ZW_GetSUCNodeID() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 1
store i8 86, i8* %3
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%5 = call i32 @SerialAPI_request(i8* %4, i32 2)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ZW_GetSUCNodeID() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 1
store i8 86, i8* %3
%4 = call i32 @SerialAPI_request(i8* %2, i32 2)
ret i32 %4
}
/* Variables and functions */
int wwviaudio_add_sound_to_slot(int, int /*<<< orphan*/);
int wwviaudio_play_music(int which_sound) {
  return wwviaudio_add_sound_to_slot(which_sound, (0));
}


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

x86 assembly (clang, -O2):
<wwviaudio_play_music>:
xor    %esi,%esi
jmp    1030 <wwviaudio_add_sound_to_slot@plt>

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

LLVM IR (-O2):
define i32 @wwviaudio_play_music(i32 %0) {
%2 = tail call i32 @wwviaudio_add_sound_to_slot(i32 %0, i32 0)
ret i32 %2
}
void hisi_lowmem_dbg(short oom_score_adj) {}


x86 assembly (clang, -O0):
<hisi_lowmem_dbg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @hisi_lowmem_dbg(i16 signext %0) {
ret void
}
void foo18() {}


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

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

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

LLVM IR (-O2):
define void @foo18() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ev3_uninit();
void brick_uninit(void) { ev3_uninit(); }


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

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

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

LLVM IR (-O2):
define void @brick_uninit() {
%1 = tail call i32 (...) @ev3_uninit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("foll-exec is about to execl(crashme)...\n");
  execl("gdb.multi/crashme", "gdb.multi/crashme", (char *)0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1040 <execl@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1040 <execl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"foll-exec is about to execl(crashme)...\0A\00"
@.str.1 = [18 x i8] c"gdb.multi/crashme\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @execl(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* null)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"gdb.multi/crashme\00"
@str = [40 x i8] c"foll-exec is about to execl(crashme)...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @execl(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ chDbgCheckClassS();
scalar_t__ chSchCanYieldS();
int /*<<< orphan*/ chSchDoRescheduleBehind();
void chSchDoYieldS(void) {
  chDbgCheckClassS();
  if (chSchCanYieldS())
    chSchDoRescheduleBehind();
}


x86 assembly (clang, -O0):
<chSchDoYieldS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <chDbgCheckClassS@plt>
mov    $0x0,%al
call   1040 <chSchCanYieldS@plt>
cmp    $0x0,%rax
je     1153 <chSchDoYieldS+0x23>
mov    $0x0,%al
call   1050 <chSchDoRescheduleBehind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chSchDoYieldS>:
push   %rax
xor    %eax,%eax
call   1030 <chDbgCheckClassS@plt>
xor    %eax,%eax
call   1040 <chSchCanYieldS@plt>
test   %rax,%rax
je     114c <chSchDoYieldS+0x1c>
xor    %eax,%eax
pop    %rcx
jmp    1050 <chSchDoRescheduleBehind@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @chSchDoYieldS() {
%1 = call i32 (...) @chDbgCheckClassS()
%2 = call i64 (...) @chSchCanYieldS()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @chSchDoRescheduleBehind()
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @chSchDoYieldS() {
%1 = tail call i32 (...) @chDbgCheckClassS()
%2 = tail call i64 (...) @chSchCanYieldS()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @chSchDoRescheduleBehind()
br label %6
6: ; preds = %4, %0
ret void
}
/* Type definitions */
struct node_description {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dss_adsrenv_step(struct node_description *);
void dss_adsrenv_reset(struct node_description *node) {
  dss_adsrenv_step(node);
}


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

x86 assembly (clang, -O2):
<dss_adsrenv_reset>:
jmp    1030 <dss_adsrenv_step@plt>

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

LLVM IR (-O2):
%struct.node_description = type { i32 }
define void @dss_adsrenv_reset(%struct.node_description* %0) {
%2 = tail call i32 @dss_adsrenv_step(%struct.node_description* %0)
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll12(struct __test_metadata *);
void wrapper_epoll12(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll12(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll12>:
jmp    1030 <epoll12@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll12(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll12(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll12(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll12(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
float sqrtf(float);
float GetRaySpat(float x, float y) { return sqrtf((x * x) + (y * y)); }


x86 assembly (clang, -O0):
<GetRaySpat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRaySpat>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <GetRaySpat+0x19>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @GetRaySpat(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = call float @llvm.fmuladd.f32(float %5, float %6, float %9)
%11 = call float @sqrtf(float %10)
ret float %11
}

LLVM IR (-O2):
define float @GetRaySpat(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call float @sqrtf(float %4)
ret float %5
}
/* Variables and functions */
int func_str();
int main(int argc, char *argv[]) {
  int ret = func_str();
  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)
mov    $0x0,%al
call   1030 <func_str@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func_str()
ret i32 0
}
/* Variables and functions */
char *stb_strtok_raw(char *, char *, char *, int, int /*<<< orphan*/);
char *stb_strtok_keep(char *output, char *src, char *delimit) {
  return stb_strtok_raw(output, src, delimit, 1, 0);
}


x86 assembly (clang, -O0):
<stb_strtok_keep>:
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
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <stb_strtok_raw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_strtok_keep>:
mov    $0x1,%ecx
xor    %r8d,%r8d
jmp    1030 <stb_strtok_raw@plt>

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

LLVM IR (-O2):
define i8* @stb_strtok_keep(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @stb_strtok_raw(i8* %0, i8* %1, i8* %2, i32 1, i32 0)
ret i8* %4
}
unsigned long ordered_fuse(unsigned p1, unsigned p2) {
  return p1 < p2 ? (unsigned long)p1 << 16 ^ p2 : (unsigned long)p2 << 16 ^ p1;
}


x86 assembly (clang, -O0):
<ordered_fuse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    112c <ordered_fuse+0x2c>
mov    -0x4(%rbp),%eax
shl    $0x10,%rax
mov    -0x8(%rbp),%ecx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    113d <ordered_fuse+0x3d>
mov    -0x8(%rbp),%eax
shl    $0x10,%rax
mov    -0x4(%rbp),%ecx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordered_fuse>:
mov    %edi,%ecx
mov    %rcx,%rdx
shl    $0x10,%rdx
mov    %esi,%eax
xor    %rax,%rdx
shl    $0x10,%rax
xor    %rcx,%rax
cmp    %esi,%edi
cmovb  %rdx,%rax
ret

LLVM IR (-O0):
define i64 @ordered_fuse(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 = icmp ult i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 16
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = xor i64 %11, %13
br label %22
15: ; preds = %2
%16 = load i32, i32* %4
%17 = zext i32 %16 to i64
%18 = shl i64 %17, 16
%19 = load i32, i32* %3
%20 = zext i32 %19 to i64
%21 = xor i64 %18, %20
br label %22
22: ; preds = %15, %8
%23 = phi i64 [ %14, %8 ], [ %21, %15 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @ordered_fuse(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = zext i32 %0 to i64
%5 = shl nuw nsw i64 %4, 16
%6 = zext i32 %1 to i64
%7 = xor i64 %5, %6
%8 = shl nuw nsw i64 %6, 16
%9 = xor i64 %8, %4
%10 = select i1 %3, i64 %7, i64 %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stars();
int /*<<< orphan*/ stors();
main() {
  printf("Before function call\n");
  stars();
  printf("\nAfter function call\n");
  stors();
  printf("\nAfter another function call\n");
  stars();
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <stars@plt>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <stors@plt>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <stars@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <stars@plt>
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <stors@plt>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <stars@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Before function call\0A\00"
@.str.1 = [22 x i8] c"\0AAfter function call\0A\00"
@.str.2 = [30 x i8] c"\0AAfter another function call\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @stars()
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @stors()
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (...) @stars()
%7 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Before function call\00"
@str.3 = [21 x i8] c"\0AAfter function call\00"
@str.4 = [29 x i8] c"\0AAfter another function call\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @stars()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (...) @stors()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 (...) @stars()
%7 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main() {
  printf("Hello, world!");
  int num_apples = 5;
  printf("I have %d apples\n", num_apples);
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [18 x i8] c"I have %d apples\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 5, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [18 x i8] c"I have %d apples\0A\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_u8(int, int, int);
void ADXL345_init(int fd) {
  write_u8(fd, 0x31, 0x0B);
  write_u8(fd, 0x2D, 0x08);
}


x86 assembly (clang, -O0):
<ADXL345_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x31,%esi
mov    $0xb,%edx
call   1030 <write_u8@plt>
mov    -0x4(%rbp),%edi
mov    $0x2d,%esi
mov    $0x8,%edx
call   1030 <write_u8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADXL345_init>:
push   %rbx
mov    %edi,%ebx
mov    $0x31,%esi
mov    $0xb,%edx
call   1030 <write_u8@plt>
mov    %ebx,%edi
mov    $0x2d,%esi
mov    $0x8,%edx
pop    %rbx
jmp    1030 <write_u8@plt>

LLVM IR (-O0):
define void @ADXL345_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write_u8(i32 %3, i32 49, i32 11)
%5 = load i32, i32* %2
%6 = call i32 @write_u8(i32 %5, i32 45, i32 8)
ret void
}

LLVM IR (-O2):
define void @ADXL345_init(i32 %0) {
%2 = tail call i32 @write_u8(i32 %0, i32 49, i32 11)
%3 = tail call i32 @write_u8(i32 %0, i32 45, i32 8)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *filepath) {
  int ret = 0;
  struct stat buffer;
  if (stat(filepath, &buffer) == 0) {
    ret = 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1141 <file_exists+0x31>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
size_t len_uleb128(unsigned long n) {
  static unsigned char b[32];
  size_t i;
  i = 0;
  do {
    b[i] = n & 0x7F;
    if (n >>= 7)
      b[i] |= 0x80;
  } while (b[i++] & 0x80);
  return i;
}


x86 assembly (clang, -O0):
<len_uleb128>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7f,%rax
mov    %al,%dl
mov    -0x10(%rbp),%rcx
lea    0x2f0b(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
shr    $0x7,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     115e <len_uleb128+0x5e>
mov    -0x10(%rbp),%rcx
lea    0x2ee7(%rip),%rax
movzbl (%rax,%rcx,1),%eax
or     $0x80,%eax
mov    %al,%dl
lea    0x2ed5(%rip),%rax
mov    %dl,(%rax,%rcx,1)
jmp    1163 <len_uleb128+0x63>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
lea    0x2eb7(%rip),%rax
movzbl (%rax,%rcx,1),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1110 <len_uleb128+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len_uleb128>:
xor    %eax,%eax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
nop
shr    $0x7,%rcx
add    $0x1,%rax
cmp    $0x7f,%rdi
mov    %rcx,%rdi
ja     1110 <len_uleb128+0x10>
ret

LLVM IR (-O0):
@len_uleb128.b = internal global [32 x i8] zeroinitializer
define i64 @len_uleb128(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %21, %1
%5 = load i64, i64* %2
%6 = and i64 %5, 127
%7 = trunc i64 %6 to i8
%8 = load i64, i64* %3
%9 = getelementptr inbounds [32 x i8], [32 x i8]* @len_uleb128.b, i64 0, i64 %8
store i8 %7, i8* %9
%10 = load i64, i64* %2
%11 = lshr i64 %10, 7
store i64 %11, i64* %2
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %4
%14 = load i64, i64* %3
%15 = getelementptr inbounds [32 x i8], [32 x i8]* @len_uleb128.b, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %17, 128
%19 = trunc i32 %18 to i8
store i8 %19, i8* %15
br label %20
20: ; preds = %13, %4
br label %21
21: ; preds = %20
%22 = load i64, i64* %3
%23 = add i64 %22, 1
store i64 %23, i64* %3
%24 = getelementptr inbounds [32 x i8], [32 x i8]* @len_uleb128.b, i64 0, i64 %22
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = and i32 %26, 128
%28 = icmp ne i32 %27, 0
br i1 %28, label %4, label %29
29: ; preds = %21
%30 = load i64, i64* %3
ret i64 %30
}

LLVM IR (-O2):
define i64 @len_uleb128(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %5, %2 ]
%4 = phi i64 [ 0, %1 ], [ %7, %2 ]
%5 = lshr i64 %3, 7
%6 = icmp ult i64 %3, 128
%7 = add nuw nsw i64 %4, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %7
}
int fchown(int filedes, int owner, int group) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return -1;
}


x86 assembly (clang, -O0):
<fchown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %edi,%edi
lea    0xed6(%rip),%rsi
lea    0xee1(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1138 <fchown+0x28>

x86 assembly (clang, -O2):
<fchown>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <fchown+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.fchown = [7 x i8] c"fchown\00"
define i32 @fchown(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.fchown, i64 0, i64 0))
br label %8
8: ; preds = %3, %8
br label %8
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.fchown = [7 x i8] c"fchown\00"
define i32 @fchown(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.fchown, i64 0, i64 0))
br label %5
5: ; preds = %3, %5
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int *array, int arrSize) {
  for (int i = 0; i < arrSize; i++) {
    printf("%d ", *(array + i));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
void tx(char c) {
  while ((((unsigned int volatile *)0xd4018000)[5] & 0x20) == 0)
    ;
  ((unsigned int volatile *)0xd4018000)[0] = (unsigned int)c;
}


x86 assembly (clang, -O0):
<tx>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xd4018000,%eax
mov    0x14(%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1123 <tx+0x23>
jmp    110a <tx+0xa>
movsbl -0x1(%rbp),%ecx
mov    $0xd4018000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx>:
mov    $0xd4018000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x20,0x14(%rax)
je     1110 <tx+0x10>
movsbl %dil,%ecx
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
define void @tx(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i32, i32* getelementptr inbounds (i32, i32* inttoptr (i64 3556868096 to i32*), i64 5)
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
store volatile i32 %10, i32* inttoptr (i64 3556868096 to i32*)
ret void
}

LLVM IR (-O2):
define void @tx(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 3556868116 to i32*)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = sext i8 %0 to i32
store volatile i32 %7, i32* inttoptr (i64 3556868096 to i32*)
ret void
}
int library_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @library_shutdown() {
ret i32 0
}
void TM16_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @TM16_intr() {
ret void
}
/* Variables and functions */
int getpgid(int /*<<< orphan*/);
int tcgetpgrp(int);
int is_foreground_fd(int fd) {
  int tpgrp = tcgetpgrp(fd);
  return tpgrp < 0 || tpgrp == getpgid(0);
}


x86 assembly (clang, -O0):
<is_foreground_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tcgetpgrp@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     115f <is_foreground_fd+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %edi,%edi
call   1040 <getpgid@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_foreground_fd>:
push   %rbx
call   1030 <tcgetpgrp@plt>
test   %eax,%eax
js     113e <is_foreground_fd+0x1e>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <getpgid@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%ebx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_foreground_fd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @tcgetpgrp(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @getpgid(i32 0)
%11 = icmp eq i32 %9, %10
br label %12
12: ; preds = %8, %1
%13 = phi i1 [ true, %1 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_foreground_fd(i32 %0) {
%2 = tail call i32 @tcgetpgrp(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @getpgid(i32 0)
%6 = icmp eq i32 %2, %5
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("size : %lu\n", sizeof(unsigned char));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x1,%esi
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    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"size : %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
int pagecache_trace_init_sysfs(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @pagecache_trace_init_sysfs(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ __pgrp;
};
typedef TYPE_1__ posix_spawnattr_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int posix_spawnattr_setpgroup(posix_spawnattr_t *attr, pid_t pgrp) {
  attr->__pgrp = pgrp;
  return 0;
}


x86 assembly (clang, -O0):
<posix_spawnattr_setpgroup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_setpgroup(%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 i32, i32* %4
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
store i32 %5, i32* %7
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_setpgroup(%struct.TYPE_3__* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i32 %1, i32* %3
ret i32 0
}