xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cf_entry_compound(char *, char *, char *);
int /*<<< orphan*/ cf_entry_toplevel(char *, char *);
char *strchr(char *, char);
void cf_entry(char *key, char *val) {
  char *dot = strchr(key, '.');
  if (!dot)
    cf_entry_toplevel(key, val);
  else {
    *dot++ = 0;
    cf_entry_compound(key, dot, val);
  }
}


x86 assembly (clang, -O0):
<cf_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <cf_entry+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <cf_entry_toplevel@plt>
jmp    1192 <cf_entry+0x62>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <cf_entry_compound@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf_entry>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1165 <cf_entry+0x35>
mov    %rax,%rsi
add    $0x1,%rsi
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cf_entry_compound@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <cf_entry_toplevel@plt>

LLVM IR (-O0):
define void @cf_entry(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strchr(i8* %6, i8 signext 46)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @cf_entry_toplevel(i8* %11, i8* %12)
br label %21
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %5
store i8 0, i8* %15
%17 = load i8*, i8** %3
%18 = load i8*, i8** %5
%19 = load i8*, i8** %4
%20 = call i32 @cf_entry_compound(i8* %17, i8* %18, i8* %19)
br label %21
21: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
define void @cf_entry(i8* %0, i8* %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @cf_entry_toplevel(i8* %0, i8* %1)
br label %10
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %3
%9 = tail call i32 @cf_entry_compound(i8* %0, i8* %8, i8* %1)
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int, int);
int open(char *, int /*<<< orphan*/);
void kobo_brightness(int brightness) {
  int fd;
  if ((fd = open("/dev/ntx_io", O_RDWR)) == -1) {
    return;
  }
  ioctl(fd, 241, brightness);
  close(fd);
}


x86 assembly (clang, -O0):
<kobo_brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1161 <kobo_brightness+0x31>
jmp    1179 <kobo_brightness+0x49>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    $0xf1,%esi
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kobo_brightness>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     116c <kobo_brightness+0x3c>
mov    %eax,%ebp
mov    %eax,%edi
mov    $0xf1,%esi
mov    %ebx,%edx
call   1030 <ioctl@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <close@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/ntx_io\00"
@O_RDWR = global i32 0
define void @kobo_brightness(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = call i32 @ioctl(i32 %9, i32 241, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/ntx_io\00"
@O_RDWR = global i32 0
define void @kobo_brightness(i32 %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @ioctl(i32 %3, i32 241, i32 %0)
%7 = tail call i32 @close(i32 %3)
br label %8
8: ; preds = %1, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int main(int argc, char **argv) {
  mkdir("/tmp/ageg/", 0777);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"/tmp/ageg/\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 511)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"/tmp/ageg/\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 511)
ret i32 0
}
void REMR3NotifyPhysRamDeregister(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3NotifyPhysRamDeregister() {
ret void
}
void test_invalid_clause() {
  int i;
#pragma omp target parallel for simd foo bar
  for (i = 0; i < 16; ++i)
    ;
}


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

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

LLVM IR (-O0):
define void @test_invalid_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
ret void
}

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

/* Variables and functions */
int null_readsector_raw(uint8_t id, uint8_t *buffer, int sector, int ismsf,
                        int cdrom_sector_type, int cdrom_sector_flags,
                        int *len) {
  *len = 0;
  return (0);
}


x86 assembly (clang, -O0):
<null_readsector_raw>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_readsector_raw>:
mov    0x8(%rsp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @null_readsector_raw(i32 %0, i32* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6) {
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
store i32 %0, i32* %8
store i32* %1, i32** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32* %6, i32** %14
%15 = load i32*, i32** %14
store i32 0, i32* %15
ret i32 0
}

LLVM IR (-O2):
define i32 @null_readsector_raw(i32 %0, i32* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* nocapture writeonly %6) {
store i32 0, i32* %6
ret i32 0
}
/* Type definitions */
struct product {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *product_ops_get_description(struct product *product) {
  printf("product::get_description()\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.product = type { i32 }
@.str = [28 x i8] c"product::get_description()\0A\00"
define i8* @product_ops_get_description(%struct.product* %0) {
%2 = alloca %struct.product*
store %struct.product* %0, %struct.product** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
%struct.product = type { i32 }
@str = [27 x i8] c"product::get_description()\00"
define noalias i8* @product_ops_get_description(%struct.product* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Type definitions */
struct network {
  int dummy;
};

/* Variables and functions */
struct network *network_alloc(int, int, int);
int /*<<< orphan*/ network_init(struct network *);
struct network *network_build(int input_bytes, int store_bytes,
                              int need_bytes) {
  struct network *network;
  network = network_alloc(input_bytes, store_bytes, need_bytes);
  if (!network)
    return NULL;
  network_init(network);
  return network;
}


x86 assembly (clang, -O0):
<network_build>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <network_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115b <network_build+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    116c <network_build+0x4c>
mov    -0x20(%rbp),%rdi
call   1040 <network_init@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_build>:
push   %rbx
call   1030 <network_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1136 <network_build+0x16>
mov    %rbx,%rdi
call   1040 <network_init@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.network = type { i32 }
define %struct.network* @network_build(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.network*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.network*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call %struct.network* @network_alloc(i32 %9, i32 %10, i32 %11)
store %struct.network* %12, %struct.network** %8
%13 = load %struct.network*, %struct.network** %8
%14 = icmp ne %struct.network* %13, null
br i1 %14, label %16, label %15
15: ; preds = %3
store %struct.network* null, %struct.network** %4
br label %20
16: ; preds = %3
%17 = load %struct.network*, %struct.network** %8
%18 = call i32 @network_init(%struct.network* %17)
%19 = load %struct.network*, %struct.network** %8
store %struct.network* %19, %struct.network** %4
br label %20
20: ; preds = %16, %15
%21 = load %struct.network*, %struct.network** %4
ret %struct.network* %21
}

LLVM IR (-O2):
%struct.network = type { i32 }
define %struct.network* @network_build(i32 %0, i32 %1, i32 %2) {
%4 = tail call %struct.network* @network_alloc(i32 %0, i32 %1, i32 %2)
%5 = icmp eq %struct.network* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @network_init(%struct.network* %4)
br label %8
8: ; preds = %3, %6
ret %struct.network* %4
}
int coresight_get_trace_id(int cpu) { return (0x10 + (cpu * 2)); }


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

x86 assembly (clang, -O2):
<coresight_get_trace_id>:
lea    (%rdi,%rdi,1),%eax
add    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @coresight_get_trace_id(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 16
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void send_fail_message_to_wcm() {
  fprintf(stderr, "INFO: sending fail message to WCM\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"INFO: sending fail message to WCM\0A\00"
define void @send_fail_message_to_wcm() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"INFO: sending fail message to WCM\0A\00"
define void @send_fail_message_to_wcm() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ reverse_string(char *);
char *rstrdup(char *);
int main() {
  char str[] = "Atul Patil";
  char *rstr = rstrdup(str);
  reverse_string(str);
  printf("%s ==> %s\n", str, rstr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xf(%rbp),%rdi
call   1050 <rstrdup@plt>
mov    %rax,-0x18(%rbp)
lea    -0xf(%rbp),%rdi
call   1030 <reverse_string@plt>
lea    -0xf(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x746150206c757441,%rax
50 61 74
mov    %rax,0x8(%rsp)
movl   $0x6c6974,0xf(%rsp)
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1050 <rstrdup@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <reverse_string@plt>
lea    0xe9e(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str = [11 x i8] c"Atul Patil\00"
@.str = [11 x i8] c"%s ==> %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [11 x i8]* %2 to i8*
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%6 = call i8* @rstrdup(i8* %5)
store i8* %6, i8** %3
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%8 = call i32 @reverse_string(i8* %7)
%9 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [11 x i8] c"Atul Patil\00"
@.str = [11 x i8] c"%s ==> %s\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i8* @rstrdup(i8* %2)
%4 = call i32 @reverse_string(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
ret i32 0
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 1373777115UL;
    local1 = 0UL;
    while (local1 < 0UL) {
      local1++;
    }
    output[0UL] = (state[0UL] + 255873917UL) << 1UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x51e22cdb,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1141 <RandomFunc+0x41>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rcx
add    $0xf40537d,%rcx
shl    $0x1,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
mov    $0xc24500b0,%ecx
lea    (%rcx,%rax,2),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, 1373777115
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i64, i64* %6
%17 = add i64 %16, 1
store i64 %17, i64* %6
br label %12
18: ; preds = %12
%19 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%20 = load i64, i64* %19
%21 = add i64 %20, 255873917
%22 = shl i64 %21, 1
%23 = load i64*, i64** %4
%24 = getelementptr inbounds i64, i64* %23, i64 0
store i64 %22, i64* %24
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 1
%5 = add i64 %4, 3259302064
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *escape_char(char ch) {
  static char charstr[4];
  if (ch == '\'') {
    strcpy(charstr, "\\'");
  } else {
    charstr[0] = ch;
    charstr[1] = '\0';
  }
  return charstr;
}


x86 assembly (clang, -O0):
<escape_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x27,%eax
jne    1143 <escape_char+0x33>
lea    0x2ef7(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1153 <escape_char+0x43>
mov    -0x1(%rbp),%al
mov    %al,0x2edd(%rip)
movb   $0x0,0x2ed7(%rip)
lea    0x2ecf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape_char>:
push   %rax
cmp    $0x27,%dil
jne    112c <escape_char+0x1c>
lea    0x2f0b(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <strcpy@plt>
jmp    113a <escape_char+0x2a>
mov    %dil,0x2ef6(%rip)
movb   $0x0,0x2ef0(%rip)
lea    0x2ee8(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@escape_char.charstr = internal global [4 x i8] zeroinitializer
@.str = [3 x i8] c"\\'\00"
define i8* @escape_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 39
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @strcpy(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escape_char.charstr, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = load i8, i8* %2
store i8 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escape_char.charstr, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escape_char.charstr, i64 0, i64 1)
br label %10
10: ; preds = %8, %6
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escape_char.charstr, i64 0, i64 0)
}

LLVM IR (-O2):
@escape_char.charstr = internal global [4 x i8] zeroinitializer
@.str = [3 x i8] c"\\'\00"
define i8* @escape_char(i8 signext %0) {
%2 = icmp eq i8 %0, 39
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @strcpy(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escape_char.charstr, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %6
5: ; preds = %1
store i8 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escape_char.charstr, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escape_char.charstr, i64 0, i64 1)
br label %6
6: ; preds = %5, %3
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @escape_char.charstr, i64 0, i64 0)
}
unsigned long read_cr3(void) {
  unsigned long val;
  asm volatile("mov %%cr3,%0\n\t" : "=r"(val) : : "memory");
  return val;
}


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

x86 assembly (clang, -O2):
<read_cr3>:
mov    %cr3,%rax
ret

LLVM IR (-O0):
define i64 @read_cr3() {
%1 = alloca i64
%2 = call i64 asm sideeffect "mov %cr3,$0\0A\09", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @read_cr3() {
%1 = tail call i64 asm sideeffect "mov %cr3,$0\0A\09", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int strlen(char *);
char *css_cpy_str(char *old) {
  if (old == NULL) {
    return NULL;
  }
  size_t size = strlen(old) + 1;
  char *new = malloc(sizeof(char) * size);
  memcpy(new, old, size);
  return new;
}


x86 assembly (clang, -O0):
<css_cpy_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <css_cpy_str+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1192 <css_cpy_str+0x62>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<css_cpy_str>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1163 <css_cpy_str+0x33>
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15d,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1166 <css_cpy_str+0x36>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @css_cpy_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = tail call i8* @malloc(i32 %5)
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i64 %6)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int write_dobldobl_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(234, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<write_dobldobl_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xea,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dobldobl_start_system>:
mov    $0xea,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @write_dobldobl_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 234, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_dobldobl_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 234, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
float atan(float);
float zoomToFov(float zoom) { return 2.0f * atan(1.0f / zoom); }


x86 assembly (clang, -O0):
<zoomToFov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movss  0xec6(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zoomToFov>:
push   %rax
movss  0xee7(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <atan@plt>
addss  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @zoomToFov(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 1.000000e+00, %3
%5 = call float @atan(float %4)
%6 = fmul float 2.000000e+00, %5
ret float %6
}

LLVM IR (-O2):
define float @zoomToFov(float %0) {
%2 = fdiv float 1.000000e+00, %0
%3 = tail call float @atan(float %2)
%4 = fmul float %3, 2.000000e+00
ret float %4
}
void switch_pgdir(void *pg_dir) {
  __asm volatile("mov %0, %%cr3" ::"r"(pg_dir));
}


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

x86 assembly (clang, -O2):
<switch_pgdir>:
mov    %rdi,%cr3
ret

LLVM IR (-O0):
define void @switch_pgdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @switch_pgdir(i8* %0) {
tail call void asm sideeffect "mov $0, %cr3", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Type definitions */
struct SwsContextArmJit {
  int dummy;
};

/* Variables and functions */
struct SwsContextArmJit *sws_arm_jit_create_scaler_internal(int, int, int, int,
                                                            int, int);
struct SwsContextArmJit *sws_arm_jit_create_omapfb_yuv422_scaler(
    int source_w, int source_h, int target_w, int target_h, int quality) {
  return sws_arm_jit_create_scaler_internal(source_w, source_h, target_w,
                                            target_h, quality, 1);
}


x86 assembly (clang, -O0):
<sws_arm_jit_create_omapfb_yuv422_scaler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <sws_arm_jit_create_scaler_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sws_arm_jit_create_omapfb_yuv422_scaler>:
mov    $0x1,%r9d
jmp    1030 <sws_arm_jit_create_scaler_internal@plt>

LLVM IR (-O0):
%struct.SwsContextArmJit = type { i32 }
define %struct.SwsContextArmJit* @sws_arm_jit_create_omapfb_yuv422_scaler(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call %struct.SwsContextArmJit* @sws_arm_jit_create_scaler_internal(i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 1)
ret %struct.SwsContextArmJit* %16
}

LLVM IR (-O2):
%struct.SwsContextArmJit = type { i32 }
define %struct.SwsContextArmJit* @sws_arm_jit_create_omapfb_yuv422_scaler(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call %struct.SwsContextArmJit* @sws_arm_jit_create_scaler_internal(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 1)
ret %struct.SwsContextArmJit* %6
}
/* Variables and functions */
scalar_t__ count(char);
scalar_t__ skips(int);
int onlymatch(char c, int lvl, int toskip) {
  return skips(lvl) + toskip + 1 >= count(c);
}


x86 assembly (clang, -O0):
<onlymatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <skips@plt>
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <count@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onlymatch>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <skips@plt>
movslq %ebx,%rcx
lea    (%rcx,%rax,1),%rbx
add    $0x1,%rbx
mov    %ebp,%edi
call   1030 <count@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setge  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @onlymatch(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = call i64 @skips(i32 %7)
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = add nsw i64 %8, %10
%12 = add nsw i64 %11, 1
%13 = load i8, i8* %4
%14 = call i64 @count(i8 signext %13)
%15 = icmp sge i64 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @onlymatch(i8 signext %0, i32 %1, i32 %2) {
%4 = tail call i64 @skips(i32 %1)
%5 = sext i32 %2 to i64
%6 = add nsw i64 %5, 1
%7 = add i64 %6, %4
%8 = tail call i64 @count(i8 signext %0)
%9 = icmp sge i64 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char);
void uart_printf(char *str) {
  for (int i = 0; str[i] != '\0'; ++i) {
    uart_putc(str[i]);
  }
  return;
}


x86 assembly (clang, -O0):
<uart_printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <uart_printf+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <uart_printf+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_printf>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_printf+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_printf+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @uart_printf(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @uart_putc(i8 signext %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @uart_printf(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @uart_putc(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
void dummy_dec_png(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_max_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_max_pi16(__m64 a, __m64 b) { return _mm_max_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_max_pi16>:
jmp    1030 <_mm_max_pi16@plt>

LLVM IR (-O0):
define i32 @test_mm_max_pi16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_max_pi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_max_pi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_pi16(i32 %0, i32 %1)
ret i32 %3
}
int compare(const void *first, const void *second) {
  if (*(int *)first > *(int *)second)
    return 1;
  else if (*(int *)first < *(int *)second)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <compare+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <compare+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <compare+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <compare+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
const char *copy_str(const char *begin, const char *end) {
  char *s = malloc(end - begin + 1);
  memcpy(s, begin, end - begin);
  s[end - begin] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<copy_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_str>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @copy_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = add nsw i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i8* @malloc(i32 %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = ptrtoint i8* %16 to i64
%19 = ptrtoint i8* %17 to i64
%20 = sub i64 %18, %19
%21 = trunc i64 %20 to i32
%22 = call i32 @memcpy(i8* %14, i8* %15, i32 %21)
%23 = load i8*, i8** %5
%24 = load i8*, i8** %4
%25 = load i8*, i8** %3
%26 = ptrtoint i8* %24 to i64
%27 = ptrtoint i8* %25 to i64
%28 = sub i64 %26, %27
%29 = getelementptr inbounds i8, i8* %23, i64 %28
store i8 0, i8* %29
%30 = load i8*, i8** %5
ret i8* %30
}

LLVM IR (-O2):
define i8* @copy_str(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = add i32 %6, 1
%8 = tail call i8* @malloc(i32 %7)
%9 = tail call i32 @memcpy(i8* %8, i8* %0, i32 %6)
%10 = getelementptr inbounds i8, i8* %8, i64 %5
store i8 0, i8* %10
ret i8* %8
}
int test_imm_EBint16_reg(short val) {
  return ((val) & (-0xEB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EBint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff15,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EBint16_reg>:
test   $0xff15,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EBint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -235
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_EBint16_reg(i16 signext %0) {
%2 = and i16 %0, -235
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "%d", sizeof(int) * 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
mov    $0x20,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x20,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 32)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 32)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double a, b, r;
  scanf("%lf %lf", &a, &b);
  r = (a * b) / 12;
  printf("%.3lf\n", r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
divsd  0xeb2(%rip),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = fdiv double %8, 1.200000e+01
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = fdiv double %8, 1.200000e+01
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}
long double func1(long double x) {
  if (x > 0.0)
    return x;
  else if (x < 0.0)
    return -x;
  else
    return x;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    112b <func1+0x2b>
jmp    1120 <func1+0x20>
fldt   -0x20(%rbp)
fstpt  -0x10(%rbp)
jmp    1152 <func1+0x52>
fldt   -0x20(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    114c <func1+0x4c>
jmp    113f <func1+0x3f>
fldt   -0x20(%rbp)
fchs
fstpt  -0x10(%rbp)
jmp    1152 <func1+0x52>
fldt   -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
fldt   0x8(%rsp)
fldz
fucomip %st(1),%st
fld    %st(0)
fchs
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
ret

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

LLVM IR (-O2):
define x86_fp80 @func1(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%3 = fneg x86_fp80 %0
%4 = select i1 %2, x86_fp80 %3, x86_fp80 %0
ret x86_fp80 %4
}
float maximum(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<maximum>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <maximum+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <maximum+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximum>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @maximum(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @maximum(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float RandZeroToOne(void) { return (float)rand() / RAND_MAX; }


x86 assembly (clang, -O0):
<RandZeroToOne>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec1(%rip),%rax
divss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandZeroToOne>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @RandZeroToOne() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
ret float %4
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @RandZeroToOne() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
ret float %4
}
int do_147() { return 147; }


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

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

LLVM IR (-O0):
define i32 @do_147() {
ret i32 147
}

LLVM IR (-O2):
define i32 @do_147() {
ret i32 147
}
int cn_bitStrLen(char *str) {
  int i = 1;
  while (*str != 0) {
    str++;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<cn_bitStrLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <cn_bitStrLen+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <cn_bitStrLen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cn_bitStrLen>:
cmpb   $0x0,(%rdi)
je     111b <cn_bitStrLen+0x1b>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <cn_bitStrLen+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cn_bitStrLen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}