xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ error_msg(char *, char *);
int /*<<< orphan*/ free(char *);
char *ip_get_error_msg(int /*<<< orphan*/ *, int, char *);
void option_error(int rc) {
  char *msg = ip_get_error_msg(NULL, rc, "setting option");
  error_msg("%s", msg);
  free(msg);
}


x86 assembly (clang, -O0):
<option_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb7(%rip),%rdx
call   1050 <ip_get_error_msg@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <error_msg@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<option_error>:
push   %rbx
mov    %edi,%esi
lea    0xec6(%rip),%rdx
xor    %edi,%edi
call   1050 <ip_get_error_msg@plt>
mov    %rax,%rbx
lea    0xec4(%rip),%rdi
mov    %rax,%rsi
call   1040 <error_msg@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"setting option\00"
@.str.1 = [3 x i8] c"%s\00"
define void @option_error(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @ip_get_error_msg(i32* null, i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @error_msg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"setting option\00"
@.str.1 = [3 x i8] c"%s\00"
define void @option_error(i32 %0) {
%2 = tail call i8* @ip_get_error_msg(i32* null, i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @error_msg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void test_failed(void) {
  fprintf(stderr, "failed\n");
  fflush(stderr);
}


x86 assembly (clang, -O0):
<test_failed>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_failed>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"failed\0A\00"
define void @test_failed() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"failed\0A\00"
define void @test_failed() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void check(char *msg, int num) {
  if (num < 0) {
    perror(msg);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1149 <check+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %esi,%esi
js     1125 <check+0x5>
ret
push   %rax
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @check(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @check(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
ret void
}
int main() {
  unsigned long test = 1;
  return !test;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void sendmesg(const char *mesg) { return; }


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

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

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

LLVM IR (-O2):
define void @sendmesg(i8* nocapture %0) {
ret void
}
/* Variables and functions */
void *mxml_get_sibling(void *);
void *cfg_flash_get_next_area(void *area) {
  void *next_area = ((void *)0);
  if (((void *)0) != area) {
    next_area = mxml_get_sibling(area);
  }
  return next_area;
}


x86 assembly (clang, -O0):
<cfg_flash_get_next_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     113d <cfg_flash_get_next_area+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <mxml_get_sibling@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_flash_get_next_area>:
test   %rdi,%rdi
je     111a <cfg_flash_get_next_area+0xa>
jmp    1030 <mxml_get_sibling@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @cfg_flash_get_next_area(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @mxml_get_sibling(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
double get_real_time(void) { return -1.0; }


x86 assembly (clang, -O0):
<get_real_time>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_real_time>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_real_time() {
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @get_real_time() {
ret double -1.000000e+00
}
/* Variables and functions */
scalar_t__ ft_islower(int);
int ft_toupper(int c) { return (ft_islower(c) ? c - 32 : c); }


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_islower@plt>
cmp    $0x0,%rax
je     113b <ft_toupper+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <ft_toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ft_islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = tail call i64 @ft_islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int generic_proc_open(char *, char *);
int net_snmp6_open(void) {
  return generic_proc_open("PROC_NET_SNMP6", "net/snmp6");
}


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

x86 assembly (clang, -O2):
<net_snmp6_open>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
jmp    1030 <generic_proc_open@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"PROC_NET_SNMP6\00"
@.str.1 = [10 x i8] c"net/snmp6\00"
define i32 @net_snmp6_open() {
%1 = call i32 @generic_proc_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [15 x i8] c"PROC_NET_SNMP6\00"
@.str.1 = [10 x i8] c"net/snmp6\00"
define i32 @net_snmp6_open() {
%1 = tail call i32 @generic_proc_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct timex {
  int dummy;
};

/* Variables and functions */
int syscall(int, void *);
int adjtimex(struct timex *txc) { return syscall(124, (void *)txc); }


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

x86 assembly (clang, -O2):
<adjtimex>:
mov    %rdi,%rsi
mov    $0x7c,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timex = type { i32 }
define i32 @adjtimex(%struct.timex* %0) {
%2 = alloca %struct.timex*
store %struct.timex* %0, %struct.timex** %2
%3 = load %struct.timex*, %struct.timex** %2
%4 = bitcast %struct.timex* %3 to i8*
%5 = call i32 @syscall(i32 124, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.timex = type { i32 }
define i32 @adjtimex(%struct.timex* %0) {
%2 = bitcast %struct.timex* %0 to i8*
%3 = tail call i32 @syscall(i32 124, i8* %2)
ret i32 %3
}
void swapchr(char *c, char *d) {
  char tmp = *c;
  *c = *d;
  *d = tmp;
}


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

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

LLVM IR (-O0):
define void @swapchr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swapchr(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int hea_test_u64_bit(int /*<<< orphan*/ const, int);
int hea_cq_aer_intern_err_check(const __u64 *aer) {
  return hea_test_u64_bit(*aer, 34);
}


x86 assembly (clang, -O0):
<hea_cq_aer_intern_err_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x22,%esi
call   1030 <hea_test_u64_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_intern_err_check>:
mov    (%rdi),%edi
mov    $0x22,%esi
jmp    1030 <hea_test_u64_bit@plt>

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

LLVM IR (-O2):
define i32 @hea_cq_aer_intern_err_check(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_test_u64_bit(i32 %2, i32 34)
ret i32 %3
}
/* Variables and functions */
int japi_image(int, int);
int j_image(int arg0, int arg1) { return (japi_image(arg0, arg1)); }


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

x86 assembly (clang, -O2):
<j_image>:
jmp    1030 <japi_image@plt>

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

LLVM IR (-O2):
define i32 @j_image(i32 %0, i32 %1) {
%3 = tail call i32 @japi_image(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ NAME_MAX;
scalar_t__ PATH_MAX;
int /*<<< orphan*/ nvme_getdev(char *, char *, char *);
int nvme_is_device(char *fid_str, char *nsid_str) {
  char path_tmp[(PATH_MAX + NAME_MAX + 1) + 1];
  return !(nvme_getdev(fid_str, nsid_str, path_tmp));
}


x86 assembly (clang, -O0):
<nvme_is_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%rcx
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0x2(%rcx,%rdx,1),%rax
mov    %rsp,%rsi
mov    %rsi,-0x18(%rbp)
lea    0x11(%rcx,%rdx,1),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <nvme_getdev@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_is_device>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
mov    0x2eab(%rip),%rcx
mov    (%rcx),%rcx
add    %rcx,%rax
add    $0x11,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rdx
sub    %rax,%rdx
mov    %rdx,%rsp
call   1030 <nvme_getdev@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i64 0
@NAME_MAX = global i64 0
define i32 @nvme_is_device(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i64, i64* @PATH_MAX
%8 = load i64, i64* @NAME_MAX
%9 = add nsw i64 %7, %8
%10 = add nsw i64 %9, 1
%11 = add nsw i64 %10, 1
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %5
%13 = alloca i8, i64 %11
store i64 %11, i64* %6
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @nvme_getdev(i8* %14, i8* %15, i8* %13)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
%20 = load i8*, i8** %5
ret i32 %19
}

LLVM IR (-O2):
@PATH_MAX = global i64 0
@NAME_MAX = global i64 0
define i32 @nvme_is_device(i8* %0, i8* %1) {
%3 = load i64, i64* @PATH_MAX
%4 = load i64, i64* @NAME_MAX
%5 = add i64 %3, 2
%6 = add i64 %5, %4
%7 = alloca i8, i64 %6
%8 = call i32 @nvme_getdev(i8* %0, i8* %1, i8* %7)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
void gtk_cell_renderer_toggle_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_renderer_toggle_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int, char *);
void eval_badcall(void) { error(130, 1153, "evaluate"); }


x86 assembly (clang, -O0):
<eval_badcall>:
push   %rbp
mov    %rsp,%rbp
mov    $0x82,%edi
mov    $0x481,%esi
lea    0xedb(%rip),%rdx
call   1030 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_badcall>:
lea    0xee9(%rip),%rdx
mov    $0x82,%edi
mov    $0x481,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"evaluate\00"
define void @eval_badcall() {
%1 = call i32 @error(i32 130, i32 1153, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"evaluate\00"
define void @eval_badcall() {
%1 = tail call i32 @error(i32 130, i32 1153, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ osMemFree(void *);
void memPoolFree(void *p) { osMemFree(p); }


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

x86 assembly (clang, -O2):
<memPoolFree>:
jmp    1030 <osMemFree@plt>

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

LLVM IR (-O2):
define void @memPoolFree(i8* %0) {
%2 = tail call i32 @osMemFree(i8* %0)
ret void
}
char *roman(int x) {
  char *s;
  return s;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @roman(i32 %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: mkboot <target> <firmware file> <boot file> <output file>\n");
  printf("available targets:\n"
         "\t-h100     Iriver H1x0\n"
         "\t-h300     Iriver H3x0\n"
         "\t-iax5     iAudio X5\n"
         "\t-iam5     iAudio M5\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"usage: mkboot <target> <firmware file> <boot file> <output file>\0A\00"
@.str.1 = [108 x i8] c"available targets:\0A\09-h100 Iriver H1x0\0A\09-h300 Iriver H3x0\0A\09-iax5 iAudio X5\0A\09-iam5 iAudio M5\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [65 x i8] c"usage: mkboot <target> <firmware file> <boot file> <output file>\00"
@str.2 = [107 x i8] c"available targets:\0A\09-h100 Iriver H1x0\0A\09-h300 Iriver H3x0\0A\09-iax5 iAudio X5\0A\09-iam5 iAudio M5\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
pid_t __fork(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @__fork() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ _ACC_finalize();
void acc_finalize_() { _ACC_finalize(); }


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

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

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

LLVM IR (-O2):
define void @acc_finalize_() {
%1 = tail call i32 (...) @_ACC_finalize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stdout;
int write(int /*<<< orphan*/, char *, int);
int term_inverse_video() { return write(stdout, "\x1b[7m", 4) != 4; }


x86 assembly (clang, -O0):
<term_inverse_video>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x4,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_inverse_video>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[7m\00"
define i32 @term_inverse_video() {
%1 = load i32, i32* @stdout
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp ne i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[7m\00"
define i32 @term_inverse_video() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp ne i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long get_ds(void) { return 0x5; }


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

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

LLVM IR (-O0):
define i64 @get_ds() {
ret i64 5
}

LLVM IR (-O2):
define i64 @get_ds() {
ret i64 5
}
int acpi_video_register_with_quirks(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @acpi_video_register_with_quirks() {
ret i32 0
}
unsigned stm32_gpio_to_port(unsigned gpio) { return gpio / 16; }


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

x86 assembly (clang, -O2):
<stm32_gpio_to_port>:
mov    %edi,%eax
shr    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @stm32_gpio_to_port(i32 %0) {
%2 = lshr i32 %0, 4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
scalar_t__ pthread_self();
void *run(void *ptr) {
  printf("I am thread %d with thread id %X\n", *(int *)ptr,
         (unsigned int)pthread_self());
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbx
mov    (%rdi),%ebx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xebf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"I am thread %d with thread id %X\0A\00"
define i8* @run(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = call i64 (...) @pthread_self()
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
%10 = call i32 @pthread_exit(i32* null)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [34 x i8] c"I am thread %d with thread id %X\0A\00"
define noalias i8* @run(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%7 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
void RTTarFileTell(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileTell() {
ret void
}
void foo716(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo716(i32 %0) {
ret void
}
/* Variables and functions */
int send(int, void *, int, int /*<<< orphan*/);
int _sapi_inet_tcp_transmit(int sock, void *data, int datalen) {
  return send(sock, (void *)data, datalen, 0);
}


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

x86 assembly (clang, -O2):
<_sapi_inet_tcp_transmit>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @_sapi_inet_tcp_transmit(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
struct list_node_s {
  int dummy;
};

/* Variables and functions */
int Is_empty(struct list_node_s *head_p) {
  if (head_p == NULL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<Is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <Is_empty+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <Is_empty+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Is_empty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
%struct.list_node_s = type { i32 }
define i32 @Is_empty(%struct.list_node_s* readnone %0) {
%2 = icmp eq %struct.list_node_s* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
void dyn_call(void (*f)()) { f(); }


x86 assembly (clang, -O0):
<dyn_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dyn_call>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define void @dyn_call(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strcasecmp(char *, char *);
void strcasecmp_diff_length_2() {
  char *x = "aBcDe";
  char *y = "abc";
  clang_analyzer_eval(strcasecmp(x, y) == 1);
}


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

x86 assembly (clang, -O2):
<strcasecmp_diff_length_2>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"aBcDe\00"
@.str.1 = [4 x i8] c"abc\00"
define void @strcasecmp_diff_length_2() {
%1 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void testFunc(char **argv) {
  char password[16];
  strcpy(password, argv[1]);
  return;
}


x86 assembly (clang, -O0):
<testFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFunc>:
sub    $0x18,%rsp
mov    0x8(%rdi),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @testFunc(i8** %0) {
%2 = alloca i8**
%3 = alloca [16 x i8]
store i8** %0, i8*** %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @strcpy(i8* %4, i8* %7)
ret void
}

LLVM IR (-O2):
define void @testFunc(i8** nocapture %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds i8*, i8** %0, i64 1
%5 = load i8*, i8** %4
%6 = call i32 @strcpy(i8* %3, i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct option_w {
  int dummy;
};

/* Variables and functions */
int _getopt_internal_w(int, int /*<<< orphan*/ *const *,
                       int /*<<< orphan*/ const *, struct option_w const *,
                       int *, int, int /*<<< orphan*/);
int getopt_long_only_w(int argc, wchar_t *const *argv, const wchar_t *options,
                       const struct option_w *long_options, int *opt_index) {
  return _getopt_internal_w(argc, argv, options, long_options, opt_index, 1, 0);
}


x86 assembly (clang, -O0):
<getopt_long_only_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <_getopt_internal_w@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long_only_w>:
push   %rax
movl   $0x0,(%rsp)
mov    $0x1,%r9d
call   1030 <_getopt_internal_w@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.option_w = type { i32 }
define i32 @getopt_long_only_w(i32 %0, i32** %1, i32* %2, %struct.option_w* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32**
%8 = alloca i32*
%9 = alloca %struct.option_w*
%10 = alloca i32*
store i32 %0, i32* %6
store i32** %1, i32*** %7
store i32* %2, i32** %8
store %struct.option_w* %3, %struct.option_w** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32**, i32*** %7
%13 = load i32*, i32** %8
%14 = load %struct.option_w*, %struct.option_w** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal_w(i32 %11, i32** %12, i32* %13, %struct.option_w* %14, i32* %15, i32 1, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.option_w = type { i32 }
define i32 @getopt_long_only_w(i32 %0, i32** %1, i32* %2, %struct.option_w* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal_w(i32 %0, i32** %1, i32* %2, %struct.option_w* %3, i32* %4, i32 1, i32 0)
ret i32 %6
}
int test_imm_6Auint16_reg(unsigned short val) {
  return ((val) & (0x6A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Auint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x6a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Auint16_reg>:
test   $0x6a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 106
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void sstrncat(char *ds, char *ss, int *bufSize) {
  int len = *bufSize - strlen(ss);
  if (len > 0) {
    strncat(ds, ss, len);
    *bufSize = len;
  }
}


x86 assembly (clang, -O0):
<sstrncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1173 <sstrncat+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <strncat@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstrncat>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    (%rdx),%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebp
jle    114e <sstrncat+0x2e>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <strncat@plt>
mov    %ebp,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @sstrncat(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = call i32 @strlen(i8* %10)
%12 = sub nsw i32 %9, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i8*, i8** %5
%18 = load i32, i32* %7
%19 = call i32 @strncat(i8* %16, i8* %17, i32 %18)
%20 = load i32, i32* %7
%21 = load i32*, i32** %6
store i32 %20, i32* %21
br label %22
22: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
define void @sstrncat(i8* %0, i8* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = tail call i32 @strlen(i8* %1)
%6 = sub nsw i32 %4, %5
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @strncat(i8* %0, i8* %1, i32 %6)
store i32 %6, i32* %2
br label %10
10: ; preds = %8, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int close(int /*<<< orphan*/);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int fclose(FILE *__f) { return close(fileno(__f)); }


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

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

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

LLVM IR (-O2):
define i32 @fclose(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = tail call i32 @close(i32 %2)
ret i32 %3
}
void fasttrig_test_trig(void) {}


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

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

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

LLVM IR (-O2):
define void @fasttrig_test_trig() {
ret void
}
__attribute__((no, noclone)) long long f4(long long *p) { return *p; }


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

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

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

LLVM IR (-O2):
define i64 @f4(i64* nocapture %0) {
%2 = load i64, i64* %0
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ de_ascii_convert(char const *, char const *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  if (argc != 3) {
    printf("no file given\n");
    return 0;
  }
  de_ascii_convert(argv[1], argv[2]);
  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)
cmpl   $0x3,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1174 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <de_ascii_convert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1135 <main+0x15>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <de_ascii_convert@plt>
jmp    1141 <main+0x21>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"no file given\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 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %18
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @de_ascii_convert(i8* %13, i8* %16)
store i32 0, i32* %3
br label %18
18: ; preds = %10, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [14 x i8] c"no file given\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @de_ascii_convert(i8* %8, i8* %10)
br label %12
12: ; preds = %6, %4
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h264nal_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ h264nal_set_ref(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ h264nal_set_type(int /*<<< orphan*/ *, int);
void h264spsx_init(uint8_t *p_h264spsx) {
  h264nal_init(p_h264spsx);
  h264nal_set_ref(p_h264spsx, 1);
  h264nal_set_type(p_h264spsx, 13);
}


x86 assembly (clang, -O0):
<h264spsx_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <h264nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <h264nal_set_ref@plt>
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1040 <h264nal_set_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264spsx_init>:
push   %rbx
mov    %rdi,%rbx
call   1050 <h264nal_init@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <h264nal_set_ref@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
pop    %rbx
jmp    1040 <h264nal_set_type@plt>

LLVM IR (-O0):
define void @h264spsx_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h264nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h264nal_set_ref(i32* %5, i32 1)
%7 = load i32*, i32** %2
%8 = call i32 @h264nal_set_type(i32* %7, i32 13)
ret void
}

LLVM IR (-O2):
define void @h264spsx_init(i32* %0) {
%2 = tail call i32 @h264nal_init(i32* %0)
%3 = tail call i32 @h264nal_set_ref(i32* %0, i32 1)
%4 = tail call i32 @h264nal_set_type(i32* %0, i32 13)
ret void
}
/* Type definitions */
struct bpf_program {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PD_STUB_USE();
void pcap_freecode(struct bpf_program *prg) { PD_STUB_USE(); }


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

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

LLVM IR (-O0):
%struct.bpf_program = type { i32 }
define void @pcap_freecode(%struct.bpf_program* %0) {
%2 = alloca %struct.bpf_program*
store %struct.bpf_program* %0, %struct.bpf_program** %2
%3 = call i32 (...) @PD_STUB_USE()
ret void
}

LLVM IR (-O2):
%struct.bpf_program = type { i32 }
define void @pcap_freecode(%struct.bpf_program* nocapture readnone %0) {
%2 = tail call i32 (...) @PD_STUB_USE()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M402_f(char *s) {
  debug("M402_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M402_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M402_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M402_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M402_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M402_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M402_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void bit_decode(int input, int *right, int *left) {
  (*right) = input & 0x7FFF;
  (*left) = (input >> 15) & 0x7FFF;
}


x86 assembly (clang, -O0):
<bit_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7fff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0xf,%ecx
and    $0x7fff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_decode>:
mov    %edi,%eax
and    $0x7fff,%eax
mov    %eax,(%rsi)
shr    $0xf,%edi
and    $0x7fff,%edi
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @bit_decode(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = and i32 %7, 32767
%9 = load i32*, i32** %5
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 15
%12 = and i32 %11, 32767
%13 = load i32*, i32** %6
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @bit_decode(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = and i32 %0, 32767
store i32 %4, i32* %1
%5 = lshr i32 %0, 15
%6 = and i32 %5, 32767
store i32 %6, i32* %2
ret void
}
/* Variables and functions */
char nibble2ascii(char);
void byte2ascii(char byte, char *ascii) {
  ascii[0] = nibble2ascii((byte & 0xf0) >> 4);
  ascii[1] = nibble2ascii(byte & 0x0f);
}


x86 assembly (clang, -O0):
<byte2ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movsbl %al,%edi
call   1030 <nibble2ascii@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movsbl %al,%edi
call   1030 <nibble2ascii@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte2ascii>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ebp,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <nibble2ascii@plt>
mov    %al,(%rbx)
and    $0xf,%ebp
mov    %ebp,%edi
call   1030 <nibble2ascii@plt>
mov    %al,0x1(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @byte2ascii(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = and i32 %6, 240
%8 = ashr i32 %7, 4
%9 = trunc i32 %8 to i8
%10 = call signext i8 @nibble2ascii(i8 signext %9)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = and i32 %14, 15
%16 = trunc i32 %15 to i8
%17 = call signext i8 @nibble2ascii(i8 signext %16)
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
ret void
}

LLVM IR (-O2):
define void @byte2ascii(i8 signext %0, i8* nocapture writeonly %1) {
%3 = lshr i8 %0, 4
%4 = tail call signext i8 @nibble2ascii(i8 signext %3)
store i8 %4, i8* %1
%5 = and i8 %0, 15
%6 = tail call signext i8 @nibble2ascii(i8 signext %5)
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
ret void
}