xunge/DecIR huggingface dataset:
void b43_rfkill_init(struct b43_wldev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.b43_wldev = type opaque
define void @b43_rfkill_init(%struct.b43_wldev* nocapture %0) {
ret void
}
int test_imm_03uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x03 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_03uint64_midword_reg>:
test   $0x30000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_03uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 3
%6 = icmp ne i64 %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_03uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 196608
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int pathconN_nm4_n_in(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pathconN_nm4_n_in() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ disp_str(char *);
int /*<<< orphan*/ milli_delay(int);
void TestA() {
  int i = 0;
  while (1) {
    disp_str("A.");
    milli_delay(200);
  }
}


x86 assembly (clang, -O0):
<TestA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    112f <TestA+0xf>

x86 assembly (clang, -O2):
<TestA>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <disp_str@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    1130 <TestA+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"A.\00"
define void @TestA() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @milli_delay(i32 200)
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"A.\00"
define void @TestA() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @milli_delay(i32 200)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t direct_clear16(volatile uint16_t *addr, uint16_t dat) {
  *addr &= ~dat;
  return dat;
}


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

x86 assembly (clang, -O2):
<direct_clear16>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
not    %eax
and    %eax,(%rdi)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @direct_clear16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load volatile i32, i32* %4
%6 = xor i32 %5, -1
%7 = load i32*, i32** %3
%8 = load volatile i32, i32* %7
%9 = and i32 %8, %6
store volatile i32 %9, i32* %7
%10 = load volatile i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @direct_clear16(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = xor i32 %4, -1
%6 = load volatile i32, i32* %0
%7 = and i32 %6, %5
store volatile i32 %7, i32* %0
%8 = load volatile i32, i32* %3
ret i32 %8
}
void TOSH_MAKE_PW3_OUTPUT() { ; }


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

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

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

LLVM IR (-O2):
define void @TOSH_MAKE_PW3_OUTPUT() {
ret void
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
scalar_t__ msg_reroute_cnt(struct tipc_msg *);
int /*<<< orphan*/ msg_set_bits(struct tipc_msg *, int, int, int, scalar_t__);
void msg_incr_reroute_cnt(struct tipc_msg *m) {
  msg_set_bits(m, 1, 21, 0xf, msg_reroute_cnt(m) + 1);
}


x86 assembly (clang, -O0):
<msg_incr_reroute_cnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <msg_reroute_cnt@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%r8
add    $0x1,%r8
mov    $0x1,%esi
mov    $0x15,%edx
mov    $0xf,%ecx
call   1030 <msg_set_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_incr_reroute_cnt>:
push   %rbx
mov    %rdi,%rbx
call   1040 <msg_reroute_cnt@plt>
lea    0x1(%rax),%r8
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x15,%edx
mov    $0xf,%ecx
pop    %rbx
jmp    1030 <msg_set_bits@plt>

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define void @msg_incr_reroute_cnt(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%5 = call i64 @msg_reroute_cnt(%struct.tipc_msg* %4)
%6 = add nsw i64 %5, 1
%7 = call i32 @msg_set_bits(%struct.tipc_msg* %3, i32 1, i32 21, i32 15, i64 %6)
ret void
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define void @msg_incr_reroute_cnt(%struct.tipc_msg* %0) {
%2 = tail call i64 @msg_reroute_cnt(%struct.tipc_msg* %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @msg_set_bits(%struct.tipc_msg* %0, i32 1, i32 21, i32 15, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOCK_STREAM;
int get_fd(int /*<<< orphan*/, int);
int listen(int, int);
int get_tcp_socket(int port) {
  int fd = get_fd(SOCK_STREAM, port);
  if ((listen(fd, 1)) == -1) {
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<get_tcp_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
call   1040 <get_fd@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1030 <listen@plt>
cmp    $0xffffffff,%eax
jne    1161 <get_tcp_socket+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <get_tcp_socket+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tcp_socket>:
push   %rbx
mov    %edi,%esi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1040 <get_fd@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <listen@plt>
cmp    $0xffffffff,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SOCK_STREAM = global i32 0
define i32 @get_tcp_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* @SOCK_STREAM
%6 = load i32, i32* %3
%7 = call i32 @get_fd(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @listen(i32 %8, i32 1)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@SOCK_STREAM = global i32 0
define i32 @get_tcp_socket(i32 %0) {
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @get_fd(i32 %2, i32 %0)
%4 = tail call i32 @listen(i32 %3, i32 1)
%5 = icmp eq i32 %4, -1
%6 = select i1 %5, i32 -1, i32 %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_NOLOAD;
int /*<<< orphan*/ dlerror();
void *dlopen(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  void *handle;
  handle = dlopen("libpthread.so", RTLD_NOLOAD);
  if (handle == NULL)
    errx(1, "%s", dlerror());
  printf("libpthread loaded successfully\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1060 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118d <main+0x4d>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe86(%rip),%rsi
call   1040 <errx@plt>
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1060 <dlopen@plt>
test   %rax,%rax
jne    1175 <main+0x35>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xea5(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1050 <errx@plt>
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"libpthread.so\00"
@RTLD_NOLOAD = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [32 x i8] c"libpthread loaded successfully\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i32, i32* @RTLD_NOLOAD
%4 = call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 (...) @dlerror()
%9 = call i32 @errx(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %0
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"libpthread.so\00"
@RTLD_NOLOAD = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@str = [31 x i8] c"libpthread loaded successfully\00"
define i32 @main() {
%1 = load i32, i32* @RTLD_NOLOAD
%2 = tail call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (...) @dlerror()
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void swap(char s[], int i, int j) {
  int t = s[i];
  s[i] = s[j];
  s[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
store i32 %13, i32* %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 %18, i8* %22
%23 = load i32, i32* %7
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %4
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 %24, i8* %28
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int _wait(int *status) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOTSUP
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOTSUP
store i32 %2, i32* @errno
ret i32 -1
}
int fsl_rio_mcheck_exception(struct pt_regs *regs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define i32 @fsl_rio_mcheck_exception(%struct.pt_regs* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ trainer_dp_1(int /*<<< orphan*/);
void trainer_dp_1_launcher(void) { trainer_dp_1(0); }


x86 assembly (clang, -O0):
<trainer_dp_1_launcher>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <trainer_dp_1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trainer_dp_1_launcher>:
xor    %edi,%edi
jmp    1030 <trainer_dp_1@plt>

LLVM IR (-O0):
define void @trainer_dp_1_launcher() {
%1 = call i32 @trainer_dp_1(i32 0)
ret void
}

LLVM IR (-O2):
define void @trainer_dp_1_launcher() {
%1 = tail call i32 @trainer_dp_1(i32 0)
ret void
}
int messageHandler(char *caller, char *message_name, long msg_id,
                   char *arguments) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @messageHandler(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @messageHandler(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i8* nocapture readnone %3) {
ret i32 0
}
int test_imm_0Eint32_reg(int val) { return ((val) & (0x0E << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_0Eint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_0Eint32_reg(i32 %0) {
%2 = and i32 %0, 14
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int _link(char *old, char *new) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int clock_getres_syscall_wrapper(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void clock_getres_syscall_nofail(clockid_t id, struct timespec *ts) {
  int err;
  err = clock_getres_syscall_wrapper(id, ts);
  if (err)
    error(EXIT_FAILURE, errno, "SYS_clock_getres");
}


x86 assembly (clang, -O0):
<clock_getres_syscall_nofail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <clock_getres_syscall_wrapper@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1166 <clock_getres_syscall_nofail+0x46>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
lea    0xe9f(%rip),%rdx
call   1030 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_getres_syscall_nofail>:
push   %rax
call   1040 <clock_getres_syscall_wrapper@plt>
test   %eax,%eax
je     1149 <clock_getres_syscall_nofail+0x29>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdx
pop    %rax
jmp    1030 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [17 x i8] c"SYS_clock_getres\00"
define void @clock_getres_syscall_nofail(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%6 = load i32, i32* %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @clock_getres_syscall_wrapper(i32 %6, %struct.timespec* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
%13 = load i32, i32* @errno
%14 = call i32 @error(i32 %12, i32 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [17 x i8] c"SYS_clock_getres\00"
define void @clock_getres_syscall_nofail(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @clock_getres_syscall_wrapper(i32 %0, %struct.timespec* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @errno
%8 = tail call i32 @error(i32 %6, i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %2
ret void
}
/* Type definitions */
struct fmem_cookie {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fmem_cookie *const);
int fmem_close(void *cookie) {
  struct fmem_cookie *const fmc = cookie;
  free(fmc);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.fmem_cookie = type { i32 }
define i32 @fmem_close(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.fmem_cookie*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.fmem_cookie*
store %struct.fmem_cookie* %5, %struct.fmem_cookie** %3
%6 = load %struct.fmem_cookie*, %struct.fmem_cookie** %3
%7 = call i32 @free(%struct.fmem_cookie* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.fmem_cookie = type { i32 }
define i32 @fmem_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.fmem_cookie*
%3 = tail call i32 @free(%struct.fmem_cookie* %2)
ret i32 0
}
/* Type definitions */
struct wl_shm_pool {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool,
                               void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_shm_pool, user_data);
}


x86 assembly (clang, -O0):
<wl_shm_pool_set_user_data>:
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 <wl_proxy_set_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_shm_pool_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.wl_shm_pool = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shm_pool_set_user_data(%struct.wl_shm_pool* %0, i8* %1) {
%3 = alloca %struct.wl_shm_pool*
%4 = alloca i8*
store %struct.wl_shm_pool* %0, %struct.wl_shm_pool** %3
store i8* %1, i8** %4
%5 = load %struct.wl_shm_pool*, %struct.wl_shm_pool** %3
%6 = bitcast %struct.wl_shm_pool* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_shm_pool = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shm_pool_set_user_data(%struct.wl_shm_pool* %0, i8* %1) {
%3 = bitcast %struct.wl_shm_pool* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
int test_imm_27uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x27 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_27uint64_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, 39
%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_27uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 167503724544
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int is_NotFound(char *s) {
  if (strstr(s, "404 Stream Not Found") != NULL) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_NotFound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <is_NotFound+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <is_NotFound+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_NotFound>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"404 Stream Not Found\00"
define i32 @is_NotFound(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @strstr(i8* %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [21 x i8] c"404 Stream Not Found\00"
define i32 @is_NotFound(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *FontEncFromXLFD(char const *, int);
char *font_encoding_from_xlfd(const char *name, int length) {
  return FontEncFromXLFD(name, length);
}


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

x86 assembly (clang, -O2):
<font_encoding_from_xlfd>:
jmp    1030 <FontEncFromXLFD@plt>

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

LLVM IR (-O2):
define i8* @font_encoding_from_xlfd(i8* %0, i32 %1) {
%3 = tail call i8* @FontEncFromXLFD(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mul_and_mod();
int main(int argc, char *argv[]) {
  mul_and_mod();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <mul_and_mod@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <mul_and_mod@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @mul_and_mod()
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @mul_and_mod()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
struct Task {
  int dummy;
};

/* Variables and functions */
char *strdup(char *);
char *handle_exit(char *arg, struct Task *tasks, unsigned n) {
  (void)arg, (void)tasks, (void)n;
  if (*arg)
    return strdup("\"exit\" expect no argument.");
  return strdup("Will exit.");
}


x86 assembly (clang, -O0):
<handle_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <handle_exit+0x35>
lea    0xec9(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1155 <handle_exit+0x45>
lea    0xecf(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_exit>:
cmpb   $0x0,(%rdi)
je     1121 <handle_exit+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <strdup@plt>
lea    0xef3(%rip),%rdi
jmp    1030 <strdup@plt>

LLVM IR (-O0):
%struct.Task = type { i32 }
@.str = [27 x i8] c"\22exit\22 expect no argument.\00"
@.str.1 = [11 x i8] c"Will exit.\00"
define i8* @handle_exit(i8* %0, %struct.Task* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.Task*
%7 = alloca i32
store i8* %0, i8** %5
store %struct.Task* %1, %struct.Task** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = load %struct.Task*, %struct.Task** %6
%10 = load i32, i32* %7
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i8* @strdup(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i8* %15, i8** %4
br label %18
16: ; preds = %3
%17 = call i8* @strdup(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i8* %17, i8** %4
br label %18
18: ; preds = %16, %14
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
%struct.Task = type { i32 }
@.str = [27 x i8] c"\22exit\22 expect no argument.\00"
@.str.1 = [11 x i8] c"Will exit.\00"
define noalias i8* @handle_exit(i8* nocapture %0, %struct.Task* nocapture readnone %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call dereferenceable_or_null(27) i8* @strdup(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %3
%9 = tail call dereferenceable_or_null(11) i8* @strdup(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      if (state[0UL] > local1) {
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] * 371143069UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
cmp    %ecx,%eax
jge    115c <RandomFunc+0x5c>
movzwl -0x12(%rbp),%eax
movzwl -0x14(%rbp),%ecx
cmp    %ecx,%eax
jle    114b <RandomFunc+0x4b>
jmp    114b <RandomFunc+0x4b>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
imul   $0x161f319d,%rax,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
imul   $0x319d,%eax,%eax
add    $0x1e51,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = add nsw i32 %10, 2885
%12 = trunc i32 %11 to i16
%13 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %12, i16* %13
store i16 0, i16* %6
br label %14
14: ; preds = %30, %2
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = load i16*, i16** %3
%18 = getelementptr inbounds i16, i16* %17, i64 1
%19 = load i16, i16* %18
%20 = zext i16 %19 to i32
%21 = icmp slt i32 %16, %20
br i1 %21, label %22, label %35
22: ; preds = %14
%23 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%24 = load i16, i16* %23
%25 = zext i16 %24 to i32
%26 = load i16, i16* %6
%27 = zext i16 %26 to i32
%28 = icmp sgt i32 %25, %27
br i1 %28, label %29, label %30
29: ; preds = %22
br label %30
30: ; preds = %29, %22
%31 = load i16, i16* %6
%32 = zext i16 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i16
store i16 %34, i16* %6
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%37 = load i16, i16* %36
%38 = zext i16 %37 to i64
%39 = mul i64 %38, 371143069
%40 = trunc i64 %39 to i16
%41 = load i16*, i16** %4
%42 = getelementptr inbounds i16, i16* %41, i64 0
store i16 %40, i16* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = mul i16 %3, 12701
%5 = add i16 %4, 7761
store i16 %5, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halt();
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void __attribute__((cdecl)) irq_xxx(unsigned cs, unsigned ip) {
  printf("irq_"
         "xxx"
         "!%x:%x",
         cs, ip);
  halt();
}


x86 assembly (clang, -O0):
<irq_xxx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <halt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_xxx>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <halt@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"irq_xxx!%x:%x\00"
define void @irq_xxx(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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (...) @halt()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"irq_xxx!%x:%x\00"
define void @irq_xxx(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 (...) @halt()
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ s_srrand(int /*<<< orphan*/);
void tsrand() {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  s_srrand(tv.tv_usec);
}


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

x86 assembly (clang, -O2):
<tsrand>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%edi
add    $0x18,%rsp
jmp    1040 <s_srrand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define void @tsrand() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @s_srrand(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define void @tsrand() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @s_srrand(i32 %7)
ret void
}
/* Variables and functions */
scalar_t__ isdigit(unsigned char);
char tolower(unsigned char);
int digit_to_int(unsigned char c) {
  if (isdigit(c))
    return c - '0';
  else
    return tolower(c) - 'a' + 10;
}


x86 assembly (clang, -O0):
<digit_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <digit_to_int+0x30>
movzbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <digit_to_int+0x45>
movzbl -0x5(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_to_int>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1135 <digit_to_int+0x15>
movzbl %bl,%eax
add    $0xffffffd0,%eax
pop    %rbx
ret
movzbl %bl,%edi
call   1040 <tolower@plt>
movsbl %al,%eax
add    $0xffffffa9,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @digit_to_int(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isdigit(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = sub nsw i32 %9, 48
store i32 %10, i32* %2
br label %17
11: ; preds = %1
%12 = load i8, i8* %3
%13 = call signext i8 @tolower(i8 zeroext %12)
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 97
%16 = add nsw i32 %15, 10
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @digit_to_int(i8 zeroext %0) {
%2 = tail call i64 @isdigit(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = zext i8 %0 to i32
%6 = add nsw i32 %5, -48
br label %11
7: ; preds = %1
%8 = tail call signext i8 @tolower(i8 zeroext %0)
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, -87
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ %6, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
char *aligned_alloc(int, int);
void memleak_aligned_alloc(void) { char *alignedBuf = aligned_alloc(8, 16); }


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

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

LLVM IR (-O0):
define void @memleak_aligned_alloc() {
%1 = alloca i8*
%2 = call i8* @aligned_alloc(i32 8, i32 16)
store i8* %2, i8** %1
ret void
}

LLVM IR (-O2):
define void @memleak_aligned_alloc() {
ret void
}
/* Variables and functions */
scalar_t__ llround(double);
long long llroundf(float x) { return (long long)llround((double)x); }


x86 assembly (clang, -O0):
<llroundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <llround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llroundf>:
cvtss2sd %xmm0,%xmm0
jmp    1030 <llround@plt>

LLVM IR (-O0):
define i64 @llroundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @llround(double %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @llroundf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @llround(double %2)
ret i64 %3
}
int add_numbo(int d, int c) {
  int sum;
  sum = c + d;
  return sum;
}


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

x86 assembly (clang, -O2):
<add_numbo>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add_numbo(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int removexattr(const char *__path, const char *__name) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<removexattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removexattr>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @removexattr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @removexattr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_lock(int /*<<< orphan*/ *);
int lock(pthread_mutex_t *l) { return pthread_mutex_lock(l); }


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

x86 assembly (clang, -O2):
<lock>:
jmp    1030 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define i32 @lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;
struct pcg_state_64 {
  int dummy;
};

/* Variables and functions */
int pcg_unique_64_xsh_rs_32_random_r(struct pcg_state_64 *);
uint32_t pcg_unique_64_xsh_rs_32_boundedrand_r(struct pcg_state_64 *rng,
                                               uint32_t bound) {
  uint32_t threshold = -bound % bound;
  for (;;) {
    uint32_t r = pcg_unique_64_xsh_rs_32_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_unique_64_xsh_rs_32_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_unique_64_xsh_rs_32_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_unique_64_xsh_rs_32_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_unique_64_xsh_rs_32_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_unique_64_xsh_rs_32_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_unique_64_xsh_rs_32_random_r@plt>
test   %eax,%eax
js     1120 <pcg_unique_64_xsh_rs_32_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_unique_64_xsh_rs_32_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
%3 = alloca %struct.pcg_state_64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_64* %0, %struct.pcg_state_64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_64*, %struct.pcg_state_64** %3
%13 = call i32 @pcg_unique_64_xsh_rs_32_random_r(%struct.pcg_state_64* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_unique_64_xsh_rs_32_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_unique_64_xsh_rs_32_random_r(%struct.pcg_state_64* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thr_func1(void *arg) {
  printf("Thread 1 ritorno\n");
  return ((void *)1);
}


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

x86 assembly (clang, -O2):
<thr_func1>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Thread 1 ritorno\0A\00"
define i8* @thr_func1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
@str = [17 x i8] c"Thread 1 ritorno\00"
define i8* @thr_func1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}
void pinmux_free_setting(struct pinctrl_setting const *setting) {}


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

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

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

LLVM IR (-O2):
%struct.pinctrl_setting = type opaque
define void @pinmux_free_setting(%struct.pinctrl_setting* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char const *);
void echecm(const char *echec_msg) {
  printf("%s: %s\n", "[\033[31mECHEC\033[0m]", echec_msg);
}


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

x86 assembly (clang, -O2):
<echecm>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [17 x i8] c"[\1B[31mECHEC\1B[0m]\00"
define void @echecm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [17 x i8] c"[\1B[31mECHEC\1B[0m]\00"
define void @echecm(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}