xunge/DecIR huggingface dataset:
/* Type definitions */
struct bstree_node {
  int dummy;
};

/* Variables and functions */
struct bstree_node *get_last(struct bstree_node *);
struct bstree_node *get_left(struct bstree_node const *);
struct bstree_node *get_prev(struct bstree_node const *);
struct bstree_node *bstree_prev(const struct bstree_node *node) {
  struct bstree_node *left = get_left(node);
  if (left)
    return get_last(left);
  return get_prev(node);
}


x86 assembly (clang, -O0):
<bstree_prev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <get_left@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1166 <bstree_prev+0x36>
mov    -0x18(%rbp),%rdi
call   1030 <get_last@plt>
mov    %rax,-0x8(%rbp)
jmp    1173 <bstree_prev+0x43>
mov    -0x10(%rbp),%rdi
call   1040 <get_prev@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bstree_prev>:
push   %rbx
mov    %rdi,%rbx
call   1050 <get_left@plt>
test   %rax,%rax
je     1147 <bstree_prev+0x17>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <get_last@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <get_prev@plt>

LLVM IR (-O0):
%struct.bstree_node = type { i32 }
define %struct.bstree_node* @bstree_prev(%struct.bstree_node* %0) {
%2 = alloca %struct.bstree_node*
%3 = alloca %struct.bstree_node*
%4 = alloca %struct.bstree_node*
store %struct.bstree_node* %0, %struct.bstree_node** %3
%5 = load %struct.bstree_node*, %struct.bstree_node** %3
%6 = call %struct.bstree_node* @get_left(%struct.bstree_node* %5)
store %struct.bstree_node* %6, %struct.bstree_node** %4
%7 = load %struct.bstree_node*, %struct.bstree_node** %4
%8 = icmp ne %struct.bstree_node* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.bstree_node*, %struct.bstree_node** %4
%11 = call %struct.bstree_node* @get_last(%struct.bstree_node* %10)
store %struct.bstree_node* %11, %struct.bstree_node** %2
br label %15
12: ; preds = %1
%13 = load %struct.bstree_node*, %struct.bstree_node** %3
%14 = call %struct.bstree_node* @get_prev(%struct.bstree_node* %13)
store %struct.bstree_node* %14, %struct.bstree_node** %2
br label %15
15: ; preds = %12, %9
%16 = load %struct.bstree_node*, %struct.bstree_node** %2
ret %struct.bstree_node* %16
}

LLVM IR (-O2):
%struct.bstree_node = type { i32 }
define %struct.bstree_node* @bstree_prev(%struct.bstree_node* %0) {
%2 = tail call %struct.bstree_node* @get_left(%struct.bstree_node* %0)
%3 = icmp eq %struct.bstree_node* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call %struct.bstree_node* @get_last(%struct.bstree_node* %2)
br label %8
6: ; preds = %1
%7 = tail call %struct.bstree_node* @get_prev(%struct.bstree_node* %0)
br label %8
8: ; preds = %6, %4
%9 = phi %struct.bstree_node* [ %5, %4 ], [ %7, %6 ]
ret %struct.bstree_node* %9
}
unsigned long read_le4(unsigned char *p) {
  return (unsigned long)p[0] | ((unsigned long)p[1] << 8) |
         ((unsigned long)p[2] << 16) | ((unsigned long)p[3] << 24);
}


x86 assembly (clang, -O0):
<read_le4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_le4>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i64 @read_le4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
/* Variables and functions */
int f300(int *);
int f301(int *p) { return f300(p); }


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

x86 assembly (clang, -O2):
<f301>:
jmp    1030 <f300@plt>

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

