xunge/DecIR huggingface dataset:
int param_set_ushort(const char *val, struct kernel_param *kp) { return 0; }


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

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

LLVM IR (-O0):
%struct.kernel_param = type opaque
define i32 @param_set_ushort(i8* %0, %struct.kernel_param* %1) {
%3 = alloca i8*
%4 = alloca %struct.kernel_param*
store i8* %0, i8** %3
store %struct.kernel_param* %1, %struct.kernel_param** %4
ret i32 0
}

LLVM IR (-O2):
%struct.kernel_param = type opaque
define i32 @param_set_ushort(i8* nocapture readnone %0, %struct.kernel_param* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int int32_t;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int BIO_tell(int /*<<< orphan*/ *);
int32_t BioTell(BIO *bio) {
  if (!bio) {
    return -1;
  }
  return BIO_tell(bio);
}


x86 assembly (clang, -O0):
<BioTell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <BioTell+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <BioTell+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <BIO_tell@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BioTell>:
test   %rdi,%rdi
je     111a <BioTell+0xa>
jmp    1030 <BIO_tell@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @BioTell(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = call i32 @BIO_tell(i32* %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @BioTell(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @BIO_tell(i32* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
int test_imm_F3uint8_mem(unsigned char *val) {
  return ((*val) & (0xF3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F3uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -13
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct nlmsg {
  int dummy;
};

/* Variables and functions */
int nla_put(struct nlmsg *, int, int /*<<< orphan*/ *, int /*<<< orphan*/);
extern int nla_put_attr(struct nlmsg *nlmsg, int attr) {
  return nla_put(nlmsg, attr, NULL, 0);
}


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

x86 assembly (clang, -O2):
<nla_put_attr>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <nla_put@plt>

LLVM IR (-O0):
%struct.nlmsg = type { i32 }
define i32 @nla_put_attr(%struct.nlmsg* %0, i32 %1) {
%3 = alloca %struct.nlmsg*
%4 = alloca i32
store %struct.nlmsg* %0, %struct.nlmsg** %3
store i32 %1, i32* %4
%5 = load %struct.nlmsg*, %struct.nlmsg** %3
%6 = load i32, i32* %4
%7 = call i32 @nla_put(%struct.nlmsg* %5, i32 %6, i32* null, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.nlmsg = type { i32 }
define i32 @nla_put_attr(%struct.nlmsg* %0, i32 %1) {
%3 = tail call i32 @nla_put(%struct.nlmsg* %0, i32 %1, i32* null, i32 0)
ret i32 %3
}
void varrec_(npix, nrast, ifpix, ilpix, ifrast, ilrast) int *npix, *nrast;
int *ifpix, *ilpix, *ifrast, *ilrast;
{ variable_rectangle(*npix, *nrast, ifpix, ilpix, ifrast, ilrast); }


x86 assembly (clang, -O0):
<varrec_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    $0x0,%al
call   1030 <variable_rectangle@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varrec_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
xor    %eax,%eax
jmp    1030 <variable_rectangle@plt>

LLVM IR (-O0):
define void @varrec_(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32*, i32** %10
%19 = load i32*, i32** %11
%20 = load i32*, i32** %12
%21 = call i32 (i32, i32, i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @variable_rectangle to i32 (i32, i32, i32*, i32*, i32*, i32*, ...)*)(i32 %14, i32 %16, i32* %17, i32* %18, i32* %19, i32* %20)
ret void
}

LLVM IR (-O2):
define void @varrec_(i32* nocapture %0, i32* nocapture %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = tail call i32 (i32, i32, i32*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @variable_rectangle to i32 (i32, i32, i32*, i32*, i32*, i32*, ...)*)(i32 %7, i32 %8, i32* %2, i32* %3, i32* %4, i32* %5)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ perror(char *);
void safe_fstat(int fd, struct stat *buf) {
  if (fstat(fd, buf) != 0) {
    perror("fstat()");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<safe_fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <fstat@plt>
cmp    $0x0,%rax
je     116b <safe_fstat+0x3b>
lea    0xea4(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fstat>:
push   %rax
call   1050 <fstat@plt>
test   %rax,%rax
jne    113d <safe_fstat+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [8 x i8] c"fstat()\00"
define void @safe_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i64 @fstat(i32 %5, %struct.stat* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [8 x i8] c"fstat()\00"
define void @safe_fstat(i32 %0, %struct.stat* nocapture %1) {
%3 = tail call i64 @fstat(i32 %0, %struct.stat* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret void
}
unsigned int utf8_seqlen(long codepoint) {
  if (codepoint < 0x0000080)
    return 1;
  if (codepoint < 0x0000800)
    return 2;
  if (codepoint < 0x0010000)
    return 3;
  if (codepoint < 0x0200000)
    return 4;
  if (codepoint < 0x4000000)
    return 5;
  return 6;
}


x86 assembly (clang, -O0):
<utf8_seqlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x80,-0x10(%rbp)
jge    1122 <utf8_seqlen+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1191 <utf8_seqlen+0x91>
cmpq   $0x800,-0x10(%rbp)
jge    113c <utf8_seqlen+0x3c>
movl   $0x2,-0x4(%rbp)
jmp    1191 <utf8_seqlen+0x91>
cmpq   $0x10000,-0x10(%rbp)
jge    1156 <utf8_seqlen+0x56>
movl   $0x3,-0x4(%rbp)
jmp    1191 <utf8_seqlen+0x91>
cmpq   $0x200000,-0x10(%rbp)
jge    1170 <utf8_seqlen+0x70>
movl   $0x4,-0x4(%rbp)
jmp    1191 <utf8_seqlen+0x91>
cmpq   $0x4000000,-0x10(%rbp)
04
jge    118a <utf8_seqlen+0x8a>
movl   $0x5,-0x4(%rbp)
jmp    1191 <utf8_seqlen+0x91>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_seqlen>:
mov    $0x1,%eax
cmp    $0x80,%rdi
jl     1147 <utf8_seqlen+0x47>
mov    $0x2,%eax
cmp    $0x800,%rdi
jb     1147 <utf8_seqlen+0x47>
mov    $0x3,%eax
cmp    $0x10000,%rdi
jb     1147 <utf8_seqlen+0x47>
mov    $0x4,%eax
cmp    $0x200000,%rdi
jb     1147 <utf8_seqlen+0x47>
cmp    $0x4000000,%rdi
mov    $0x6,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @utf8_seqlen(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %24
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp slt i64 %8, 2048
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %24
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp slt i64 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %24
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp slt i64 %16, 2097152
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %24
19: ; preds = %15
%20 = load i64, i64* %3
%21 = icmp slt i64 %20, 67108864
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 5, i32* %2
br label %24
23: ; preds = %19
store i32 6, i32* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @utf8_seqlen(i64 %0) {
%2 = icmp slt i64 %0, 128
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 2048
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 65536
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i64 %0, 2097152
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i64 %0, 67108864
%11 = select i1 %10, i32 5, i32 6
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ 4, %7 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
bool check_broadcom_pin(int broadcom_number) {
  if (broadcom_number <= 53 && broadcom_number >= 0) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<check_broadcom_pin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x35,-0x8(%rbp)
jg     1127 <check_broadcom_pin+0x27>
cmpl   $0x0,-0x8(%rbp)
jl     1127 <check_broadcom_pin+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <check_broadcom_pin+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_broadcom_pin>:
xor    %eax,%eax
cmp    $0x36,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @check_broadcom_pin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 53
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @check_broadcom_pin(i32 %0) {
%2 = icmp ult i32 %0, 54
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ raw_irqs_disabled_flags(unsigned long);
int /*<<< orphan*/ trace_hardirqs_off();
int /*<<< orphan*/ trace_hardirqs_on();
void trace_hardirqs_fixup_flags(unsigned long flags) {
  if (raw_irqs_disabled_flags(flags))
    trace_hardirqs_off();
  else
    trace_hardirqs_on();
}


x86 assembly (clang, -O0):
<trace_hardirqs_fixup_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <raw_irqs_disabled_flags@plt>
cmp    $0x0,%rax
je     115b <trace_hardirqs_fixup_flags+0x2b>
mov    $0x0,%al
call   1030 <trace_hardirqs_off@plt>
jmp    1162 <trace_hardirqs_fixup_flags+0x32>
mov    $0x0,%al
call   1040 <trace_hardirqs_on@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_hardirqs_fixup_flags>:
push   %rax
call   1050 <raw_irqs_disabled_flags@plt>
test   %rax,%rax
je     1143 <trace_hardirqs_fixup_flags+0x13>
xor    %eax,%eax
pop    %rcx
jmp    1030 <trace_hardirqs_off@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <trace_hardirqs_on@plt>

LLVM IR (-O0):
define void @trace_hardirqs_fixup_flags(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @raw_irqs_disabled_flags(i64 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @trace_hardirqs_off()
br label %10
8: ; preds = %1
%9 = call i32 (...) @trace_hardirqs_on()
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @trace_hardirqs_fixup_flags(i64 %0) {
%2 = tail call i64 @raw_irqs_disabled_flags(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @trace_hardirqs_off()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @trace_hardirqs_on()
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FatalErrnoError(int, int, char *);
int chroot(char const *);
void Echroot(char const path[]) {
  FatalErrnoError(chroot(path) == -1, 1, "chroot()");
}


x86 assembly (clang, -O0):
<Echroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chroot@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x1,%esi
lea    0xeb4(%rip),%rdx
call   1040 <FatalErrnoError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Echroot>:
push   %rax
call   1030 <chroot@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
lea    0xeca(%rip),%rdx
mov    $0x1,%esi
pop    %rax
jmp    1040 <FatalErrnoError@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"chroot()\00"
define void @Echroot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @chroot(i8* %3)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @FatalErrnoError(i32 %6, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"chroot()\00"
define void @Echroot(i8* %0) {
%2 = tail call i32 @chroot(i8* %0)
%3 = icmp eq i32 %2, -1
%4 = zext i1 %3 to i32
%5 = tail call i32 @FatalErrnoError(i32 %4, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
int isascii(int c) { return !(c & ~0x7F); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -128
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long inl(long);
long plfetch(long port) { return inl(port); }


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

x86 assembly (clang, -O2):
<plfetch>:
jmp    1030 <inl@plt>

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

LLVM IR (-O2):
define i64 @plfetch(i64 %0) {
%2 = tail call i64 @inl(i64 %0)
ret i64 %2
}
_Complex float f2(float x, float y) { return (_Complex float){x, y}; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
unpcklps %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @f2(float %0, float %1) {
%3 = alloca { float, float }
%4 = alloca float
%5 = alloca float
%6 = alloca { float, float }
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %4
%8 = load float, float* %5
%9 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
%10 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
store float %7, float* %9
store float %8, float* %10
%11 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
%12 = load float, float* %11
%13 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
%14 = load float, float* %13
%15 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%16 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %12, float* %15
store float %14, float* %16
%17 = bitcast { float, float }* %3 to <2 x float>*
%18 = load <2 x float>, <2 x float>* %17
ret <2 x float> %18
}

LLVM IR (-O2):
define <2 x float> @f2(float %0, float %1) {
%3 = insertelement <2 x float> undef, float %0, i64 0
%4 = insertelement <2 x float> %3, float %1, i64 1
ret <2 x float> %4
}
void g_color(color) int color;
{}


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

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

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

LLVM IR (-O2):
define void @g_color(i32 %0) {
ret void
}
const char *sarg_strerror(const int errval) {
  ((void)errval);
  return "small args error";
}


x86 assembly (clang, -O0):
<sarg_strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"small args error\00"
define i8* @sarg_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"small args error\00"
define i8* @sarg_strerror(i32 %0) {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
int test_imm_D0uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xD0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D0uint64_highword_mem>:
testb  $0xd0,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D0uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 893353197568
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bogoSort(int *, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int A[] = {9, 8, 7, 6, 5, 4, 3, 2, 1};
  printArray(A, 9);
  bogoSort(A, 9);
  printArray(A, 9);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1060 <printArray@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1030 <bogoSort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1060 <printArray@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <bogoSort@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.A = [9 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 9)
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%6 = call i32 @bogoSort(i32* %5, i32 9)
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%8 = call i32 @printArray(i32* %7, i32 9)
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [9 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 9)
%5 = call i32 @bogoSort(i32* %3, i32 9)
%6 = call i32 @printArray(i32* %3, i32 9)
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *simpletoken(char *str) {
  char *p;
  for (p = str; *p != '\0' && *p != '\'' && !isspace(*p); p++)
    ;
  return (p);
}


x86 assembly (clang, -O0):
<simpletoken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1165 <simpletoken+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x27,%ecx
mov    %al,-0x11(%rbp)
je     1165 <simpletoken+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1175 <simpletoken+0x65>
jmp    118b <simpletoken+0x7b>
jmp    117a <simpletoken+0x6a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <simpletoken+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpletoken>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%eax
test   %al,%al
je     113d <simpletoken+0x2d>
cmp    $0x27,%al
je     113d <simpletoken+0x2d>
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    113d <simpletoken+0x2d>
add    $0x1,%rbx
jmp    1120 <simpletoken+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @simpletoken(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %24, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 39
br i1 %14, label %15, label %21
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = call i32 @isspace(i8 signext %17)
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
br label %21
21: ; preds = %15, %10, %5
%22 = phi i1 [ false, %10 ], [ false, %5 ], [ %20, %15 ]
br i1 %22, label %23, label %27
23: ; preds = %21
br label %24
24: ; preds = %23
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
br label %5
27: ; preds = %21
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
define i8* @simpletoken(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %10
i8 39, label %10
]
5: ; preds = %2
%6 = tail call i32 @isspace(i8 signext %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2, %2, %5
ret i8* %3
}
void hisfc350_get_best_clock(unsigned int *clock) {
  int ix;
  int clk_reg;
  unsigned int sysclk[] = {
      (((24) + 1) >> 1),
      (0 << 2),
      (((75) + 1) >> 1),
      ((0 << 3) | (1 << 2)),
      (((125) + 1) >> 1),
      ((1 << 3) | (1 << 2)),
      0,
      0,
  };
  clk_reg = (0 << 2);
  for (ix = 0; sysclk[ix]; ix += 2) {
    if (*clock < sysclk[ix])
      break;
    clk_reg = sysclk[ix + 1];
  }
  *clock = clk_reg;
}


x86 assembly (clang, -O0):
<hisfc350_get_best_clock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0xef1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
je     1187 <hisfc350_get_best_clock+0x87>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jae    116a <hisfc350_get_best_clock+0x6a>
jmp    1187 <hisfc350_get_best_clock+0x87>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <hisfc350_get_best_clock+0x42>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hisfc350_get_best_clock>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    $0x3f,%eax
setae  %cl
xor    %edx,%edx
cmp    $0x26,%eax
lea    0x4(,%rcx,8),%eax
cmovb  %edx,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @hisfc350_get_best_clock(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ult i32 %2, 38
%4 = icmp ult i32 %2, 63
%5 = select i1 %4, i32 4, i32 12
%6 = select i1 %3, i32 0, i32 %5
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ invalidate_TLB(void *);
void hal_mmu_pg_tbl_refresh(void *virt_addr) {
  invalidate_TLB(virt_addr);
  return;
}


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

x86 assembly (clang, -O2):
<hal_mmu_pg_tbl_refresh>:
jmp    1030 <invalidate_TLB@plt>

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

LLVM IR (-O2):
define void @hal_mmu_pg_tbl_refresh(i8* %0) {
%2 = tail call i32 @invalidate_TLB(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void test9(char *P) {
  int x;
  printf(P);
  printf(P, 42);
  printf("%n", &x);
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%n\00"
define void @test9(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 42)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
ret void
}
void foo_2_1_2_2_2_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_2_1_1_2_2() {
ret void
}
/* Variables and functions */
int strlen(char *);
char deque(char *buff, int *tail) {
  if (*tail == strlen(buff))
    return -1;
  return buff[(*tail)++];
}


x86 assembly (clang, -O0):
<deque>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jne    1148 <deque+0x38>
movb   $0xff,-0x1(%rbp)
jmp    1162 <deque+0x52>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
mov    (%rdx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deque>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%ebp
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0xff,%al
cmp    %ecx,%ebp
je     1135 <deque+0x25>
movslq (%rbx),%rax
lea    0x1(%rax),%ecx
mov    %ecx,(%rbx)
mov    (%r14,%rax,1),%al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @deque(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
br label %12
12: ; preds = %2, %6
%13 = phi i8 [ %11, %6 ], [ -1, %2 ]
ret i8 %13
}
const int wordload(const unsigned char *p) { return p[0] | p[1] << 8; }


x86 assembly (clang, -O0):
<wordload>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordload>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @wordload(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @wordload(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char const *const, struct stat *);
int is_dir(const char *const dir_path) {
  struct stat dir_stat;
  stat(dir_path, &dir_stat);
  return S_ISDIR(dir_stat.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @S_ISDIR(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @S_ISDIR(i32 %6)
ret i32 %7
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
float vec3_distance(float *, float *);
__attribute__((always_)) float psvec3_distance(struct vec3 *a, struct vec3 *b) {
  return vec3_distance((float *)a, (float *)b);
}


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

x86 assembly (clang, -O2):
<psvec3_distance>:
jmp    1030 <vec3_distance@plt>

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define float @psvec3_distance(%struct.vec3* %0, %struct.vec3* %1) {
%3 = alloca %struct.vec3*
%4 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %3
store %struct.vec3* %1, %struct.vec3** %4
%5 = load %struct.vec3*, %struct.vec3** %3
%6 = bitcast %struct.vec3* %5 to float*
%7 = load %struct.vec3*, %struct.vec3** %4
%8 = bitcast %struct.vec3* %7 to float*
%9 = call float @vec3_distance(float* %6, float* %8)
ret float %9
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define float @psvec3_distance(%struct.vec3* %0, %struct.vec3* %1) {
%3 = bitcast %struct.vec3* %0 to float*
%4 = bitcast %struct.vec3* %1 to float*
%5 = tail call float @vec3_distance(float* %3, float* %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *safe_malloc_impl(size_t size) {
  void *ptr = malloc(size);
  if (!ptr) {
    fprintf(stderr, "malloc error: failed to allocate memory\n");
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<safe_malloc_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <safe_malloc_impl+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc_impl>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <safe_malloc_impl+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"malloc error: failed to allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @safe_malloc_impl(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"malloc error: failed to allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @safe_malloc_impl(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
OP(dd, b7) { op_b7(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_b7()
ret i32 undef
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
double abs(int /*<<< orphan*/);
int /*<<< orphan*/ calc_tree(struct tree *);
double fun_abs(struct tree *tree) { return abs(calc_tree(tree)); }


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

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

LLVM IR (-O0):
%struct.tree = type { i32 }
define double @fun_abs(%struct.tree* %0) {
%2 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %2
%3 = load %struct.tree*, %struct.tree** %2
%4 = call i32 @calc_tree(%struct.tree* %3)
%5 = call double @abs(i32 %4)
ret double %5
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define double @fun_abs(%struct.tree* %0) {
%2 = tail call i32 @calc_tree(%struct.tree* %0)
%3 = tail call double @abs(i32 %2)
ret double %3
}
exit(v) {
  _cleanup();
  _exit(v);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_cleanup@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <_cleanup@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @_cleanup()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define i32 @exit(i32 %0) {
%2 = tail call i32 (...) @_cleanup()
tail call void @_exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ellpack(double *, short *, double *, double *);
void workload(double *nzval, short *cols, double *vec, double *out) {
#pragma HLS INTERFACE m_axi port = nzval offset = slave bundle = gmem1
#pragma HLS INTERFACE m_axi port = cols offset = slave bundle = gmem2
#pragma HLS INTERFACE m_axi port = vec offset = slave bundle = gmem1
#pragma HLS INTERFACE m_axi port = out offset = slave bundle = gmem1
#pragma HLS INTERFACE s_axilite port = nzval bundle = control
#pragma HLS INTERFACE s_axilite port = cols bundle = control
#pragma HLS INTERFACE s_axilite port = vec bundle = control
#pragma HLS INTERFACE s_axilite port = out bundle = control
#pragma HLS INTERFACE s_axilite port = return bundle = control
  ellpack(nzval, cols, vec, out);
  return;
}


x86 assembly (clang, -O0):
<workload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <ellpack@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workload>:
jmp    1030 <ellpack@plt>

LLVM IR (-O0):
define void @workload(double* %0, i16* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca i16*
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %5
store i16* %1, i16** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %5
%10 = load i16*, i16** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
%13 = call i32 @ellpack(double* %9, i16* %10, double* %11, double* %12)
ret void
}

LLVM IR (-O2):
define void @workload(double* %0, i16* %1, double* %2, double* %3) {
%5 = tail call i32 @ellpack(double* %0, i16* %1, double* %2, double* %3)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xexpose_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xexpose.serial;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xexpose_serial>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XEvent_xexpose_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_dobldobl_multi_affinization(int m) {
  int fail, b;
  double c;
  fail = _ada_use_c2phc4c(908, &m, &b, &c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_dobldobl_multi_affinization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x38c,%edi
lea    -0x4(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_dobldobl_multi_affinization>:
sub    $0x18,%rsp
mov    %edi,0x8(%rsp)
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    $0x38c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @syscon_dobldobl_multi_affinization(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %2
%6 = call i32 @_ada_use_c2phc4c(i32 908, i32* %2, i32* %4, double* %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @syscon_dobldobl_multi_affinization(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
%5 = bitcast i32* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @_ada_use_c2phc4c(i32 908, i32* %2, i32* %3, double* %4, i32 0)
ret i32 %7
}
/* Variables and functions */
int parse_int_file(int /*<<< orphan*/, char *);
int no_turbo(void) {
  return parse_int_file(0, "/sys/devices/system/cpu/intel_pstate/no_turbo");
}


x86 assembly (clang, -O0):
<no_turbo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <parse_int_file@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_turbo>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <parse_int_file@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"/sys/devices/system/cpu/intel_pstate/no_turbo\00"
define i32 @no_turbo() {
%1 = call i32 @parse_int_file(i32 0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [46 x i8] c"/sys/devices/system/cpu/intel_pstate/no_turbo\00"
define i32 @no_turbo() {
%1 = tail call i32 @parse_int_file(i32 0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void dosum(long int times) {
  while (times--)
    ;
}


x86 assembly (clang, -O0):
<dosum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1126 <dosum+0x26>
jmp    1108 <dosum+0x8>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dosum(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %7, %1
%4 = load i64, i64* %2
%5 = add nsw i64 %4, -1
store i64 %5, i64* %2
%6 = icmp ne i64 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @dosum(i64 %0) {
ret void
}