xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t get_pt_index(uintptr_t virt_address) {
  return (virt_address >> 12) & 0x1FF;
}


x86 assembly (clang, -O0):
<get_pt_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xc,%rax
and    $0x1ff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pt_index>:
mov    %rdi,%rax
shr    $0xc,%eax
and    $0x1ff,%eax
ret

LLVM IR (-O0):
define i64 @get_pt_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 12
%5 = and i64 %4, 511
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_pt_index(i64 %0) {
%2 = lshr i64 %0, 12
%3 = and i64 %2, 511
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
char *ip_service_name(void *);
void print_tcp(FILE *f, void *packet, ssize_t psize) {
  fprintf(f, "|%s", ip_service_name(packet));
}


x86 assembly (clang, -O0):
<print_tcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ip_service_name@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rdx
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tcp>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <ip_service_name@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"|%s\00"
define void @print_tcp(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i8* @ip_service_name(i8* %1)
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ catString(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
void catNameValueInt(char *name, int value) {
  char buf[160 + 2];
  sprintf(buf, "\"%s\":%d", name, value);
  catString(buf);
}


x86 assembly (clang, -O0):
<catNameValueInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xb0(%rbp),%rdi
call   1030 <catString@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catNameValueInt>:
push   %rbx
sub    $0xb0,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xecc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <catString@plt>
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\22%s\22:%d\00"
define void @catNameValueInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [162 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [162 x i8], [162 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = getelementptr inbounds [162 x i8], [162 x i8]* %5, i64 0, i64 0
%11 = call i32 @catString(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\22%s\22:%d\00"
define void @catNameValueInt(i8* %0, i32 %1) {
%3 = alloca [162 x i8]
%4 = getelementptr inbounds [162 x i8], [162 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = call i32 @catString(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, unsigned char *, int);
void doEcho(int f) {
  unsigned char e[3] = {255, 253, 1};
  write(f, e, 3);
}


x86 assembly (clang, -O0):
<doEcho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doEcho>:
push   %rax
movb   $0x1,0x6(%rsp)
movw   $0xfdff,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.doEcho.e = [3 x i8] c"\FF\FD\01"
define void @doEcho(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 %0, i32* %2
%4 = bitcast [3 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = call i32 @write(i32 %5, i8* %6, i32 3)
ret void
}

LLVM IR (-O2):
@__const.doEcho.e = [3 x i8] c"\FF\FD\01"
define void @doEcho(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 @write(i32 %0, i8* %3, i32 3)
ret void
}
/* Variables and functions */
int echo(int);
int zerotest(int a) {
  int retval;
  a = echo(a);
  if (a == 0)
    retval = echo(1);
  else
    retval = echo(0);
  retval = echo(retval);
  return retval;
}


x86 assembly (clang, -O0):
<zerotest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <echo@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1142 <zerotest+0x32>
mov    $0x1,%edi
call   1030 <echo@plt>
mov    %eax,-0x8(%rbp)
jmp    114c <zerotest+0x3c>
xor    %edi,%edi
call   1030 <echo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <echo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zerotest>:
push   %rax
call   1030 <echo@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <echo@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <echo@plt>

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

LLVM IR (-O2):
define i32 @zerotest(i32 %0) {
%2 = tail call i32 @echo(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @echo(i32 %4)
%6 = tail call i32 @echo(i32 %5)
ret i32 %6
}
int addOK(int x, int y) {
  int sign_x = (x >> 31) & 0x00000001;
  int sign_y = (y >> 31) & 0x00000001;
  int sign_sum = ((x + y) >> 31) & 0x00000001;
  int same_sign_xy = (sign_x ^ sign_y);
  int same_sign_sumx = (sign_sum ^ sign_x);
  int same_sign_sumy = (sign_sum ^ sign_y);
  return (!!(same_sign_xy)) | ((!same_sign_sumx) & (!same_sign_sumy));
}


x86 assembly (clang, -O0):
<addOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x1c(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmpl   $0x0,-0x20(%rbp)
setne  %dl
xor    $0xff,%dl
and    $0x1,%dl
movzbl %dl,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addOK>:
lea    (%rsi,%rdi,1),%eax
mov    %esi,%ecx
shr    $0x1f,%ecx
shr    $0x1f,%edi
shr    $0x1f,%eax
mov    %ecx,%edx
xor    %edi,%edx
xor    %eax,%edi
not    %edi
xor    %ecx,%eax
xor    $0x1,%eax
and    %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @addOK(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%11 = load i32, i32* %3
%12 = ashr i32 %11, 31
%13 = and i32 %12, 1
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = ashr i32 %14, 31
%16 = and i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %17, %18
%20 = ashr i32 %19, 31
%21 = and i32 %20, 1
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %8
%25 = load i32, i32* %7
%26 = load i32, i32* %5
%27 = xor i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %6
%30 = xor i32 %28, %29
store i32 %30, i32* %10
%31 = load i32, i32* %8
%32 = icmp ne i32 %31, 0
%33 = xor i1 %32, true
%34 = xor i1 %33, true
%35 = zext i1 %34 to i32
%36 = load i32, i32* %9
%37 = icmp ne i32 %36, 0
%38 = xor i1 %37, true
%39 = zext i1 %38 to i32
%40 = load i32, i32* %10
%41 = icmp ne i32 %40, 0
%42 = xor i1 %41, true
%43 = zext i1 %42 to i32
%44 = and i32 %39, %43
%45 = or i32 %35, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @addOK(i32 %0, i32 %1) {
%3 = lshr i32 %0, 31
%4 = lshr i32 %1, 31
%5 = add nsw i32 %1, %0
%6 = lshr i32 %5, 31
%7 = xor i32 %4, %3
%8 = xor i32 %3, %6
%9 = xor i32 %8, -1
%10 = xor i32 %4, %6
%11 = xor i32 %10, 1
%12 = and i32 %11, %9
%13 = or i32 %12, %7
ret i32 %13
}
int cast_ulong_int(unsigned long int x) { return (int)x; }


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

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

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

LLVM IR (-O2):
define i32 @cast_ulong_int(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
void av_bsf_list_append2() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
@str = [31 x i8] c"\0A=============================\00"
define void @seperator() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(int extno, const char *prog) {
  fprintf(stderr,
          "usage: %s "
          "[-p port] [-l miliseconds] [-t nthread] [-w miliseconds] "
          "[-h] host\n",
          prog);
  exit(extno);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [78 x i8] c"usage: %s [-p port] [-l miliseconds] [-t nthread] [-w miliseconds] [-h] host\0A\00"
define void @usage(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %3
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [78 x i8] c"usage: %s [-p port] [-l miliseconds] [-t nthread] [-w miliseconds] [-h] host\0A\00"
define void @usage(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ zfile_list_destroy();
void zfile_shutdown(void) { zfile_list_destroy(); }


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

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

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

LLVM IR (-O2):
define void @zfile_shutdown() {
%1 = tail call i32 (...) @zfile_list_destroy()
ret void
}
void foo103(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo103(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t sublp0(uint64_t x) { return x - 0; }


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

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

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

LLVM IR (-O2):
define i64 @sublp0(i64 returned %0) {
ret i64 %0
}
int cmd_unblock(int fd, int argc, char *argv[]) { return 0; }


x86 assembly (clang, -O0):
<cmd_unblock>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmd_unblock(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_unblock(i32 %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int dpos(char *data) {
  int len = strlen(data);
  for (int i = 0; i < len; i++) {
    if (data[i] == ' ')
      return i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<dpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116e <dpos+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    115b <dpos+0x4b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <dpos+0x65>
jmp    1160 <dpos+0x50>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112f <dpos+0x1f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    113f <dpos+0x2f>
mov    %eax,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,(%rbx,%rax,1)
je     1141 <dpos+0x31>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1130 <dpos+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dpos(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 32
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ], [ 0, %11 ]
ret i32 %17
}
/* Variables and functions */
size_t strcspn(char const *, char *);
size_t env_key_length(const char *key) {
  size_t n = strcspn(key, "=");
  if (key[n] == '=')
    n++;
  return n;
}


x86 assembly (clang, -O0):
<env_key_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
jne    1151 <env_key_length+0x41>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_key_length>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcspn@plt>
xor    %ecx,%ecx
cmpb   $0x3d,(%rbx,%rax,1)
sete   %cl
add    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
define i64 @env_key_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcspn(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 61
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define i64 @env_key_length(i8* nocapture %0) {
%2 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 61
%6 = zext i1 %5 to i64
%7 = add i64 %2, %6
ret i64 %7
}
/* Variables and functions */
int INT_MAX;
int h(void) { return INT_MAX + 1; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @h() {
%1 = load i32, i32* @INT_MAX
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @h() {
%1 = load i32, i32* @INT_MAX
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int main(int argc, char *argv[]) { mkdir(argv[1], 0700); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(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 1
%7 = load i8*, i8** %6
%8 = call i32 @mkdir(i8* %7, i32 448)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @mkdir(i8* %4, i32 448)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _rpmalloc_heap_release_raw(void *, int);
void _rpmalloc_heap_release_raw_fc(void *heapptr) {
  _rpmalloc_heap_release_raw(heapptr, 1);
}


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

x86 assembly (clang, -O2):
<_rpmalloc_heap_release_raw_fc>:
mov    $0x1,%esi
jmp    1030 <_rpmalloc_heap_release_raw@plt>

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

LLVM IR (-O2):
define void @_rpmalloc_heap_release_raw_fc(i8* %0) {
%2 = tail call i32 @_rpmalloc_heap_release_raw(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_http_client(int fd) {
  if (fd >= 0)
    close(fd);
}


x86 assembly (clang, -O0):
<close_http_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <close_http_client+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_http_client>:
test   %edi,%edi
js     1119 <close_http_client+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @close_http_client(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @close_http_client(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
char *ctime_r(scalar_t__ const *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, long long);
char *cdf_ctime(const time_t *sec, char *buf) {
  char *ptr = ctime_r(sec, buf);
  if (ptr != NULL)
    return buf;
  (void)snprintf(buf, 26, "*Bad* 0x%16.16llx\n", (long long)*sec);
  return buf;
}


x86 assembly (clang, -O0):
<cdf_ctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ctime_r@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <cdf_ctime+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <cdf_ctime+0x5d>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    $0x1a,%esi
lea    0xe90(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdf_ctime>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <ctime_r@plt>
test   %rax,%rax
jne    114b <cdf_ctime+0x2b>
mov    (%r14),%rcx
lea    0xec2(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1a,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"*Bad* 0x%16.16llx\0A\00"
define i8* @cdf_ctime(i64* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i8*
%6 = alloca i8*
store i64* %0, i64** %4
store i8* %1, i8** %5
%7 = load i64*, i64** %4
%8 = load i8*, i8** %5
%9 = call i8* @ctime_r(i64* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %5
store i8* %13, i8** %3
br label %20
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load i64*, i64** %4
%17 = load i64, i64* %16
%18 = call i32 @snprintf(i8* %15, i32 26, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %17)
%19 = load i8*, i8** %5
store i8* %19, i8** %3
br label %20
20: ; preds = %14, %12
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [19 x i8] c"*Bad* 0x%16.16llx\0A\00"
define i8* @cdf_ctime(i64* %0, i8* returned %1) {
%3 = tail call i8* @ctime_r(i64* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i64, i64* %0
%7 = tail call i32 @snprintf(i8* %1, i32 26, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %2, %5
ret i8* %1
}
void setNormalStyle(void) {}


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

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

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

LLVM IR (-O2):
define void @setNormalStyle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ block_signals();
int /*<<< orphan*/ engine_keymap(int /*<<< orphan*/ *);
int /*<<< orphan*/ engine_screen_init(int, int);
int /*<<< orphan*/ engine_windows_init();
int /*<<< orphan*/ register_signal_handler();
int /*<<< orphan*/ restore_signals();
bool engine_init() {
  block_signals();
  engine_screen_init(80, 24);
  engine_windows_init();
  engine_keymap(NULL);
  restore_signals();
  register_signal_handler();
  return true;
}


x86 assembly (clang, -O0):
<engine_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <block_signals@plt>
mov    $0x50,%edi
mov    $0x18,%esi
call   1040 <engine_screen_init@plt>
mov    $0x0,%al
call   1030 <engine_windows_init@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <engine_keymap@plt>
mov    $0x0,%al
call   1060 <restore_signals@plt>
mov    $0x0,%al
call   1080 <register_signal_handler@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<engine_init>:
push   %rax
xor    %eax,%eax
call   1070 <block_signals@plt>
mov    $0x50,%edi
mov    $0x18,%esi
call   1040 <engine_screen_init@plt>
xor    %eax,%eax
call   1030 <engine_windows_init@plt>
xor    %edi,%edi
call   1050 <engine_keymap@plt>
xor    %eax,%eax
call   1060 <restore_signals@plt>
xor    %eax,%eax
call   1080 <register_signal_handler@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @engine_init() {
%1 = call i32 (...) @block_signals()
%2 = call i32 @engine_screen_init(i32 80, i32 24)
%3 = call i32 (...) @engine_windows_init()
%4 = call i32 @engine_keymap(i32* null)
%5 = call i32 (...) @restore_signals()
%6 = call i32 (...) @register_signal_handler()
ret i32 1
}

LLVM IR (-O2):
define i32 @engine_init() {
%1 = tail call i32 (...) @block_signals()
%2 = tail call i32 @engine_screen_init(i32 80, i32 24)
%3 = tail call i32 (...) @engine_windows_init()
%4 = tail call i32 @engine_keymap(i32* null)
%5 = tail call i32 (...) @restore_signals()
%6 = tail call i32 (...) @register_signal_handler()
ret i32 1
}
void function4(void) {}


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

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

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

LLVM IR (-O2):
define void @function4() {
ret void
}
int mlockall(int flags) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mlockall(i32 %0) {
ret i32 0
}
void test_files(void) {}


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

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

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

LLVM IR (-O2):
define void @test_files() {
ret void
}
/* Variables and functions */
int hex2bin(char *, size_t, char *, size_t);
int hex2bin_inplace(char *src, size_t srclen) {
  return hex2bin(src, srclen, src, srclen >> 1);
}


x86 assembly (clang, -O0):
<hex2bin_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
call   1030 <hex2bin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2bin_inplace>:
mov    %rsi,%rcx
shr    %rcx
mov    %rdi,%rdx
jmp    1030 <hex2bin@plt>

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

LLVM IR (-O2):
define i32 @hex2bin_inplace(i8* %0, i64 %1) {
%3 = lshr i64 %1, 1
%4 = tail call i32 @hex2bin(i8* %0, i64 %1, i8* %0, i64 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getKey();
int /*<<< orphan*/ getKeyPrompt(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ looser(int *);
int /*<<< orphan*/ sizeY();
int /*<<< orphan*/ winner(int);
void whathappens(int master[], int turn, int win) {
  getKey();
  if (win == 1)
    winner(turn);
  else
    looser(master);
  getKeyPrompt("", 1, sizeY());
}


x86 assembly (clang, -O0):
<whathappens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getKey@plt>
cmpl   $0x1,-0x10(%rbp)
jne    1180 <whathappens+0x30>
mov    -0xc(%rbp),%edi
call   1060 <winner@plt>
jmp    1189 <whathappens+0x39>
mov    -0x8(%rbp),%rdi
call   1070 <looser@plt>
mov    $0x0,%al
call   1040 <sizeY@plt>
mov    %eax,%edx
lea    0xe67(%rip),%rdi
mov    $0x1,%esi
call   1050 <getKeyPrompt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whathappens>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getKey@plt>
cmp    $0x1,%ebp
jne    1172 <whathappens+0x22>
mov    %r14d,%edi
call   1060 <winner@plt>
jmp    117a <whathappens+0x2a>
mov    %rbx,%rdi
call   1070 <looser@plt>
xor    %eax,%eax
call   1040 <sizeY@plt>
lea    0xe78(%rip),%rdi
mov    $0x1,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <getKeyPrompt@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @whathappens(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 = call i32 (...) @getKey()
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %5
%12 = call i32 @winner(i32 %11)
br label %16
13: ; preds = %3
%14 = load i32*, i32** %4
%15 = call i32 @looser(i32* %14)
br label %16
16: ; preds = %13, %10
%17 = call i32 (...) @sizeY()
%18 = call i32 @getKeyPrompt(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @whathappens(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @getKey()
%5 = icmp eq i32 %2, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @winner(i32 %1)
br label %10
8: ; preds = %3
%9 = tail call i32 @looser(i32* %0)
br label %10
10: ; preds = %8, %6
%11 = tail call i32 (...) @sizeY()
%12 = tail call i32 @getKeyPrompt(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i32 %11)
ret void
}
void test_no_clause() {
  int i;
#pragma omp target teams distribute parallel for
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target teams distribute parallel for
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
void outw(unsigned short value, unsigned short port) {
  asm volatile("out"
               "w"
               " %"
               "w"
               "0,%"
               "w"
               "1"
               :
               : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ editor_resized();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ set_escdelay(int);
int editor_init() {
  initscr();
  cbreak();
  noecho();
  refresh();
  set_escdelay(25);
  editor_resized();
  return 0;
}


x86 assembly (clang, -O0):
<editor_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x19,%edi
call   1030 <set_escdelay@plt>
mov    $0x0,%al
call   1060 <editor_resized@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<editor_init>:
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    $0x19,%edi
call   1030 <set_escdelay@plt>
xor    %eax,%eax
call   1060 <editor_resized@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @editor_init() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @noecho()
%4 = call i32 (...) @refresh()
%5 = call i32 @set_escdelay(i32 25)
%6 = call i32 (...) @editor_resized()
ret i32 0
}

LLVM IR (-O2):
define i32 @editor_init() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = tail call i32 (...) @refresh()
%5 = tail call i32 @set_escdelay(i32 25)
%6 = tail call i32 (...) @editor_resized()
ret i32 0
}
dosyscmd(ap, c) char **ap;
{
  if (c > 0)
    system(ap[1]);
}


x86 assembly (clang, -O0):
<dosyscmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1138 <dosyscmd+0x28>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dosyscmd>:
test   %esi,%esi
jle    1124 <dosyscmd+0x14>
push   %rax
mov    0x8(%rdi),%rdi
xor    %eax,%eax
call   1030 <system@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @dosyscmd(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 i32, i32* %5
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %11)
br label %13
13: ; preds = %8, %2
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @dosyscmd(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %6)
br label %8
8: ; preds = %4, %2
ret i32 undef
}
int *list1(x) {
  int *p = newvec(0);
  p[0] = x;
  return p;
}


x86 assembly (clang, -O0):
<list1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <newvec@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list1>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <newvec@plt>
cltq
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @list1(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @newvec to i32 (i32, ...)*)(i32 0)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32, i32* %2
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @list1(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @newvec to i32 (i32, ...)*)(i32 0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store i32 %0, i32* %4
ret i32* %4
}
void EMIT1LAB(d) int d;
{
  char name[32];
  sprintf(name, "l%d", d);
  EMIT1ATM(name);
}


x86 assembly (clang, -O0):
<EMIT1LAB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <EMIT1ATM@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMIT1LAB>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <EMIT1ATM@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"l%d\00"
define void @EMIT1LAB(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"l%d\00"
define void @EMIT1LAB(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* %3)
ret void
}
unsigned xrop3_237_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_237_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_237_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xffffff00,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_237_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_237_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -256
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *th(void *param) {
  int n = (int)param;
  int cont = 100;
  while (cont) {
    printf("%d", n);
    --cont;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<th>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
movl   $0x64,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1151 <th+0x41>
mov    -0xc(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <th+0x1a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<th>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0xffffff9c,%ebp
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
inc    %ebp
jne    1130 <th+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @th(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i32
store i32 %6, i32* %3
store i32 100, i32* %4
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
br label %7
15: ; preds = %7
ret i8* null
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @th(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ 100, %1 ], [ %7, %4 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%7 = add nsw i32 %5, -1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4
ret i8* null
}
/* Variables and functions */
size_t strlen(char const *);
size_t strcspn(const char *str1, const char *str2) { return strlen(str1); }


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

x86 assembly (clang, -O2):
<strcspn>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @strcspn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @strcspn(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %3
}
void McASPDITEnable(unsigned int baseAddr, unsigned int vBit) {
  (*((volatile unsigned int *)(baseAddr + (0x50)))) = (vBit | (0x00000001u));
}


x86 assembly (clang, -O0):
<McASPDITEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
or     $0x1,%ecx
mov    -0x4(%rbp),%eax
add    $0x50,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPDITEnable>:
or     $0x1,%esi
add    $0x50,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @McASPDITEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = or i32 %5, 1
%7 = load i32, i32* %3
%8 = add i32 %7, 80
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %6, i32* %10
ret void
}

LLVM IR (-O2):
define void @McASPDITEnable(i32 %0, i32 %1) {
%3 = or i32 %1, 1
%4 = add i32 %0, 80
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %3, i32* %6
ret void
}