LLVM IR (-O2):
define i32 @f301(i32* %0) {
%2 = tail call i32 @f300(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateRTCMatch1Set(unsigned long ulMatch) {
  (*((volatile unsigned long *)(0x400FC008))) = ulMatch;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCMatch1Set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fc008,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCMatch1Set>:
mov    %rdi,0x400fc008
40
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCMatch1Set(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074774024 to i64*)
%4 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCMatch1Set(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074774024 to i64*)
%2 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int strtol(char *, int /*<<< orphan*/ *, int);
int read_status_line(char *buffer) {
  char *start = strchr(buffer, ' ');
  int status = strtol(start, NULL, 10);
  return status;
}


x86 assembly (clang, -O0):
<read_status_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_status_line>:
push   %rax
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rax
jmp    1040 <strtol@plt>

LLVM IR (-O0):
define i32 @read_status_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strchr(i8* %5, i8 signext 32)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strtol(i8* %7, i32* null, i32 10)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_status_line(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 32)
%3 = tail call i32 @strtol(i8* nocapture %2, i32* null, i32 10)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ http_header_str_val(char const *, char const *, int, char *,
                                       int);
int /*<<< orphan*/ httpdate_to_timet(char *);
time_t http_header_date(const char *data, const char *field, int len) {
  char buf[256];
  if (!http_header_str_val(data, field, len, buf, sizeof(buf)))
    return (time_t)-1;
  return httpdate_to_timet(buf);
}


x86 assembly (clang, -O0):
<http_header_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    -0x120(%rbp),%rcx
mov    $0x100,%r8d
call   1040 <http_header_str_val@plt>
cmp    $0x0,%eax
jne    1168 <http_header_date+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <http_header_date+0x57>
lea    -0x120(%rbp),%rdi
call   1030 <httpdate_to_timet@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_header_date>:
sub    $0x108,%rsp
mov    %rsp,%rcx
mov    $0x100,%r8d
call   1040 <http_header_str_val@plt>
test   %eax,%eax
je     1149 <http_header_date+0x29>
mov    %rsp,%rdi
call   1030 <httpdate_to_timet@plt>
add    $0x108,%rsp
ret
mov    $0xffffffff,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @http_header_date(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [256 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%13 = call i32 @http_header_str_val(i8* %9, i8* %10, i32 %11, i8* %12, i32 256)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %3
store i32 -1, i32* %4
br label %19
16: ; preds = %3
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%18 = call i32 @httpdate_to_timet(i8* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @http_header_date(i8* %0, i8* %1, i32 %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i32 @http_header_str_val(i8* %0, i8* %1, i32 %2, i8* %5, i32 256)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = call i32 @httpdate_to_timet(i8* %5)
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ %9, %8 ], [ -1, %3 ]
ret i32 %11
}
/* Variables and functions */
int fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int show_file_write(char *buf, int len) { return fwrite(buf, 1, len, stdout); }


x86 assembly (clang, -O0):
<show_file_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_file_write>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @show_file_write(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
char *minWindow(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  char s[] = "cabefgecdaecf";
  char t[] = "cae";
  printf("%s\n", minWindow(s, t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    0xeb3(%rip),%eax
mov    %eax,-0x22(%rbp)
lea    -0x1e(%rbp),%rdi
lea    -0x22(%rbp),%rsi
call   1030 <minWindow@plt>
mov    %rax,%rsi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x66636561646365,%rax
mov    %rax,0xe(%rsp)
movabs $0x6365676665626163,%rax
67 65 63
mov    %rax,0x8(%rsp)
movl   $0x656163,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <minWindow@plt>
lea    0xeae(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [14 x i8] c"cabefgecdaecf\00"
@__const.main.t = [4 x i8] c"cae\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [14 x i8]
%7 = alloca [4 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [14 x i8]* %6 to i8*
%9 = bitcast [4 x i8]* %7 to i8*
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%12 = call i8* @minWindow(i8* %10, i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [14 x i8] c"cabefgecdaecf\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [14 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
store i32 6644067, i32* %4
%7 = call i8* @minWindow(i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}
/* Variables and functions */
scalar_t__ strchr(char *, int);
int ispunct(int c) {
  if (strchr("!\"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~", c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1140 <ispunct+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1147 <ispunct+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"!\22#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\00"
define i32 @ispunct(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @strchr(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [33 x i8] c"!\22#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\00"
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int max(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 300;
  int b = 200;
  int ret;
  ret = max(a, b);
  printf("Max value is : %d\n", ret);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12c,%edi
mov    $0xc8,%esi
call   1040 <max@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Max value is : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 300, i32* %2
store i32 200, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @max(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Max value is : %d\0A\00"
define i32 @main() {
%1 = tail call i32 @max(i32 300, i32 200)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
size_t strspn(char const *, char const *);
int btp_skip_char_span(const char **input, const char *chars) {
  size_t count = strspn(*input, chars);
  if (0 == count)
    return count;
  *input += count;
  return count;
}


x86 assembly (clang, -O0):
<btp_skip_char_span>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strspn@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    114c <btp_skip_char_span+0x3c>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1161 <btp_skip_char_span+0x51>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btp_skip_char_span>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strspn@plt>
test   %rax,%rax
je     112f <btp_skip_char_span+0x1f>
add    %rax,%rbx
mov    %rbx,(%r14)
jmp    1131 <btp_skip_char_span+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @btp_skip_char_span(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = tail call i64 @strspn(i8* %3, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 %4
store i8* %7, i8** %0
%8 = trunc i64 %4 to i32
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
unsigned long genrandint();
unsigned long randint() {
  unsigned long x;
  x = genrandint();
  return x;
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <genrandint@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @randint() {
%1 = tail call i64 (...) @genrandint()
ret i64 %1
}
void swap(char *arr, int i1, int i2) {
  char temp;
  temp = arr[i1];
  arr[i1] = arr[i2];
  arr[i2] = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
void *malloc(int);
char *mystrcpy(void *, char const *);
int mystrlen(char const *);
char *mystrdup(const char *s1) {
  int len = mystrlen(s1) + 1;
  void *new = malloc(len);
  return mystrcpy(new, s1);
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mystrlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <mystrcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mystrlen@plt>
lea    0x1(%rax),%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <mystrcpy@plt>

LLVM IR (-O0):
define i8* @mystrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @mystrlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i8* @mystrcpy(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = tail call i32 @mystrlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i8* @mystrcpy(i8* %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
unsigned long long hil_s_from_xy_64(unsigned int, unsigned int, unsigned int);
unsigned long long tile_coordinate_to_serial_64(unsigned z, unsigned x,
                                                unsigned y) {
  unsigned long long s = hil_s_from_xy_64(x, y, z);
  unsigned long long serial = ((unsigned long long)(z) << 58) | s;
  return serial;
}


x86 assembly (clang, -O0):
<tile_coordinate_to_serial_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <hil_s_from_xy_64@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3a,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tile_coordinate_to_serial_64>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
mov    %ebx,%edx
call   1030 <hil_s_from_xy_64@plt>
shl    $0x3a,%rbx
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @tile_coordinate_to_serial_64(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = call i64 @hil_s_from_xy_64(i32 %9, i32 %10, i32 %11)
store i64 %12, i64* %7
%13 = load i32, i32* %4
%14 = zext i32 %13 to i64
%15 = shl i64 %14, 58
%16 = load i64, i64* %7
%17 = or i64 %15, %16
store i64 %17, i64* %8
%18 = load i64, i64* %8
ret i64 %18
}

LLVM IR (-O2):
define i64 @tile_coordinate_to_serial_64(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @hil_s_from_xy_64(i32 %1, i32 %2, i32 %0)
%5 = zext i32 %0 to i64
%6 = shl i64 %5, 58
%7 = or i64 %4, %6
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void u32_store_unaligned(void *p, uint32_t a) {
  *((uint32_t *)p) = a;
}


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

x86 assembly (clang, -O2):
<u32_store_unaligned>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @u32_store_unaligned(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @u32_store_unaligned(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void serial_clr_err(void) {
  if ((*((volatile unsigned *)((0xc8100000 | (0x01 << 10) | (0x30 << 2)) +
                               (3 << 2)))) &
      ((1 << 16) | (1 << 17)))
    (*((volatile unsigned *)((0xc8100000 | (0x01 << 10) | (0x30 << 2)) +
                             (2 << 2))) =
         (*((volatile unsigned *)((0xc8100000 | (0x01 << 10) | (0x30 << 2)) +
                                  (2 << 2)))) |
         ((1 << 24)));
}


x86 assembly (clang, -O0):
<serial_clr_err>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc81004cc,%eax
mov    (%rax),%eax
and    $0x30000,%eax
cmp    $0x0,%eax
je     112d <serial_clr_err+0x2d>
mov    $0xc81004c8,%eax
mov    (%rax),%ecx
or     $0x1000000,%ecx
mov    $0xc81004c8,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_clr_err>:
mov    $0xc81004c8,%eax
testl  $0x30000,0x4(%rax)
je     1114 <serial_clr_err+0x14>
orl    $0x1000000,(%rax)
ret

LLVM IR (-O0):
define void @serial_clr_err() {
%1 = load volatile i32, i32* inttoptr (i64 3356493004 to i32*)
%2 = and i32 %1, 196608
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 3356493000 to i32*)
%6 = or i32 %5, 16777216
store volatile i32 %6, i32* inttoptr (i64 3356493000 to i32*)
br label %7
7: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @serial_clr_err() {
%1 = load volatile i32, i32* inttoptr (i64 3356493004 to i32*)
%2 = and i32 %1, 196608
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 3356493000 to i32*)
%6 = or i32 %5, 16777216
store volatile i32 %6, i32* inttoptr (i64 3356493000 to i32*)
br label %7
7: ; preds = %4, %0
ret void
}
/* Variables and functions */
int check_bit(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ get_status();
bool get_output_status() { return check_bit(get_status(), 0); }


x86 assembly (clang, -O0):
<get_output_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_status@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <check_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_output_status>:
push   %rax
xor    %eax,%eax
call   1040 <get_status@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <check_bit@plt>

LLVM IR (-O0):
define i32 @get_output_status() {
%1 = call i32 (...) @get_status()
%2 = call i32 @check_bit(i32 %1, i32 0)
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_output_status() {
%1 = tail call i32 (...) @get_status()
%2 = tail call i32 @check_bit(i32 %1, i32 0)
ret i32 %2
}
/* Variables and functions */
int io_in8(int);
void wait_KBC_sendready(void) {
  for (;;) {
    if ((io_in8(0x0064) & 0x02) == 0) {
      break;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<wait_KBC_sendready>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_KBC_sendready+0x9>
mov    $0x64,%edi
call   1030 <io_in8@plt>
and    $0x2,%eax
cmp    $0x0,%eax
jne    1134 <wait_KBC_sendready+0x24>
jmp    1139 <wait_KBC_sendready+0x29>
jmp    1119 <wait_KBC_sendready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_KBC_sendready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <io_in8@plt>
test   $0x2,%al
jne    1120 <wait_KBC_sendready+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_KBC_sendready() {
br label %1
1: ; preds = %6, %0
%2 = call i32 @io_in8(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @wait_KBC_sendready() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @io_in8(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
unsigned xrop3_214_1_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;
  unsigned stk3;
  unsigned stk4;
  stk4 = T & S;
  stk3 = D | stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_214_1_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    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_214_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
lea    (%rsi,%rcx,1),%edx
and    %eax,%ecx
or     %edi,%eax
or     $0xff,%ecx
xor    %eax,%edx
xor    %ecx,%edx
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_214_1_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
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = and i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %5
%28 = load i32, i32* %11
%29 = or i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %6
%31 = load i32, i32* %10
%32 = xor i32 %30, %31
store i32 %32, i32* %9
%33 = load i32, i32* %7
%34 = load i32, i32* %9
%35 = xor i32 %33, %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = and i32 %40, %41
%43 = or i32 %39, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @xrop3_214_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %6
%9 = and i32 %7, %4
%10 = or i32 %9, 255
%11 = xor i32 %8, %5
%12 = xor i32 %11, %10
%13 = xor i32 %5, -1
%14 = and i32 %12, %13
%15 = or i32 %14, %3
ret i32 %15
}
float mfabs(float in) {
  if (in > 0)
    return in;
  return -in;
}


x86 assembly (clang, -O0):
<mfabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1129 <mfabs+0x29>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1140 <mfabs+0x40>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfabs>:
movaps 0xef9(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @mfabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %3
store float %7, float* %2
br label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = fneg float %9
store float %10, float* %2
br label %11
11: ; preds = %8, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @mfabs(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %0, float %3
ret float %4
}
void a_store_l(volatile void *p, long x) {
  __asm__(".byte 0x67\n\tmov %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory");
}


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

x86 assembly (clang, -O2):
<a_store_l>:
mov    %rsi,(%edi)
ret

LLVM IR (-O0):
define void @a_store_l(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @a_store_l(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
tail call void asm ".byte 0x67\0A\09mov $1, $0", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *, double, double, double, int);
int main(void) {
  bar("eeee", 5.444567, 8.90765, 4.567789, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rdi
movsd  0xed2(%rip),%xmm0
movsd  0xed2(%rip),%xmm1
movsd  0xed2(%rip),%xmm2
mov    $0x5,%esi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
movsd  0xee0(%rip),%xmm2
mov    $0x5,%esi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"eeee\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x4015C73C925785F9, double 8.907650e+00, double 0x4012456A7AC81D3B, i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"eeee\00"
define i32 @main() {
%1 = tail call i32 @bar(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x4015C73C925785F9, double 8.907650e+00, double 0x4012456A7AC81D3B, i32 5)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ state;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
unsigned get_XKeyPressedEvent_state(void *_p) {
  return (unsigned)((XKeyPressedEvent *)_p)->state;
}


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

x86 assembly (clang, -O2):
<get_XKeyPressedEvent_state>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_XKeyPressedEvent_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_XKeyPressedEvent_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgdec2ib(void) { ngen("%s\t(%%rdx)", "decb", 0); }


x86 assembly (clang, -O0):
<cgdec2ib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec2ib>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09(%%rdx)\00"
@.str.1 = [5 x i8] c"decb\00"
define void @cgdec2ib() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09(%%rdx)\00"
@.str.1 = [5 x i8] c"decb\00"
define void @cgdec2ib() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
size_t op_len(char const *);
size_t set_len(char const *, size_t);
size_t get_op_len(const char *re, size_t re_len) {
  return re[0] == '[' ? set_len(re + 1, re_len - 1) + 1 : op_len(re);
}


x86 assembly (clang, -O0):
<get_op_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    1162 <get_op_len+0x42>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
sub    $0x1,%rsi
call   1040 <set_len@plt>
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116f <get_op_len+0x4f>
mov    -0x8(%rbp),%rdi
call   1030 <op_len@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_op_len>:
push   %rax
cmpb   $0x5b,(%rdi)
jne    1139 <get_op_len+0x19>
add    $0x1,%rdi
add    $0xffffffffffffffff,%rsi
call   1040 <set_len@plt>
add    $0x1,%rax
pop    %rcx
ret
pop    %rax
jmp    1030 <op_len@plt>

LLVM IR (-O0):
define i64 @get_op_len(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 91
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i64, i64* %4
%14 = sub i64 %13, 1
%15 = call i64 @set_len(i8* %12, i64 %14)
%16 = add i64 %15, 1
br label %20
17: ; preds = %2
%18 = load i8*, i8** %3
%19 = call i64 @op_len(i8* %18)
br label %20
20: ; preds = %17, %10
%21 = phi i64 [ %16, %10 ], [ %19, %17 ]
ret i64 %21
}

LLVM IR (-O2):
define i64 @get_op_len(i8* %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 91
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = add i64 %1, -1
%8 = tail call i64 @set_len(i8* %6, i64 %7)
%9 = add i64 %8, 1
br label %12
10: ; preds = %2
%11 = tail call i64 @op_len(i8* %0)
br label %12
12: ; preds = %10, %5
%13 = phi i64 [ %9, %5 ], [ %11, %10 ]
ret i64 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int av_popcount_c(uint32_t x) {
  x -= (x >> 1) & 0x55555555;
  x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
  x = (x + (x >> 4)) & 0x0F0F0F0F;
  x += x >> 8;
  return (x + (x >> 16)) & 0x3F;
}


x86 assembly (clang, -O0):
<av_popcount_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
add    %ecx,%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_popcount_c>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @av_popcount_c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add nsw i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 252645135
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 8
%21 = load i32, i32* %2
%22 = add nsw i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = load i32, i32* %2
%25 = ashr i32 %24, 16
%26 = add nsw i32 %23, %25
%27 = and i32 %26, 63
ret i32 %27
}

LLVM IR (-O2):
define i32 @av_popcount_c(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = lshr i32 %11, 8
%13 = add nuw nsw i32 %12, %11
%14 = lshr i32 %13, 16
%15 = add nuw nsw i32 %14, %13
%16 = and i32 %15, 63
ret i32 %16
}
/* Variables and functions */
int DBL_EPSILON;
int fabs(double);
int not_same(double a, double b) {
  return fabs(b - a) / (fabs(b) + fabs(a)) > 16 * (128 * DBL_EPSILON);
}


x86 assembly (clang, -O0):
<not_same>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
add    %edx,%ecx
cltd
idiv   %ecx
mov    0x2e89(%rip),%rcx
mov    (%rcx),%ecx
shl    $0x7,%ecx
shl    $0x4,%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_same>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movapd %xmm0,%xmm2
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebp
movsd  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
add    %ebp,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    0x2e8b(%rip),%rcx
mov    (%rcx),%edx
shl    $0xb,%edx
xor    %ecx,%ecx
cmp    %edx,%eax
setg   %cl
mov    %ecx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@DBL_EPSILON = global i32 0
define i32 @not_same(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fsub double %5, %6
%8 = call i32 @fabs(double %7)
%9 = load double, double* %4
%10 = call i32 @fabs(double %9)
%11 = load double, double* %3
%12 = call i32 @fabs(double %11)
%13 = add nsw i32 %10, %12
%14 = sdiv i32 %8, %13
%15 = load i32, i32* @DBL_EPSILON
%16 = mul nsw i32 128, %15
%17 = mul nsw i32 16, %16
%18 = icmp sgt i32 %14, %17
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@DBL_EPSILON = global i32 0
define i32 @not_same(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i32 @fabs(double %3)
%5 = tail call i32 @fabs(double %1)
%6 = tail call i32 @fabs(double %0)
%7 = add nsw i32 %6, %5
%8 = sdiv i32 %4, %7
%9 = load i32, i32* @DBL_EPSILON
%10 = shl nsw i32 %9, 11
%11 = icmp sgt i32 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int get_lqi(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @get_lqi() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *get_date_time() {
  time_t dt;
  struct tm *dc;
  time(&dt);
  dc = localtime(&dt);
  return dc;
}


x86 assembly (clang, -O0):
<get_date_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_date_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @get_date_time() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
ret %struct.tm* %5
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @get_date_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %4
}
/* Variables and functions */
int /*<<< orphan*/ mystrcpy(char *, char *);
int mystrlen(char *);
char *mystrcat(char *dest, char *src) {
  char *original = dest;
  int len = mystrlen(dest);
  dest += len;
  mystrcpy(dest, src);
  return original;
}


x86 assembly (clang, -O0):
<mystrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mystrlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mystrcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <mystrlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1040 <mystrcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @mystrcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @mystrlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @mystrcpy(i8* %5, i8* %1)
ret i8* %0
}