xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: hwsim_test [-D<DSCP>] [-t<tos>] <ifname1> <ifname2>\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"usage: hwsim_test [-D<DSCP>] [-t<tos>] <ifname1> <ifname2>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"usage: hwsim_test [-D<DSCP>] [-t<tos>] <ifname1> <ifname2>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}
void BSP_ISR_Init(void) {
  (*(volatile unsigned *)0x4a000004) = 0x0;
  (*(volatile unsigned *)0x4a000008) = (0xffffffff);
}


x86 assembly (clang, -O0):
<BSP_ISR_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4a000004,%eax
movl   $0x0,(%rax)
mov    $0x4a000008,%eax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_ISR_Init>:
movl   $0x0,0x4a000004
movl   $0xffffffff,0x4a000008
ff ff ff ff
ret

LLVM IR (-O0):
define void @BSP_ISR_Init() {
store volatile i32 0, i32* inttoptr (i64 1241513988 to i32*)
store volatile i32 -1, i32* inttoptr (i64 1241513992 to i32*)
ret void
}

LLVM IR (-O2):
define void @BSP_ISR_Init() {
store volatile i32 0, i32* inttoptr (i64 1241513988 to i32*)
store volatile i32 -1, i32* inttoptr (i64 1241513992 to i32*)
ret void
}
int tls_write(const char *buffer, int length) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @tls_write(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef struct sockaddr socklen_t;

/* Variables and functions */
int /*<<< orphan*/ mcfi_sandbox_mask(struct sockaddr *);
int socketcall(int (*)(int, struct sockaddr *, struct sockaddr *), int,
               int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/);
int getsockname(int fd, struct sockaddr *restrict addr,
                socklen_t *restrict len) {
  return socketcall(getsockname, fd, mcfi_sandbox_mask(addr),
                    mcfi_sandbox_mask(len), 0, 0, 0);
}


x86 assembly (clang, -O0):
<getsockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mcfi_sandbox_mask@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <mcfi_sandbox_mask@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    0x2e83(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockname>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1040 <mcfi_sandbox_mask@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <mcfi_sandbox_mask@plt>
movl   $0x0,(%rsp)
mov    0x2e92(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <socketcall@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @getsockname(i32 %0, %struct.sockaddr* noalias %1, %struct.sockaddr* noalias %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca %struct.sockaddr*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store %struct.sockaddr* %2, %struct.sockaddr** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = call i32 @mcfi_sandbox_mask(%struct.sockaddr* %8)
%10 = load %struct.sockaddr*, %struct.sockaddr** %6
%11 = call i32 @mcfi_sandbox_mask(%struct.sockaddr* %10)
%12 = call i32 @socketcall(i32 (i32, %struct.sockaddr*, %struct.sockaddr*)* @getsockname, i32 %7, i32 %9, i32 %11, i32 0, i32 0, i32 0)
ret i32 %12
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @getsockname(i32 %0, %struct.sockaddr* noalias %1, %struct.sockaddr* noalias %2) {
%4 = tail call i32 @mcfi_sandbox_mask(%struct.sockaddr* %1)
%5 = tail call i32 @mcfi_sandbox_mask(%struct.sockaddr* %2)
%6 = tail call i32 @socketcall(i32 (i32, %struct.sockaddr*, %struct.sockaddr*)* @getsockname, i32 %0, i32 %4, i32 %5, i32 0, i32 0, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ bufferTest();
int main() {
  bufferTest();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bufferTest()
ret i32 0
}
/* Variables and functions */
void *malloc(int);
int main(int argc, char **argv) {
  void *p = malloc(16);
  ((char *)p)[0] = **argv;
  ((char *)p)[16] = ((char *)p)[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x10(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct hash_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ checking_strdup(char const *);
scalar_t__ hash_table_contains(struct hash_table *, char const *);
int /*<<< orphan*/ hash_table_put(struct hash_table *, int /*<<< orphan*/,
                                  char *);
void string_set_add(struct hash_table *ht, const char *s) {
  if (hash_table_contains(ht, s))
    return;
  hash_table_put(ht, checking_strdup(s), "1");
}


x86 assembly (clang, -O0):
<string_set_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <hash_table_contains@plt>
cmp    $0x0,%rax
je     115c <string_set_add+0x2c>
jmp    117f <string_set_add+0x4f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <checking_strdup@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
lea    0xe86(%rip),%rdx
call   1050 <hash_table_put@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_set_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <hash_table_contains@plt>
test   %rax,%rax
je     114c <string_set_add+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
call   1040 <checking_strdup@plt>
lea    0xea5(%rip),%rdx
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <hash_table_put@plt>

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

LLVM IR (-O2):
%struct.hash_table = type { i32 }
@.str = [2 x i8] c"1\00"
define void @string_set_add(%struct.hash_table* %0, i8* %1) {
%3 = tail call i64 @hash_table_contains(%struct.hash_table* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @checking_strdup(i8* %1)
%7 = tail call i32 @hash_table_put(%struct.hash_table* %0, i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
scalar_t__ Char_3d_array(int, int, int);
double ***Double_3d_array(int i_size, int j_size, int k_size) {
  return ((double ***)Char_3d_array(i_size, j_size, k_size * sizeof(double)));
}


x86 assembly (clang, -O0):
<Double_3d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <Char_3d_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double_3d_array>:
shl    $0x3,%edx
jmp    1030 <Char_3d_array@plt>

LLVM IR (-O0):
define double*** @Double_3d_array(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i64 @Char_3d_array(i32 %7, i32 %8, i32 %12)
%14 = inttoptr i64 %13 to double***
ret double*** %14
}

LLVM IR (-O2):
define double*** @Double_3d_array(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i64 @Char_3d_array(i32 %0, i32 %1, i32 %4)
%6 = inttoptr i64 %5 to double***
ret double*** %6
}
/* Variables and functions */
scalar_t__ numeric(unsigned char const *, int const, int /*<<< orphan*/, int,
                   int, int *, int *, char *);
int n6(const unsigned char *data, const int data_len, int *p_err_no,
       int *p_err_posn, char err_msg[50]) {
  return data_len == 6 &&
         numeric(data, data_len, 0, 6, 6, p_err_no, p_err_posn, err_msg);
}


x86 assembly (clang, -O0):
<n6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0x6,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jne    1170 <n6+0x60>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0x6,%r8d
mov    %r8d,%ecx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <numeric@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n6>:
xor    %eax,%eax
cmp    $0x6,%esi
jne    114f <n6+0x3f>
push   %rax
mov    %r8,%r11
mov    %rcx,%r10
mov    %rdx,%r9
mov    $0x6,%esi
xor    %edx,%edx
mov    $0x6,%ecx
mov    $0x6,%r8d
push   %r11
push   %r10
call   1030 <numeric@plt>
add    $0x10,%rsp
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @n6(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 6
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = load i32*, i32** %8
%17 = load i32*, i32** %9
%18 = load i8*, i8** %10
%19 = call i64 @numeric(i8* %14, i32 %15, i32 0, i32 6, i32 6, i32* %16, i32* %17, i8* %18)
%20 = icmp ne i64 %19, 0
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ false, %5 ], [ %20, %13 ]
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @n6(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = icmp eq i32 %1, 6
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = tail call i64 @numeric(i8* %0, i32 6, i32 0, i32 6, i32 6, i32* %2, i32* %3, i8* %4)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ 0, %5 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/, int,
                           int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void init_script() {
  setvbuf(stdin, 0, 2, 0);
  setvbuf(stdout, 0, 2, 0);
  alarm(120);
}


x86 assembly (clang, -O0):
<init_script>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
mov    $0x2,%edx
mov    %ecx,%esi
call   1040 <setvbuf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
mov    $0x2,%edx
mov    %ecx,%esi
call   1040 <setvbuf@plt>
mov    $0x78,%edi
call   1030 <alarm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_script>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x78,%edi
pop    %rax
jmp    1030 <alarm@plt>

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
define void @init_script() {
%1 = load i32, i32* @stdin
%2 = call i32 @setvbuf(i32 %1, i32 0, i32 2, i32 0)
%3 = load i32, i32* @stdout
%4 = call i32 @setvbuf(i32 %3, i32 0, i32 2, i32 0)
%5 = call i32 @alarm(i32 120)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define void @init_script() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @setvbuf(i32 %1, i32 0, i32 2, i32 0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @setvbuf(i32 %3, i32 0, i32 2, i32 0)
%5 = tail call i32 @alarm(i32 120)
ret void
}
/* Variables and functions */
int gen_modify_stack(int);
int gen_defer_modify_stack(int newstkp) { return gen_modify_stack(newstkp); }


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

x86 assembly (clang, -O2):
<gen_defer_modify_stack>:
jmp    1030 <gen_modify_stack@plt>

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

LLVM IR (-O2):
define i32 @gen_defer_modify_stack(i32 %0) {
%2 = tail call i32 @gen_modify_stack(i32 %0)
ret i32 %2
}
void gtk_paint_polygon() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *kcn_key_concat(int, char *const *);
int kcn_search(struct kcn_info *, char *);
bool kcn_searchv(struct kcn_info *ki, int keyc, char *const keyv[]) {
  bool rc;
  char *keys;
  keys = kcn_key_concat(keyc, keyv);
  if (keys == NULL)
    return false;
  rc = kcn_search(ki, keys);
  free(keys);
  return rc;
}


x86 assembly (clang, -O0):
<kcn_searchv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <kcn_key_concat@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    116a <kcn_searchv+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1189 <kcn_searchv+0x59>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <kcn_search@plt>
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcn_searchv>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %esi,%edi
mov    %rdx,%rsi
call   1030 <kcn_key_concat@plt>
test   %rax,%rax
je     1162 <kcn_searchv+0x32>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <kcn_search@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %ebp,%eax
jmp    1164 <kcn_searchv+0x34>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.kcn_info = type { i32 }
define i32 @kcn_searchv(%struct.kcn_info* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.kcn_info*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i8*
store %struct.kcn_info* %0, %struct.kcn_info** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%10 = load i32, i32* %6
%11 = load i8**, i8*** %7
%12 = call i8* @kcn_key_concat(i32 %10, i8** %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 0, i32* %4
br label %23
16: ; preds = %3
%17 = load %struct.kcn_info*, %struct.kcn_info** %5
%18 = load i8*, i8** %9
%19 = call i32 @kcn_search(%struct.kcn_info* %17, i8* %18)
store i32 %19, i32* %8
%20 = load i8*, i8** %9
%21 = call i32 @free(i8* %20)
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %23
23: ; preds = %16, %15
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
%struct.kcn_info = type { i32 }
define i32 @kcn_searchv(%struct.kcn_info* %0, i32 %1, i8** %2) {
%4 = tail call i8* @kcn_key_concat(i32 %1, i8** %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @kcn_search(%struct.kcn_info* %0, i8* %4)
%8 = tail call i32 @free(i8* %4)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t __wcsrtombs(char *, int /*<<< orphan*/ const **, size_t,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, char, int);
size_t wcstombs(char *s, const wchar_t *pwcs, size_t n) {
  mbstate_t state;
  memset(&state, '\0', sizeof state);
  return __wcsrtombs(s, &pwcs, n, &state);
}


x86 assembly (clang, -O0):
<wcstombs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
call   1030 <__wcsrtombs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstombs>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,(%rsp)
lea    0xc(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <__wcsrtombs@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @wcstombs(i8* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32
store i32* %1, i32** %4
%6 = bitcast i32* %5 to i8*
%7 = call i32 @memset(i32* %5, i8 signext 0, i32 4)
%8 = call i64 @__wcsrtombs(i8* %0, i32** %4, i64 %2, i32* %5)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ core5_swap(char *, int);
int U_EMRSETBKCOLOR_swap(char *record, int torev) {
  if (!core5_swap(record, torev))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<U_EMRSETBKCOLOR_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <core5_swap@plt>
cmp    $0x0,%eax
jne    1140 <U_EMRSETBKCOLOR_swap+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1147 <U_EMRSETBKCOLOR_swap+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRSETBKCOLOR_swap>:
push   %rax
call   1030 <core5_swap@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @U_EMRSETBKCOLOR_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char const *);
int is_dir_exist(const char *path) {
  DIR *dir = opendir(path);
  if (dir) {
    closedir(dir);
    dir = NULL;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_dir_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <is_dir_exist+0x41>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movq   $0x0,-0x18(%rbp)
movl   $0x1,-0x4(%rbp)
jmp    1168 <is_dir_exist+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir_exist>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     113a <is_dir_exist+0x1a>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_dir_exist(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
unsigned int unicode_code_point_byte_requirement_utf32(uint32_t code_point) {
  return 4;
}


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

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

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

LLVM IR (-O2):
define i32 @unicode_code_point_byte_requirement_utf32(i32 %0) {
ret i32 4
}
int _return_ab(int a, int b) {
  int temp;
  if (a == 0)
    return (b);
  else {
    a = a - 1;
    temp = _return_ab(a, b);
  }
  return (b + temp);
}


x86 assembly (clang, -O0):
<_return_ab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <_return_ab+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <_return_ab+0x43>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <_return_ab@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_return_ab>:
imul   %esi,%edi
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @_return_ab(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = add nsw i32 %3, %1
ret i32 %4
}
void s5pv310_default_sdhci3(void) {}


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

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

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

LLVM IR (-O2):
define void @s5pv310_default_sdhci3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_stackdouble_basic();
int /*<<< orphan*/ test_stackdouble_large();
int /*<<< orphan*/ tests_show_summary();
int main(void) {
  test_stackdouble_basic();
  test_stackdouble_large();
  tests_show_summary();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_stackdouble_basic@plt>
mov    $0x0,%al
call   1040 <test_stackdouble_large@plt>
mov    $0x0,%al
call   1030 <tests_show_summary@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_stackdouble_basic@plt>
xor    %eax,%eax
call   1040 <test_stackdouble_large@plt>
xor    %eax,%eax
call   1030 <tests_show_summary@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_stackdouble_basic()
%3 = call i32 (...) @test_stackdouble_large()
%4 = call i32 (...) @tests_show_summary()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_stackdouble_basic()
%2 = tail call i32 (...) @test_stackdouble_large()
%3 = tail call i32 (...) @tests_show_summary()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lexer_buffer_reset();
void tokenize_clear_stream() { lexer_buffer_reset(); }


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

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

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

LLVM IR (-O2):
define void @tokenize_clear_stream() {
%1 = tail call i32 (...) @lexer_buffer_reset()
ret void
}
int find_one(unsigned int data) {
  int count = 0;
  while (data) {
    data &= (data - 1);
    count++;
  }
  return count;
}


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

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

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

LLVM IR (-O2):
define i32 @find_one(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
int ps() {
  int retval;
  __asm__("int $0x80      \n\t"
          "mov %%eax, %0"
          : "=m"(retval)
          : "a"(13)
          : "memory");
  return retval;
}


x86 assembly (clang, -O0):
<ps>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%eax
int    $0x80
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps>:
mov    $0xd,%eax
int    $0x80
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @ps() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
ret i32 %3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int string_cmp(const char *s1, const char *s2) {
  if (!s1)
    return 1;
  return strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<string_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <string_cmp+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1147 <string_cmp+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @string_cmp(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 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
store i32 1, i32* %3
br label %13
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 @strcmp(i8* %10, i8* %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @string_cmp(i8* %0, i8* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(1) %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void M_ClearRandom(void) { srand((unsigned int)time(NULL)); }


x86 assembly (clang, -O0):
<M_ClearRandom>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @M_ClearRandom() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @M_ClearRandom() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
void bitset(unsigned char *x, int b) { *x |= (1 << b); }


x86 assembly (clang, -O0):
<bitset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitset>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @bitset(i8* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i8, i8* %0
%5 = trunc i32 %3 to i8
%6 = or i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void conio_exit(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @conio_exit() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ ok_syntax1_parse(int *, int *);
int /*<<< orphan*/ stdin;
int main(void) {
  int regs[26];
  int base = 10;
  while (!feof(stdin)) {
    ok_syntax1_parse(regs, &base);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x74(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115c <main+0x3c>
jmp    116e <main+0x4e>
lea    -0x70(%rbp),%rdi
lea    -0x74(%rbp),%rsi
call   1030 <ok_syntax1_parse@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
movl   $0xa,0xc(%rsp)
mov    0x2ead(%rip),%r15
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    1177 <main+0x57>
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <ok_syntax1_parse@plt>
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
je     1160 <main+0x40>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [26 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* @stdin
%6 = call i32 @feof(i32 %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 0
%11 = call i32 @ok_syntax1_parse(i32* %10, i32* %3)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [26 x i32]
%2 = alloca i32
%3 = bitcast [26 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %2
%5 = load i32, i32* @stdin
%6 = call i32 @feof(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = getelementptr inbounds [26 x i32], [26 x i32]* %1, i64 0, i64 0
br label %10
10: ; preds = %8, %10
%11 = call i32 @ok_syntax1_parse(i32* %9, i32* %2)
%12 = load i32, i32* @stdin
%13 = call i32 @feof(i32 %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %10, label %15
15: ; preds = %10, %0
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t enshift(uint16_t x) { return x & 0x0000001f; }


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

x86 assembly (clang, -O2):
<enshift>:
mov    %edi,%eax
and    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @enshift(i32 %0) {
%2 = and i32 %0, 31
ret i32 %2
}
int pqueue_cmp_prio(double next, double curr) {
  if (curr < next) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<pqueue_cmp_prio>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    112e <pqueue_cmp_prio+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <pqueue_cmp_prio+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pqueue_cmp_prio>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

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

LLVM IR (-O2):
define i32 @pqueue_cmp_prio(double %0, double %1) {
%3 = fcmp olt double %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
__attribute__((no, noclone)) unsigned __int128 t153_3add(unsigned __int128 y) {
  unsigned __int128 r;
  if (__builtin_add_overflow((unsigned __int128)(1), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t153_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0x1,%rdx
adc    $0x0,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t153_3add+0x48>
jmp    115f <t153_3add+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t153_3add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
adc    $0x0,%r14
jae    112b <t153_3add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t153_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 1, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t153_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %6, i128 1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
int main() {
  execl("/usr/bin/java", "java", "-version", NULL);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"/usr/bin/java\00"
@.str.1 = [5 x i8] c"java\00"
@.str.2 = [9 x i8] c"-version\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execl(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"/usr/bin/java\00"
@.str.1 = [5 x i8] c"java\00"
@.str.2 = [9 x i8] c"-version\00"
define i32 @main() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ROTATE(uint32_t a, uint32_t n) { return (a >> n) + (a << (32 - n)); }


x86 assembly (clang, -O0):
<ROTATE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROTATE>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @ROTATE(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ROTATE(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
__attribute__((used)) int _read(int file, void *ptr, size_t len) { return -1; }


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i8*, i64)* @_read to i8*)], section "llvm.metadata"
define i32 @_read(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
ret i32 -1
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i8*, i64)* @_read to i8*)], section "llvm.metadata"
define i32 @_read(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strlen(char *);
int main() {
  char str[] = "Hello, C! Do you like C style strings?";
  printf("%s\n", str);
  printf("%zu\n", strlen(str));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x27,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x3f73676e697274,%rax
mov    %rax,0x1f(%rsp)
lea    0xed5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xebf(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [39 x i8] c"Hello, C! Do you like C style strings?\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = alloca [39 x i8]
%2 = bitcast [39 x i8]* %1 to i8*
%3 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 0
%6 = call i8* @strlen(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [39 x i8] c"Hello, C! Do you like C style strings?\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = alloca [39 x i8]
%2 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @strlen(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int PnameDef();
PedifFileNameDef() {
  int b = -1;
  ;
  b = PnameDef();
  return (b);
}


x86 assembly (clang, -O0):
<PedifFileNameDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1030 <PnameDef@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @PedifFileNameDef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @PnameDef()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PedifFileNameDef() {
%1 = tail call i32 (...) @PnameDef()
ret i32 %1
}
void CILK_MB(void) { __asm__ volatile("mfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @CILK_MB() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}