xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int ac, char *av[]) {
  printf("Hello, World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ init_list_head(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *new) {
  list_replace(old, new);
  init_list_head(old);
}


x86 assembly (clang, -O0):
<list_replace_init>:
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   1040 <list_replace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <init_list_head@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <init_list_head@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @init_list_head(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @init_list_head(%struct.list_head* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
lnot() {
  ol("testl %eax,%eax");
  ol("sete %al");
  ol("movzbl %al, %eax");
}


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

x86 assembly (clang, -O2):
<lnot>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xeec(%rip),%rdi
call   1030 <ol@plt>
lea    0xee9(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"testl %eax,%eax\00"
@.str.1 = [9 x i8] c"sete %al\00"
@.str.2 = [17 x i8] c"movzbl %al, %eax\00"
define i32 @lnot() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"testl %eax,%eax\00"
@.str.1 = [9 x i8] c"sete %al\00"
@.str.2 = [17 x i8] c"movzbl %al, %eax\00"
define i32 @lnot() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int openexec_open64(char const *, int, int /*<<< orphan*/);
int open64(const char *pathname, int flags, mode_t mode) {
  return openexec_open64(pathname, flags, mode);
}


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

x86 assembly (clang, -O2):
<open64>:
jmp    1030 <openexec_open64@plt>

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

LLVM IR (-O2):
define i32 @open64(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @openexec_open64(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int utf8_fromunicode(char *, int);
int utf8_getchars(char *buf, int c) { return utf8_fromunicode(buf, c); }


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

x86 assembly (clang, -O2):
<utf8_getchars>:
jmp    1030 <utf8_fromunicode@plt>

LLVM IR (-O0):
define i32 @utf8_getchars(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 i32 @utf8_fromunicode(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @utf8_getchars(i8* %0, i32 %1) {
%3 = tail call i32 @utf8_fromunicode(i8* %0, i32 %1)
ret i32 %3
}
int tl_num_nodes_vertices(const int ntaxa) { return ntaxa - 1; }


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

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

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

LLVM IR (-O2):
define i32 @tl_num_nodes_vertices(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_port(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
uint8_t get_port_polarity(uint8_t address, uint8_t port) {
  return get_port(address, port, 0x02, 0x03);
}


x86 assembly (clang, -O0):
<get_port_polarity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <get_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_port_polarity>:
mov    $0x2,%edx
mov    $0x3,%ecx
jmp    1030 <get_port@plt>

LLVM IR (-O0):
define i32 @get_port_polarity(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 @get_port(i32 %5, i32 %6, i32 2, i32 3)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_port_polarity(i32 %0, i32 %1) {
%3 = tail call i32 @get_port(i32 %0, i32 %1, i32 2, i32 3)
ret i32 %3
}
/* Variables and functions */
char *strchr(char *, char);
char *t8(void) { return strchr("hello, world", 'w'); }


x86 assembly (clang, -O0):
<t8>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x77,%esi
call   1030 <strchr@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello, world\00"
define i8* @t8() {
%1 = call i8* @strchr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext 119)
ret i8* %1
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
define i8* @t8() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 7)
}
/* Variables and functions */
int /*<<< orphan*/ reset_keypress();
void endprg(void) { reset_keypress(); }


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

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

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

LLVM IR (-O2):
define void @endprg() {
%1 = tail call i32 (...) @reset_keypress()
ret void
}
/* Variables and functions */
int diminuto_ipc_shutdown(int);
int diminuto_ipc6_shutdown(int fd) { return diminuto_ipc_shutdown(fd); }


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

x86 assembly (clang, -O2):
<diminuto_ipc6_shutdown>:
jmp    1030 <diminuto_ipc_shutdown@plt>

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

LLVM IR (-O2):
define i32 @diminuto_ipc6_shutdown(i32 %0) {
%2 = tail call i32 @diminuto_ipc_shutdown(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ div();
int /*<<< orphan*/ ol(char *);
zmod() {
  div();
  ol("movl %edx, %eax");
}


x86 assembly (clang, -O0):
<zmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <div@plt>
lea    0xeca(%rip),%rdi
call   1040 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmod>:
push   %rax
xor    %eax,%eax
call   1030 <div@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <ol@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"movl %edx, %eax\00"
define i32 @zmod() {
%1 = alloca i32
%2 = call i32 (...) @div()
%3 = call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"movl %edx, %eax\00"
define i32 @zmod() {
%1 = tail call i32 (...) @div()
%2 = tail call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void audioDeinit() {}


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

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

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

LLVM IR (-O2):
define void @audioDeinit() {
ret void
}
int nlowest_zero(int n) { return ~((1 << n) - 1); }


x86 assembly (clang, -O0):
<nlowest_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlowest_zero>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @nlowest_zero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = sub nsw i32 %4, 1
%6 = xor i32 %5, -1
ret i32 %6
}

LLVM IR (-O2):
define i32 @nlowest_zero(i32 %0) {
%2 = shl nsw i32 -1, %0
ret i32 %2
}
int gap(int l) {
  if (l == 0)
    return (0);
  if (l == 1)
    return (-50);
  if (l == 2)
    return (-65);
  if (l >= 3)
    return (-27 * l);
}


x86 assembly (clang, -O0):
<gap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <gap+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    115d <gap+0x5d>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <gap+0x33>
movl   $0xffffffce,-0x4(%rbp)
jmp    115d <gap+0x5d>
cmpl   $0x2,-0x8(%rbp)
jne    1149 <gap+0x49>
movl   $0xffffffbf,-0x4(%rbp)
jmp    115d <gap+0x5d>
cmpl   $0x3,-0x8(%rbp)
jl     115d <gap+0x5d>
imul   $0xffffffe5,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gap>:
cmp    $0x3,%edi
jae    1113 <gap+0x13>
movslq %edi,%rax
lea    0xef1(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret
imul   $0xffffffe5,%edi,%eax
ret

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

LLVM IR (-O2):
@switch.table.gap = [3 x i32] [i32 0, i32 -50, i32 -65]
define i32 @gap(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 2
%5 = mul nsw i32 %0, -27
%6 = select i1 %4, i32 %5, i32 undef
br label %11
7: ; preds = %1
%8 = sext i32 %0 to i64
%9 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.gap, i64 0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %7, %3
%12 = phi i32 [ %6, %3 ], [ %10, %7 ]
ret i32 %12
}
float fclamp(float n, float a, float b) {
  if (n > b)
    return b;
  if (n < a)
    return a;
  return n;
}


x86 assembly (clang, -O0):
<fclamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1131 <fclamp+0x31>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <fclamp+0x5d>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1153 <fclamp+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <fclamp+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclamp>:
maxss  %xmm0,%xmm1
movaps %xmm2,%xmm3
cmpltss %xmm0,%xmm3
movaps %xmm3,%xmm0
andnps %xmm1,%xmm0
andps  %xmm2,%xmm3
orps   %xmm0,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @fclamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %7
%10 = fcmp ogt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %7
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %6
%16 = fcmp olt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %6
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @fclamp(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %2
%5 = fcmp olt float %0, %1
%6 = select i1 %5, float %1, float %0
%7 = select i1 %4, float %2, float %6
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void random_seed(uint seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<random_seed>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @random_seed(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
/* Variables and functions */
size_t strcspn(const char *s1, const char *s2) {
  size_t n;
  for (n = 0; s1[n] != '\0'; ++n) {
    if (s1[n] == s2[n]) {
      break;
    }
  }
  return n;
}


x86 assembly (clang, -O0):
<strcspn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <strcspn+0x64>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114e <strcspn+0x4e>
jmp    1164 <strcspn+0x64>
jmp    1153 <strcspn+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcspn+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcspn>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <strcspn+0x22>
nopl   0x0(%rax,%rax,1)
cmp    (%rsi,%rax,1),%cl
je     1122 <strcspn+0x22>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcspn+0x10>
ret

LLVM IR (-O0):
define i64 @strcspn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
store i64 0, i64* %5
br label %6
6: ; preds = %27, %2
%7 = load i8*, i8** %3
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %30
13: ; preds = %6
%14 = load i8*, i8** %3
%15 = load i64, i64* %5
%16 = getelementptr inbounds i8, i8* %14, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i8*, i8** %4
%20 = load i64, i64* %5
%21 = getelementptr inbounds i8, i8* %19, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %18, %23
br i1 %24, label %25, label %26
25: ; preds = %13
br label %30
26: ; preds = %13
br label %27
27: ; preds = %26
%28 = load i64, i64* %5
%29 = add i64 %28, 1
store i64 %29, i64* %5
br label %6
30: ; preds = %25, %6
%31 = load i64, i64* %5
ret i64 %31
}

LLVM IR (-O2):
define i64 @strcspn(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i64 [ %12, %11 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %6, %9
br i1 %10, label %16, label %11
11: ; preds = %5
%12 = add i64 %7, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11, %5, %2
%17 = phi i64 [ 0, %2 ], [ %7, %5 ], [ %12, %11 ]
ret i64 %17
}
int ptr2intpad(int *ptr) {
  int alignment = (((int)ptr) & 63) >> 2;
  if (alignment)
    return 16 - alignment;
  else
    return 0;
}


x86 assembly (clang, -O0):
<ptr2intpad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3f,%eax
sar    $0x2,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     112f <ptr2intpad+0x2f>
mov    $0x10,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <ptr2intpad+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr2intpad>:
shr    $0x2,%edi
and    $0xf,%edi
mov    $0x10,%eax
sub    %edi,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ptr2intpad(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
%4 = lshr i32 %3, 2
%5 = and i32 %4, 15
%6 = icmp eq i32 %5, 0
%7 = sub nuw nsw i32 16, %5
%8 = select i1 %6, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int japi_getcolumns(int);
int j_getcolumns(int arg0) { return (japi_getcolumns(arg0)); }


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

x86 assembly (clang, -O2):
<j_getcolumns>:
jmp    1030 <japi_getcolumns@plt>

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

LLVM IR (-O2):
define i32 @j_getcolumns(i32 %0) {
%2 = tail call i32 @japi_getcolumns(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ extension(char *);
int /*<<< orphan*/ *strstr(int /*<<< orphan*/, char *);
int extension_substring_filter(char *filename, char *textcontent) {
  if (strstr(extension(filename), textcontent) == NULL)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<extension_substring_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <extension@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
jne    115a <extension_substring_filter+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1161 <extension_substring_filter+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extension_substring_filter>:
push   %rbx
mov    %rsi,%rbx
call   1030 <extension@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @extension_substring_filter(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i32 @extension(i8* %6)
%8 = load i8*, i8** %5
%9 = call i32* @strstr(i32 %7, i8* %8)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %13
12: ; preds = %2
store i32 1, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @extension_substring_filter(i8* %0, i8* %1) {
%3 = tail call i32 @extension(i8* %0)
%4 = tail call i32* @strstr(i32 %3, i8* %1)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
void RMotorPwm_RestoreConfig(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
void _delay_ms(uint32_t __ms) { _delay_us(__ms * 1000); }


x86 assembly (clang, -O0):
<_delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <_delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_delay_ms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <_delay_us@plt>

LLVM IR (-O0):
define void @_delay_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @_delay_us(i32 %4)
ret void
}

LLVM IR (-O2):
define void @_delay_ms(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @_delay_us(i32 %2)
ret void
}
/* Type definitions */
struct xdg_popup {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/);
void xdg_popup_destroy(struct xdg_popup *xdg_popup) {
  wl_proxy_marshal((struct wl_proxy *)xdg_popup, 0);
  wl_proxy_destroy((struct wl_proxy *)xdg_popup);
}


x86 assembly (clang, -O0):
<xdg_popup_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wl_proxy_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdg_popup_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.xdg_popup = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_popup_destroy(%struct.xdg_popup* %0) {
%2 = alloca %struct.xdg_popup*
store %struct.xdg_popup* %0, %struct.xdg_popup** %2
%3 = load %struct.xdg_popup*, %struct.xdg_popup** %2
%4 = bitcast %struct.xdg_popup* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 0)
%6 = load %struct.xdg_popup*, %struct.xdg_popup** %2
%7 = bitcast %struct.xdg_popup* %6 to %struct.wl_proxy*
%8 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %7)
ret void
}

LLVM IR (-O2):
%struct.xdg_popup = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_popup_destroy(%struct.xdg_popup* %0) {
%2 = bitcast %struct.xdg_popup* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 0)
%4 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
int moocow(void) {
  int a;
  a = 3;
  while (a < 3)
    a++;
  if (a % 54 == 0) {
    a++;
  } else {
    a--;
  }
}


x86 assembly (clang, -O0):
<moocow>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1123 <moocow+0x23>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <moocow+0xb>
mov    -0x8(%rbp),%eax
mov    $0x36,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1145 <moocow+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <moocow+0x4e>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @moocow() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ archdep_startup_log_error(char *, char const *);
void init_resource_fail(const char *module) {
  archdep_startup_log_error("Cannot initialize %s resources.\n", module);
}


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

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

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

LLVM IR (-O2):
@.str = [33 x i8] c"Cannot initialize %s resources.\0A\00"
define void @init_resource_fail(i8* %0) {
%2 = tail call i32 @archdep_startup_log_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int searchInsert(int *, int, int);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  int nums[] = {1, 3, 5, 6};
  int index = searchInsert(nums, 4, 7);
  printf("最合适的位置:%d\n", index);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xee5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x7,%edx
call   1040 <searchInsert@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x7,%edx
call   1050 <searchInsert@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@__const.main.nums = [4 x i32] [i32 1, i32 3, i32 5, i32 6]
@.str.1 = [23 x i8] c"\E6\9C\80\E5\90\88\E9\80\82\E7\9A\84\E4\BD\8D\E7\BD\AE:%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = bitcast [4 x i32]* %6 to i8*
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%11 = call i32 @searchInsert(i32* %10, i32 4, i32 7)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [4 x i32] [i32 1, i32 3, i32 5, i32 6]
@.str.1 = [23 x i8] c"\E6\9C\80\E5\90\88\E9\80\82\E7\9A\84\E4\BD\8D\E7\BD\AE:%d\0A\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i32]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = bitcast [4 x i32]* %3 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%7 = call i32 @searchInsert(i32* %6, i32 4, i32 7)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
void to_string(FILE *output, char *key, void *value) {
  fprintf(output, "%-30s%s\n", key, (char *)value);
}


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

x86 assembly (clang, -O2):
<to_string>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%-30s%s\0A\00"
define void @to_string(i32* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
void deallocate_ErrorTxn(struct ErrorTxn *v) {}


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

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

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

LLVM IR (-O2):
%struct.ErrorTxn = type opaque
define void @deallocate_ErrorTxn(%struct.ErrorTxn* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  Display *dpy;
  dpy = XOpenDisplay(":1.0");
  for (;;) {
    printf("still alive\n");
    sleep(2);
  }
  XCloseDisplay(dpy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <XOpenDisplay@plt>
mov    %rax,-0x10(%rbp)
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    114f <main+0x1f>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <XOpenDisplay@plt>
lea    0xec1(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [5 x i8] c":1.0\00"
@.str.1 = [13 x i8] c"still alive\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @XOpenDisplay(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32* %3, i32** %2
br label %4
4: ; preds = %4, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @sleep(i32 2)
br label %4
}

LLVM IR (-O2):
@.str = [5 x i8] c":1.0\00"
@str = [12 x i8] c"still alive\00"
define i32 @main() {
%1 = tail call i32* @XOpenDisplay(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 2)
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_rwlock_tryrdlock(pthread_rwlock_t *a) { assert(0); }


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

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

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

LLVM IR (-O2):
define i32 @pthread_rwlock_tryrdlock(i32* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int strlen(char *);
int lineread(FILE *stream, char *buf, int count) {
  fgets(buf, count, stream);
  if (!feof(stream))
    return (strlen(buf));
  else
    return (0);
}


x86 assembly (clang, -O0):
<lineread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
jne    1176 <lineread+0x46>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    117d <lineread+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineread>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
je     115d <lineread+0x2d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @lineread(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32 @fgets(i8* %1, i32 %2, i32* %0)
%5 = tail call i32 @feof(i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @strlen(i8* %1)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ 0, %3 ]
ret i32 %10
}
void xmlNoValidityErr(void *ctx __attribute__((unused)),
                      const char *msg __attribute__((unused)), ...) {
  return;
}


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

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

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

LLVM IR (-O2):
define void @xmlNoValidityErr(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
size_t dt_char_span_until(unsigned char const *, size_t, unsigned char);
size_t dt_char_skip_until(const unsigned char **src, size_t len,
                          unsigned char mask) {
  *src += len = dt_char_span_until(*src, len, mask);
  return len;
}


x86 assembly (clang, -O0):
<dt_char_skip_until>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%edx
call   1030 <dt_char_span_until@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_char_skip_until>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <dt_char_span_until@plt>
add    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i64 @dt_char_skip_until(i8** %0, i64 %1, i8 zeroext %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i8
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i64, i64* %5
%10 = load i8, i8* %6
%11 = call i64 @dt_char_span_until(i8* %8, i64 %9, i8 zeroext %10)
store i64 %11, i64* %5
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 %11
store i8* %14, i8** %12
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @dt_char_skip_until(i8** nocapture %0, i64 %1, i8 zeroext %2) {
%4 = load i8*, i8** %0
%5 = tail call i64 @dt_char_span_until(i8* %4, i64 %1, i8 zeroext %2)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 %5
store i8* %7, i8** %0
ret i64 %5
}
void backtrace_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @backtrace_handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ print_num(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  print_num(getpid());
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @print_num(i32 %3)
ret i32 0
}
/* Variables and functions */
unsigned int FE_HAS_LOCK;
int /*<<< orphan*/ FE_READ_STATUS;
int ioctl(int, int /*<<< orphan*/, unsigned int *);
int frontend_locked(int fefd) {
  unsigned int status;
  if (ioctl(fefd, FE_READ_STATUS, &status) == -1) {
    return -1;
  }
  if (status & FE_HAS_LOCK) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<frontend_locked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    1145 <frontend_locked+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <frontend_locked+0x5d>
mov    -0xc(%rbp),%eax
mov    0x2e99(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1166 <frontend_locked+0x56>
movl   $0x0,-0x4(%rbp)
jmp    116d <frontend_locked+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frontend_locked>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
je     113d <frontend_locked+0x2d>
mov    0x2eb8(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,0x4(%rsp)
sete   %al
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FE_READ_STATUS = global i32 0
@FE_HAS_LOCK = global i32 0
define i32 @frontend_locked(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @FE_READ_STATUS
%7 = call i32 @ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %17
10: ; preds = %1
%11 = load i32, i32* %4
%12 = load i32, i32* @FE_HAS_LOCK
%13 = and i32 %11, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 0, i32* %2
br label %17
16: ; preds = %10
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@FE_READ_STATUS = global i32 0
@FE_HAS_LOCK = global i32 0
define i32 @frontend_locked(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @FE_READ_STATUS
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %13, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = load i32, i32* @FE_HAS_LOCK
%10 = and i32 %9, %8
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %1
%14 = phi i32 [ -1, %1 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void *print_usage(int argc, char *argv[]) {
  printf("Usage: %s serial|parallel num_tasks\n", argv[0]);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: %s serial|parallel num_tasks\0A\00"
define i8* @print_usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [37 x i8] c"Usage: %s serial|parallel num_tasks\0A\00"
define noalias i8* @print_usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int c) {
  return (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') || isdigit(c);
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1134 <isxdigit+0x24>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115f <isxdigit+0x4f>
cmpl   $0x41,-0x4(%rbp)
jl     114d <isxdigit+0x3d>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    115f <isxdigit+0x4f>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x41(%rdi),%ecx
cmp    $0x25,%ecx
ja     112e <isxdigit+0x1e>
mov    $0x1,%eax
movabs $0x3f0000003f,%rdx
bt     %rcx,%rdx
jae    112e <isxdigit+0x1e>
ret
push   %rax
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 102
br i1 %7, label %18, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 70
br i1 %13, label %18, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = call i64 @isdigit(i32 %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %14, %11, %5
%19 = phi i1 [ true, %11 ], [ true, %5 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
switch i32 %0, label %2 [
i32 102, label %6
i32 101, label %6
i32 100, label %6
i32 99, label %6
i32 98, label %6
i32 97, label %6
i32 70, label %6
i32 69, label %6
i32 68, label %6
i32 67, label %6
i32 66, label %6
i32 65, label %6
]
2: ; preds = %1
%3 = tail call i64 @isdigit(i32 %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%7 = phi i32 [ %5, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %7
}
int cairo_code_draw_envChannelLabel_get_height() { return 65; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envChannelLabel_get_height() {
ret i32 65
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envChannelLabel_get_height() {
ret i32 65
}
void test45_Test6_pollen__run__E() {}


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

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

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

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