xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s", "Hai World!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"Hai World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_stat() {
  printf("NOT IMPLEMENTED:"
         "pa_context_stat"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_context_stat\0A\00"
define i32 @pa_context_stat() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_context_stat\00"
define i32 @pa_context_stat() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t ofi_read_socket(int fd, void *buf, size_t count) {
  return read(fd, buf, count);
}


x86 assembly (clang, -O0):
<ofi_read_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofi_read_socket>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @ofi_read_socket(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
size_t ubitmap_get_octets_len(size_t bit_len) {
  return bit_len / 8 + (bool)(bit_len % 8);
}


x86 assembly (clang, -O0):
<ubitmap_get_octets_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
mov    -0x8(%rbp),%rcx
and    $0x7,%rcx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ubitmap_get_octets_len>:
mov    %rdi,%rax
shr    $0x3,%rax
and    $0x7,%edi
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ubitmap_get_octets_len(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 8
%5 = load i64, i64* %2
%6 = urem i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = sext i32 %7 to i64
%9 = add i64 %4, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @ubitmap_get_octets_len(i64 %0) {
%2 = lshr i64 %0, 3
%3 = and i64 %0, 7
%4 = add nuw nsw i64 %2, %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
char *getUserName() {
  register struct passwd *pw;
  register uid_t uid;
  uid = getuid();
  pw = getpwuid(uid);
  return pw->pw_name;
}


x86 assembly (clang, -O0):
<getUserName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUserName>:
push   %rax
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    (%rax),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @getUserName() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%4 = load i8*, i8** %3
ret i8* %4
}
void swap_4bytes(void *ptr) {
  char c, *cc;
  cc = ptr;
  c = cc[0];
  cc[0] = cc[3];
  cc[3] = c;
  c = cc[1];
  cc[1] = cc[2];
  cc[2] = c;
}


x86 assembly (clang, -O0):
<swap_4bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_4bytes>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @swap_4bytes(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
long dcloadsyscall(int, long *);
long time(long *t) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(11, t);
  else
    return -1;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    1144 <time+0x34>
mov    -0x10(%rbp),%rsi
mov    $0xb,%edi
call   1030 <dcloadsyscall@plt>
mov    %rax,-0x8(%rbp)
jmp    114c <time+0x3c>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112a <time+0x1a>
mov    %rdi,%rsi
mov    $0xb,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @time(i64* %0) {
%2 = alloca i64
%3 = alloca i64*
store i64* %0, i64** %3
%4 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%5 = icmp eq i32 %4, -559038737
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64*, i64** %3
%8 = call i64 @dcloadsyscall(i32 11, i64* %7)
store i64 %8, i64* %2
br label %10
9: ; preds = %1
store i64 -1, i64* %2
br label %10
10: ; preds = %9, %6
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
define i64 @time(i64* %0) {
%2 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%3 = icmp eq i32 %2, -559038737
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i64 @dcloadsyscall(i32 11, i64* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ %5, %4 ], [ -1, %1 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ back_key_up();
void front_key_up(void) { back_key_up(); }


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

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

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

LLVM IR (-O2):
define void @front_key_up() {
%1 = tail call i32 (...) @back_key_up()
ret void
}
void XcmsCIELabQueryMaxC() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIELabQueryMaxC() {
ret void
}
int os_disable_options(int fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @os_disable_options(i32 %0) {
ret i32 1
}
/* Variables and functions */
double calculate_angle(int, int);
int test_negative_angle() { return -215.0 == calculate_angle(9, 10); }


x86 assembly (clang, -O0):
<test_negative_angle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
mov    $0xa,%esi
call   1030 <calculate_angle@plt>
movaps %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_negative_angle>:
push   %rax
mov    $0x9,%edi
mov    $0xa,%esi
call   1030 <calculate_angle@plt>
cmpeqsd 0xed7(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_negative_angle() {
%1 = call double @calculate_angle(i32 9, i32 10)
%2 = fcmp oeq double -2.150000e+02, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_negative_angle() {
%1 = tail call double @calculate_angle(i32 9, i32 10)
%2 = fcmp oeq double %1, -2.150000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void qprint(const char *message) { printf("%s\n", message); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @qprint(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void blast_icache(void) { return; }


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

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

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

LLVM IR (-O2):
define void @blast_icache() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void is_ready(void) { printf("readyok\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"readyok\00"
define void @is_ready() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void sha256init(uint32_t *H) {
  H[0] = 0x6a09e667;
  H[1] = 0xbb67ae85;
  H[2] = 0x3c6ef372;
  H[3] = 0xa54ff53a;
  H[4] = 0x510e527f;
  H[5] = 0x9b05688c;
  H[6] = 0x1f83d9ab;
  H[7] = 0x5be0cd19;
}


x86 assembly (clang, -O0):
<sha256init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x6a09e667,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xbb67ae85,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3c6ef372,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0xa54ff53a,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x510e527f,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x9b05688c,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1f83d9ab,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5be0cd19,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha256init>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @sha256init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1779033703, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 -1150833019, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 1013904242, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 -1521486534, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 1359893119, i32* %12
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 5
store i32 -1694144372, i32* %14
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 6
store i32 528734635, i32* %16
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 7
store i32 1541459225, i32* %18
ret void
}

LLVM IR (-O2):
define void @sha256init(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1779033703, i32 -1150833019, i32 1013904242, i32 -1521486534>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 1359893119, i32 -1694144372, i32 528734635, i32 1541459225>, <4 x i32>* %4
ret void
}
void emit_restore_stack(int size) {}


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

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

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

LLVM IR (-O2):
define void @emit_restore_stack(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int amqp_is_power_of_two(uint32_t value) { return (value & (value - 1)) == 0; }


x86 assembly (clang, -O0):
<amqp_is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<amqp_is_power_of_two>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @amqp_is_power_of_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @amqp_is_power_of_two(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ test(char *, int, int);
int main(void) {
  int errors = 0;
  errors += test("5", 5, 10);
  errors += test("FFFFFFFFFFFFFFFF", 0xFFFFFFFFFFFFFFFFLL, 16);
  return errors;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
call   1030 <test@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0x10,%edx
call   1030 <test@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
call   1030 <test@plt>
mov    %rax,%rbx
lea    0xed1(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0x10,%edx
call   1030 <test@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"5\00"
@.str.1 = [17 x i8] c"FFFFFFFFFFFFFFFF\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 5, i32 10)
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = call i64 @test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 16)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"5\00"
@.str.1 = [17 x i8] c"FFFFFFFFFFFFFFFF\00"
define i32 @main() {
%1 = tail call i64 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 5, i32 10)
%2 = tail call i64 @test(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 16)
%3 = add i64 %2, %1
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int n2q(int n) {
  assert(n >= 3);
  if (n >= 10)
    return 3;
  else if (n >= 6)
    return 2;
  else
    return 1;
}


x86 assembly (clang, -O0):
<n2q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xa,-0x8(%rbp)
jl     1142 <n2q+0x32>
movl   $0x3,-0x4(%rbp)
jmp    115f <n2q+0x4f>
cmpl   $0x6,-0x8(%rbp)
jl     1158 <n2q+0x48>
movl   $0x2,-0x4(%rbp)
jmp    115f <n2q+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n2q>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x3,%ebx
setge  %dil
call   1030 <assert@plt>
xor    %ecx,%ecx
cmp    $0x6,%ebx
setge  %cl
add    $0x1,%ecx
cmp    $0xa,%ebx
mov    $0x3,%eax
cmovl  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @n2q(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 3
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 3, i32* %2
br label %16
11: ; preds = %1
%12 = load i32, i32* %3
%13 = icmp sge i32 %12, 6
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 2, i32* %2
br label %16
15: ; preds = %11
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @n2q(i32 %0) {
%2 = icmp sgt i32 %0, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp sgt i32 %0, 9
%6 = icmp sgt i32 %0, 5
%7 = select i1 %6, i32 2, i32 1
%8 = select i1 %5, i32 3, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int ttyOpen(char *name, int length) { return (open(name, O_RDWR)); }


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

x86 assembly (clang, -O2):
<ttyOpen>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @ttyOpen(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* @O_RDWR
%7 = call i32 @open(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @ttyOpen(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* %0, i32 %3)
ret i32 %4
}
void test_one(int x) {
#pragma omp target
#pragma omp teams distribute parallel for simd
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_one+0x2d>
jmp    111f <test_one+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_one+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_one(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int pthread_cond_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ strerror(int);
void checked_cond_destroy(pthread_cond_t *c) {
  int err = pthread_cond_destroy(c);
  if (err != 0) {
    errx(1, "Failed to destroy a condition variable: %s", strerror(err));
  }
}


x86 assembly (clang, -O0):
<checked_cond_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_cond_destroy@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116d <checked_cond_destroy+0x3d>
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe98(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_cond_destroy>:
push   %rax
call   1040 <pthread_cond_destroy@plt>
test   %eax,%eax
je     1155 <checked_cond_destroy+0x25>
mov    %eax,%edi
call   1050 <strerror@plt>
lea    0xeb8(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1030 <errx@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Failed to destroy a condition variable: %s\00"
define void @checked_cond_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_cond_destroy(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Failed to destroy a condition variable: %s\00"
define void @checked_cond_destroy(i32* %0) {
%2 = tail call i32 @pthread_cond_destroy(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @strerror(i32 %2)
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void ulint_put(unsigned long int number, FILE *stream) {
  if (number > (unsigned long int)9) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
    ulint_put(number / (unsigned long int)10, stream);
#pragma GCC diagnostic pop
  }
  fputc('0' + (char)(number % (unsigned long int)10), stream);
}


x86 assembly (clang, -O0):
<ulint_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x9,-0x8(%rbp)
jbe    1155 <ulint_put+0x35>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ulint_put@plt>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulint_put>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movabs $0xcccccccccccccccd,%r15
cc cc cc
cmp    $0xa,%rdi
jb     1150 <ulint_put+0x30>
mov    %rbx,%rax
mul    %r15
mov    %rdx,%rdi
shr    $0x3,%rdi
mov    %r14,%rsi
call   1040 <ulint_put@plt>
mov    %rbx,%rax
mul    %r15
shr    $0x2,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ebx
or     $0x30,%bl
movzbl %bl,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @ulint_put(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = icmp ugt i64 %5, 9
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i64, i64* %3
%9 = udiv i64 %8, 10
%10 = load i32*, i32** %4
br label %11
11: ; preds = %7, %2
%12 = load i64, i64* %3
%13 = urem i64 %12, 10
%14 = trunc i64 %13 to i8
%15 = sext i8 %14 to i32
%16 = add nsw i32 48, %15
%17 = trunc i32 %16 to i8
%18 = load i32*, i32** %4
%19 = call i32 @fputc(i8 signext %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @ulint_put(i64 %0, i32* nocapture %1) {
%3 = icmp ugt i64 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i64 %0, 10
tail call void @ulint_put(i64 %5, i32* %1)
br label %6
6: ; preds = %4, %2
%7 = urem i64 %0, 10
%8 = trunc i64 %7 to i8
%9 = or i8 %8, 48
%10 = tail call i32 @fputc(i8 signext %9, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ClearLine() { printf("\033[0K"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0K\00"
define void @ClearLine() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0K\00"
define void @ClearLine() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void EarlyDeviceSelection() {}


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

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

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

LLVM IR (-O2):
define void @EarlyDeviceSelection() {
ret void
}
int dtrtrs(char UPLO, char TRANS, char DIAG, int N, int NRHS, double *A,
           int LDA, double *B, int LDB, int *INFO) {
  extern int dtrtrs_(char *UPLO, char *TRANS, char *DIAG, int *N, int *NRHS,
                     double *A, int *LDA, double *B, int *LDB, int *INFO);
  return dtrtrs_(&UPLO, &TRANS, &DIAG, &N, &NRHS, A, &LDA, B, &LDB, INFO);
}


x86 assembly (clang, -O0):
<dtrtrs>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %dil,%sil
mov    0x28(%rbp),%rdi
mov    0x20(%rbp),%edi
mov    0x18(%rbp),%rdi
mov    0x10(%rbp),%edi
mov    %sil,-0x9(%rbp)
mov    %dl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%r9
mov    0x18(%rbp),%r11
mov    0x28(%rbp),%rax
lea    -0x9(%rbp),%rdi
lea    -0xa(%rbp),%rsi
lea    -0xb(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    0x10(%rbp),%rbx
lea    0x20(%rbp),%r10
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <dtrtrs_@plt>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtrtrs>:
push   %rbx
sub    $0x10,%rsp
mov    0x28(%rsp),%r10
mov    0x38(%rsp),%r11
mov    %dil,0x7(%rsp)
mov    %sil,0x6(%rsp)
mov    %dl,0x5(%rsp)
mov    %ecx,0xc(%rsp)
mov    %r8d,0x8(%rsp)
lea    0x30(%rsp),%rax
lea    0x20(%rsp),%rbx
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
lea    0x5(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
push   %r11
push   %rax
push   %r10
push   %rbx
call   1030 <dtrtrs_@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dtrtrs(i8 signext %0, i8 signext %1, i8 signext %2, i32 %3, i32 %4, double* %5, i32 %6, double* %7, i32 %8, i32* %9) {
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i32
%15 = alloca i32
%16 = alloca double*
%17 = alloca i32
%18 = alloca double*
%19 = alloca i32
%20 = alloca i32*
store i8 %0, i8* %11
store i8 %1, i8* %12
store i8 %2, i8* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store double* %5, double** %16
store i32 %6, i32* %17
store double* %7, double** %18
store i32 %8, i32* %19
store i32* %9, i32** %20
%21 = load double*, double** %16
%22 = load double*, double** %18
%23 = load i32*, i32** %20
%24 = call i32 @dtrtrs_(i8* %11, i8* %12, i8* %13, i32* %14, i32* %15, double* %21, i32* %17, double* %22, i32* %19, i32* %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @dtrtrs(i8 signext %0, i8 signext %1, i8 signext %2, i32 %3, i32 %4, double* %5, i32 %6, double* %7, i32 %8, i32* %9) {
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i8 %0, i8* %11
store i8 %1, i8* %12
store i8 %2, i8* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %6, i32* %16
store i32 %8, i32* %17
%18 = call i32 @dtrtrs_(i8* %11, i8* %12, i8* %13, i32* %14, i32* %15, double* %5, i32* %16, double* %7, i32* %17, i32* %9)
ret i32 %18
}
void gtk_progress_bar_style_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_progress_bar_style_get_type() {
ret void
}
void gtk_rc_style_unref() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_style_unref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GCSReceiverHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GCSReceiverRequestUpdate() { UAVObjRequestUpdate(GCSReceiverHandle()); }


x86 assembly (clang, -O0):
<GCSReceiverRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GCSReceiverHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCSReceiverRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <GCSReceiverHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @GCSReceiverRequestUpdate() {
%1 = call i32 (...) @GCSReceiverHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GCSReceiverRequestUpdate() {
%1 = tail call i32 (...) @GCSReceiverHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int __attribute__((no)) f2(int i) { return i + 6; }


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

x86 assembly (clang, -O2):
<f2>:
lea    0x6(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = add nsw i32 %0, 6
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ WriteSEQ(int, int /*<<< orphan*/);
extern void SetOldMode(void) { WriteSEQ(0xB, 0); }


x86 assembly (clang, -O0):
<SetOldMode>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
xor    %esi,%esi
call   1030 <WriteSEQ@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetOldMode>:
mov    $0xb,%edi
xor    %esi,%esi
jmp    1030 <WriteSEQ@plt>

LLVM IR (-O0):
define void @SetOldMode() {
%1 = call i32 @WriteSEQ(i32 11, i32 0)
ret void
}

LLVM IR (-O2):
define void @SetOldMode() {
%1 = tail call i32 @WriteSEQ(i32 11, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Anim(void) { WriteInstruction("call animsp"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"call animsp\00"
define void @CR_Anim() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *memchr(char const *, char, size_t);
size_t strnlen(const char *string, size_t maxlen) {
  const char *end = memchr(string, '\0', maxlen);
  return end ? (size_t)(end - string) : maxlen;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <strnlen+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <strnlen+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @memchr(i8* %6, i8 signext 0, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
br label %19
17: ; preds = %2
%18 = load i64, i64* %4
br label %19
19: ; preds = %17, %11
%20 = phi i64 [ %16, %11 ], [ %18, %17 ]
ret i64 %20
}

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i8 signext 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void ErrorOut(char *message) {
  printf("%s", message);
  exit(0);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @ErrorOut(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ psdes_hash_64(unsigned int *, unsigned int *);
unsigned iran32_r(unsigned *pstate0, unsigned *pstate1) {
  unsigned word0 = *pstate0;
  unsigned word1 = *pstate1;
  psdes_hash_64(&word0, &word1);
  (*pstate1)++;
  if (*pstate1 == 0)
    (*pstate0)++;
  return word1;
}


x86 assembly (clang, -O0):
<iran32_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <psdes_hash_64@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1162 <iran32_r+0x52>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iran32_r>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%eax
mov    %eax,0x4(%rsp)
mov    (%rsi),%eax
mov    %eax,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <psdes_hash_64@plt>
addl   $0x1,(%rbx)
jne    113b <iran32_r+0x2b>
addl   $0x1,(%r14)
mov    (%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @iran32_r(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = call i32 @psdes_hash_64(i32* %5, i32* %6)
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = add i32 %13, 1
store i32 %14, i32* %12
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i32*, i32** %3
%20 = load i32, i32* %19
%21 = add i32 %20, 1
store i32 %21, i32* %19
br label %22
22: ; preds = %18, %2
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @iran32_r(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = load i32, i32* %0
store i32 %6, i32* %3
%7 = bitcast i32* %4 to i8*
%8 = load i32, i32* %1
store i32 %8, i32* %4
%9 = call i32 @psdes_hash_64(i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = add i32 %10, 1
store i32 %11, i32* %1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %0
%15 = add i32 %14, 1
store i32 %15, i32* %0
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* %4
ret i32 %17
}
/* Variables and functions */
int f_listen(int, int);
int /*<<< orphan*/ printf(char *, char *, int);
int listen(int fd, int backlog) {
  (void)(3 >= 4 ? printf("%slisten(fd=%d)", "\n:: [CALL]\t", fd) : 0);
  if (0) {
    return f_listen(fd, backlog);
  }
  return f_listen(fd, backlog);
}


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

x86 assembly (clang, -O2):
<listen>:
jmp    1030 <f_listen@plt>

LLVM IR (-O0):
define i32 @listen(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 @f_listen(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @listen(i32 %0, i32 %1) {
%3 = tail call i32 @f_listen(i32 %0, i32 %1)
ret i32 %3
}
int roll(int max) {
  long lrand48();
  return (int)lrand48() % max;
}


x86 assembly (clang, -O0):
<roll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lrand48@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <lrand48@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @roll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @lrand48()
%4 = trunc i64 %3 to i32
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @roll(i32 %0) {
%2 = tail call i64 (...) @lrand48()
%3 = trunc i64 %2 to i32
%4 = srem i32 %3, %0
ret i32 %4
}
void inc_zcache_eph_nonactive_puts_ignored(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_eph_nonactive_puts_ignored() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, char const *);
void send_status(FILE *client, int code, const char *reason_phrase) {
  fprintf(client, "HTTP/1.1 %d %s\r\n", code, reason_phrase);
  fflush(client);
}


x86 assembly (clang, -O0):
<send_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_status>:
push   %rbx
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"HTTP/1.1 %d %s\0D\0A\00"
define void @send_status(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
%11 = load i32*, i32** %4
%12 = call i32 @fflush(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"HTTP/1.1 %d %s\0D\0A\00"
define void @send_status(i32* nocapture %0, i32 %1, i8* %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = tail call i32 @fflush(i32* %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool s2010_get_following(const uint16_t *p_s2010) { return p_s2010[0] & 0x02; }


x86 assembly (clang, -O0):
<s2010_get_following>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2010_get_following>:
mov    (%rdi),%eax
and    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @s2010_get_following(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @s2010_get_following(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 2
ret i32 %3
}
const char *opj_version() { return "1.3.0"; }


x86 assembly (clang, -O0):
<opj_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.3.0\00"
define i8* @opj_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.3.0\00"
define i8* @opj_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int bits_count(unsigned x) {
  int res = 0;
  for (; x != 0; res++, x &= x - 1)
    ;
  return res;
}


x86 assembly (clang, -O0):
<bits_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1137 <bits_count+0x37>
jmp    111d <bits_count+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bits_count+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_count>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bits_count+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bits_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @bits_count(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int calculat_group_numbers(int, int);
int test_calculat_group_numbers(int start, int width) {
  return calculat_group_numbers(start, width);
}


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

x86 assembly (clang, -O2):
<test_calculat_group_numbers>:
jmp    1030 <calculat_group_numbers@plt>

LLVM IR (-O0):
define i32 @test_calculat_group_numbers(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 @calculat_group_numbers(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_calculat_group_numbers(i32 %0, i32 %1) {
%3 = tail call i32 @calculat_group_numbers(i32 %0, i32 %1)
ret i32 %3
}