xunge/DecIR huggingface dataset:
/* Variables and functions */
int lrand48();
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void rnd(char *buf, int low, int high, int ndigits) {
  sprintf(buf, "%0*d", ndigits, (int)(low + (lrand48() % (high - low + 1))));
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%esi
sub    -0xc(%rbp),%esi
add    $0x1,%esi
cltd
idiv   %esi
mov    %edx,%eax
mov    -0x18(%rbp),%edx
add    %eax,%ecx
lea    0xe8f(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <lrand48@plt>
sub    %ebx,%ebp
add    $0x1,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
lea    0xeb7(%rip),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%0*d\00"
define void @rnd(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = call i32 (...) @lrand48()
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
%16 = add nsw i32 %15, 1
%17 = srem i32 %12, %16
%18 = add nsw i32 %11, %17
%19 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%0*d\00"
define void @rnd(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @lrand48()
%6 = sub i32 1, %1
%7 = add i32 %6, %2
%8 = srem i32 %5, %7
%9 = add nsw i32 %8, %1
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %9)
ret void
}
void gtk_corner_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_corner_type_get_type() {
ret void
}
/* Variables and functions */
unsigned char *data_from_file_raw(char *, int *);
int /*<<< orphan*/ data_to_file(unsigned char *, int, char *, char *);
int main(int argc, char **argv) {
  int data_size = 0;
  unsigned char *data = data_from_file_raw(argv[1], &data_size);
  data_to_file(data, data_size, argv[2], argv[3]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <data_from_file_raw@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
call   1030 <data_to_file@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,0xc(%rsp)
mov    0x8(%rsi),%rdi
lea    0xc(%rsp),%rsi
call   1040 <data_from_file_raw@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rbx),%rdx
mov    0x18(%rbx),%rcx
mov    %rax,%rdi
call   1030 <data_to_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i8* @data_from_file_raw(i8* %6, i32* %3)
%8 = load i32, i32* %3
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
%13 = call i32 @data_to_file(i8* %7, i32 %8, i8* %10, i8* %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
unsigned int sleep1(int);
int main(void) {
  printf("Going to sleep for 5 seconds.\n");
  unsigned int sleep_left = sleep1(5);
  printf("Woke up after %u seconds.\n", 5 - sleep_left);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%ebx
mov    $0x5,%edi
call   1050 <sleep1@plt>
sub    %eax,%ebx
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Going to sleep for 5 seconds.\0A\00"
@.str.1 = [27 x i8] c"Woke up after %u seconds.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep1(i32 5)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sub i32 5, %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Woke up after %u seconds.\0A\00"
@str = [30 x i8] c"Going to sleep for 5 seconds.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep1(i32 5)
%3 = sub i32 5, %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  if (n ^ m) {
    puts("Numbers are not equal\n");
  } else {
    puts("Numbers are equal\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1163 <main+0x43>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
jmp    116f <main+0x4f>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    (%rsp),%eax
lea    0xeda(%rip),%rax
lea    0xebc(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [23 x i8] c"Numbers are not equal\0A\00"
@.str.2 = [19 x i8] c"Numbers are equal\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = xor i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [23 x i8] c"Numbers are not equal\0A\00"
@.str.2 = [19 x i8] c"Numbers are equal\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %6, %7
%9 = select i1 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}
int test_imm_09int16_mem(short *val) {
  return ((*val) & (0x09 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_09int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_09int16_mem>:
testb  $0x9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_09int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 9
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_completion_queue_create_async() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_completion_queue_create_async>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_completion_queue_create_async>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_completion_queue_create_async() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_completion_queue_create_async() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void leave(int sig) {
  fprintf(fopen("/tmp/diagnostic", "w"), "closing myself down\n");
  cleanup();
  exit(sig);
}


x86 assembly (clang, -O0):
<leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1050 <fopen@plt>
mov    %eax,%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<leave>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1050 <fopen@plt>
lea    0xeb5(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"/tmp/diagnostic\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [21 x i8] c"closing myself down\0A\00"
define void @leave(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @cleanup()
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"/tmp/diagnostic\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [21 x i8] c"closing myself down\0A\00"
define void @leave(i32 %0) {
%2 = tail call i32 @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @cleanup()
%5 = tail call i32 @exit(i32 %0)
unreachable
}
int libvmfs_version() {}


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

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

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

LLVM IR (-O2):
define i32 @libvmfs_version() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void set_nonblock(int fd) {
  int flags = fcntl(fd, F_GETFL, 0);
  fcntl(fd, F_SETFL, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret void
}
void WRITE_UINT16(void *addr, int value) {
  unsigned char *buf = addr;
  buf[0] = (value >> 8) & 0xFF;
  buf[1] = value & 0xFF;
}


x86 assembly (clang, -O0):
<WRITE_UINT16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WRITE_UINT16>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @WRITE_UINT16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @WRITE_UINT16(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unused(char *);
void adaptcase(char *str) { unused(str); }


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

x86 assembly (clang, -O2):
<adaptcase>:
jmp    1030 <unused@plt>

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

LLVM IR (-O2):
define void @adaptcase(i8* %0) {
%2 = tail call i32 @unused(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __DSB();
int /*<<< orphan*/ __ISB();
int /*<<< orphan*/ __set_ICIALLU(int /*<<< orphan*/);
__attribute__((always_)) void L1C_InvalidateICacheAll(void) {
  __set_ICIALLU(0);
  __DSB();
  __ISB();
}


x86 assembly (clang, -O0):
<L1C_InvalidateICacheAll>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <__set_ICIALLU@plt>
mov    $0x0,%al
call   1040 <__DSB@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L1C_InvalidateICacheAll>:
push   %rax
xor    %edi,%edi
call   1050 <__set_ICIALLU@plt>
xor    %eax,%eax
call   1040 <__DSB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @L1C_InvalidateICacheAll() {
%1 = call i32 @__set_ICIALLU(i32 0)
%2 = call i32 (...) @__DSB()
%3 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @L1C_InvalidateICacheAll() {
%1 = tail call i32 @__set_ICIALLU(i32 0)
%2 = tail call i32 (...) @__DSB()
%3 = tail call i32 (...) @__ISB()
ret void
}
void get_empty_filp(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<get_empty_filp>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_empty_filp>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.get_empty_filp = [15 x i8] c"get_empty_filp\00"
define void @get_empty_filp() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.get_empty_filp, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.get_empty_filp = [15 x i8] c"get_empty_filp\00"
define void @get_empty_filp() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.get_empty_filp, i64 0, i64 0))
ret void
}
/* Type definitions */
struct bond {
  int dummy;
};

/* Variables and functions */
scalar_t__ generic_ptr(int, int);
struct bond *bond_ptr(int number) {
  return ((struct bond *)generic_ptr(40, number));
}


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

x86 assembly (clang, -O2):
<bond_ptr>:
mov    %edi,%esi
mov    $0x28,%edi
jmp    1030 <generic_ptr@plt>

LLVM IR (-O0):
%struct.bond = type { i32 }
define %struct.bond* @bond_ptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @generic_ptr(i32 40, i32 %3)
%5 = inttoptr i64 %4 to %struct.bond*
ret %struct.bond* %5
}

LLVM IR (-O2):
%struct.bond = type { i32 }
define %struct.bond* @bond_ptr(i32 %0) {
%2 = tail call i64 @generic_ptr(i32 40, i32 %0)
%3 = inttoptr i64 %2 to %struct.bond*
ret %struct.bond* %3
}
/* Variables and functions */
int helloworld2(int);
int helloworld(int a) { return helloworld2(a) + 2; }


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

x86 assembly (clang, -O2):
<helloworld>:
push   %rax
call   1030 <helloworld2@plt>
add    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @helloworld(i32 %0) {
%2 = tail call i32 @helloworld2(i32 %0)
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void c(int x) {
  if (+(+x) - x)
    link_error();
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1131 <c+0x21>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %3, %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @link_error()
br label %9
9: ; preds = %7, %1
ret void
}

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @strtoul() {
ret void
}
/* Variables and functions */
void *acc_deviceptr(int *);
int *acc_hostptr(void *);
int /*<<< orphan*/ assert(int);
int main() {
  int var;
#pragma acc data create(var)
  {
    void *var_p_d = acc_deviceptr(&var);
    assert(acc_hostptr(var_p_d) == &var);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <acc_deviceptr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <acc_hostptr@plt>
lea    -0x8(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <acc_deviceptr@plt>
mov    %rax,%rdi
call   1030 <acc_hostptr@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @acc_deviceptr(i32* %2)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @acc_hostptr(i8* %5)
%7 = icmp eq i32* %6, %2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i8* @acc_deviceptr(i32* %1)
%4 = call i32* @acc_hostptr(i8* %3)
%5 = icmp eq i32* %4, %1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret i32 0
}
void foo204() {}


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

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

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

LLVM IR (-O2):
define void @foo204() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mk_crctbl(int);
void init_crc() { mk_crctbl(0x864cfbL); }


x86 assembly (clang, -O0):
<init_crc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x864cfb,%edi
call   1030 <mk_crctbl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_crc>:
mov    $0x864cfb,%edi
jmp    1030 <mk_crctbl@plt>

LLVM IR (-O0):
define void @init_crc() {
%1 = call i32 @mk_crctbl(i32 8801531)
ret void
}

LLVM IR (-O2):
define void @init_crc() {
%1 = tail call i32 @mk_crctbl(i32 8801531)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int namesort(const void *pp1, const void *pp2) {
  char **p1 = (char **)pp1;
  char **p2 = (char **)pp2;
  return strcmp(*p1, *p2);
}


x86 assembly (clang, -O0):
<namesort>:
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    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<namesort>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @namesort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @namesort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
long syscall(int /*<<< orphan*/);
long gettid() { return syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i64 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = call i64 @syscall(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i64 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i64 @syscall(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ do_dynamic_array(int);
void test_dynamic_array() {
  do_dynamic_array(10);
  do_dynamic_array(10000);
  ;
}


x86 assembly (clang, -O0):
<test_dynamic_array>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <do_dynamic_array@plt>
mov    $0x2710,%edi
call   1030 <do_dynamic_array@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dynamic_array>:
push   %rax
mov    $0xa,%edi
call   1030 <do_dynamic_array@plt>
mov    $0x2710,%edi
pop    %rax
jmp    1030 <do_dynamic_array@plt>

LLVM IR (-O0):
define void @test_dynamic_array() {
%1 = call i32 @do_dynamic_array(i32 10)
%2 = call i32 @do_dynamic_array(i32 10000)
ret void
}

LLVM IR (-O2):
define void @test_dynamic_array() {
%1 = tail call i32 @do_dynamic_array(i32 10)
%2 = tail call i32 @do_dynamic_array(i32 10000)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int __syscall_cp(int, int /*<<< orphan*/, int, struct timespec const *,
                 struct timespec *);
int clock_nanosleep(clockid_t clk, int flags, const struct timespec *req,
                    struct timespec *rem) {
  return -__syscall_cp(265, clk, flags, req, rem);
}


x86 assembly (clang, -O0):
<clock_nanosleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x109,%edi
call   1030 <__syscall_cp@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_nanosleep>:
push   %rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x109,%edi
call   1030 <__syscall_cp@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @clock_nanosleep(i32 %0, i32 %1, %struct.timespec* %2, %struct.timespec* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.timespec*
%8 = alloca %struct.timespec*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.timespec* %2, %struct.timespec** %7
store %struct.timespec* %3, %struct.timespec** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load %struct.timespec*, %struct.timespec** %7
%12 = load %struct.timespec*, %struct.timespec** %8
%13 = call i32 @__syscall_cp(i32 265, i32 %9, i32 %10, %struct.timespec* %11, %struct.timespec* %12)
%14 = sub nsw i32 0, %13
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @clock_nanosleep(i32 %0, i32 %1, %struct.timespec* %2, %struct.timespec* %3) {
%5 = tail call i32 @__syscall_cp(i32 265, i32 %0, i32 %1, %struct.timespec* %2, %struct.timespec* %3)
%6 = sub nsw i32 0, %5
ret i32 %6
}
int f3(int x, int y) { return (x < 0) != (y >= 0); }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x8(%rbp)
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %edi,%eax
xor    %esi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f3(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 = icmp slt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
%10 = zext i1 %9 to i32
%11 = icmp ne i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 %1) {
%3 = xor i32 %0, %1
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
int datapidgen(pid, buffer, bsize, offset)
int pid;
char *buffer;
int bsize;
int offset;
{ return -1; }


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

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

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

LLVM IR (-O2):
define i32 @datapidgen(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
int gcd(int a, int b) {
  if (a < b) {
    gcd(b, a);
  }
  if (a % b) {
    gcd(b, a % b);
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1135 <gcd+0x25>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     115b <gcd+0x4b>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
jmp    1161 <gcd+0x51>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
mov    %esi,%ebp
jmp    112d <gcd+0x1d>
nopl   (%rax)
mov    %ebx,%eax
cltd
idiv   %ebp
mov    %ebp,%ebx
mov    %edx,%ebp
test   %edx,%edx
je     113c <gcd+0x2c>
cmp    %ebp,%ebx
jge    1120 <gcd+0x10>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <gcd@plt>
jmp    1120 <gcd+0x10>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 returned %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i32 [ %0, %2 ], [ %5, %9 ]
%5 = phi i32 [ %1, %2 ], [ %10, %9 ]
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @gcd(i32 %5, i32 %4)
br label %9
9: ; preds = %7, %3
%10 = srem i32 %4, %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %9
ret i32 %1
}
/* Variables and functions */
int ceph_armor_line_break(char *, char const *, char const *, char const *,
                          int /*<<< orphan*/);
int ceph_armor(char *dst, const char *dst_end, const char *src,
               const char *end) {
  return ceph_armor_line_break(dst, dst_end, src, end, 0);
}


x86 assembly (clang, -O0):
<ceph_armor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <ceph_armor_line_break@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_armor>:
xor    %r8d,%r8d
jmp    1030 <ceph_armor_line_break@plt>

LLVM IR (-O0):
define i32 @ceph_armor(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @ceph_armor_line_break(i8* %9, i8* %10, i8* %11, i8* %12, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @ceph_armor(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @ceph_armor_line_break(i8* %0, i8* %1, i8* %2, i8* %3, i32 0)
ret i32 %5
}
adrx0indreg1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (((float *)10000000)[x0]) = (*p1); }


x86 assembly (clang, -O0):
<adrx0indreg1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0indreg1_set>:
movss  (%rcx),%xmm0
movslq %edi,%rax
movss  %xmm0,0x989680(,%rax,4)
ret

LLVM IR (-O0):
define i32 @adrx0indreg1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %13
%17 = load float, float* %16
%18 = load i32, i32* %10
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %19
store float %17, float* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @adrx0indreg1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture %5) {
%7 = load float, float* %5
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %8
store float %7, float* %9
ret i32 undef
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *MYstrdup(const char *s) {
  size_t sz = strlen(s) + 1;
  char *p = malloc(sz);
  if (p != 0)
    memcpy(p, s, sz);
  return p;
}


x86 assembly (clang, -O0):
<MYstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <MYstrdup+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MYstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <MYstrdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @MYstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) {
  printf("usage: %s {-o|-m|-d|-l<tgt>} [-r altpath ] filenamefmt count\n",
         prog);
  printf("       %s {-o|-m|-d|-l<tgt>} [-r altpath ] filenamefmt ] -seconds\n",
         prog);
  printf("       %s {-o|-m|-d|-l<tgt>} [-r altpath ] filenamefmt start count\n",
         prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf2a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf38(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"usage: %s {-o|-m|-d|-l<tgt>} [-r altpath ] filenamefmt count\0A\00"
@.str.1 = [67 x i8] c" %s {-o|-m|-d|-l<tgt>} [-r altpath ] filenamefmt ] -seconds\0A\00"
@.str.2 = [68 x i8] c" %s {-o|-m|-d|-l<tgt>} [-r altpath ] filenamefmt start count\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@.str = [62 x i8] c"usage: %s {-o|-m|-d|-l<tgt>} [-r altpath ] filenamefmt count\0A\00"
@.str.1 = [67 x i8] c" %s {-o|-m|-d|-l<tgt>} [-r altpath ] filenamefmt ] -seconds\0A\00"
@.str.2 = [68 x i8] c" %s {-o|-m|-d|-l<tgt>} [-r altpath ] filenamefmt start count\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int au_br_wh_linkable(int brperm) { return !(brperm & (1 << 8)); }


x86 assembly (clang, -O0):
<au_br_wh_linkable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<au_br_wh_linkable>:
xor    %eax,%eax
test   $0x100,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @au_br_wh_linkable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 256
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @au_br_wh_linkable(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ intr_acknowledge();
void evt_acknowledge(void) { intr_acknowledge(); }


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

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

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

LLVM IR (-O2):
define void @evt_acknowledge() {
%1 = tail call i32 (...) @intr_acknowledge()
ret void
}
char *Tcl_Alloc(size)
unsigned int size;
{
  char *result;
  result = malloc(size);
  if (result == 0 && size)
    panic("unable to alloc %d bytes", size);
  return result;
}


x86 assembly (clang, -O0):
<Tcl_Alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <Tcl_Alloc+0x3f>
cmpl   $0x0,-0x4(%rbp)
je     115f <Tcl_Alloc+0x3f>
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <panic@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tcl_Alloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
je     1149 <Tcl_Alloc+0x29>
test   %r14,%r14
jne    1149 <Tcl_Alloc+0x29>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <panic@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"unable to alloc %d bytes\00"
define i8* @Tcl_Alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @panic to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [25 x i8] c"unable to alloc %d bytes\00"
define i8* @Tcl_Alloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
%5 = icmp ne i32 %0, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @panic to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %9
9: ; preds = %7, %1
ret i8* %3
}
void g_enum_get_value_by_name() {}


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

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

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

LLVM IR (-O2):
define void @g_enum_get_value_by_name() {
ret void
}
void some_work(i, n) int i, n;
{
  int j;
#pragma omp parallel default(shared)
  {
#pragma omp for
    for (j = 0; j < n; j++)
      work(i, j);
  }
}


x86 assembly (clang, -O0):
<some_work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114c <some_work+0x3c>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <work@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <some_work+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<some_work>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1133 <some_work+0x23>
mov    %esi,%ebx
mov    %edi,%r14d
xor    %ebp,%ebp
nop
mov    %r14d,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <work@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <some_work+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @some_work(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @work to i32 (i32, i32, ...)*)(i32 %11, i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @some_work(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @work to i32 (i32, i32, ...)*)(i32 %0, i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}