xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int *f() {
  int x[3] = {1, 11, 111};
  printf("F says: %d %d %d\n", x[0], x[1], x[2]);
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
mov    $0xb,%edx
mov    $0x6f,%ecx
call   1030 <printf@plt>
lea    0xc(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f.x = [3 x i32] [i32 1, i32 11, i32 111]
@.str = [18 x i8] c"F says: %d %d %d\0A\00"
define i32* @f() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8)
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
ret i32* %10
}

LLVM IR (-O2):
@.str = [18 x i8] c"F says: %d %d %d\0A\00"
define noalias i32* @f() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i32 11, i32 111)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, char const *, int);
int strlen(char const *);
int /*<<< orphan*/ writeInt(unsigned char **, int);
void writeCString(unsigned char **pptr, const char *string) {
  int len = strlen(string);
  writeInt(pptr, len);
  memcpy(*pptr, string, len);
  *pptr += len;
}


x86 assembly (clang, -O0):
<writeCString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <writeInt@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeCString>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <writeInt@plt>
mov    (%rbx),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
movslq %ebp,%rax
add    %rax,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @writeCString(i8** %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @writeInt(i8** %0, i32 %3)
%5 = load i8*, i8** %0
%6 = tail call i32 @memcpy(i8* %5, i8* %1, i32 %3)
%7 = load i8*, i8** %0
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %0
ret void
}
/* Variables and functions */
long lrint(double);
long int iRound(double f) { return lrint(f); }


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

x86 assembly (clang, -O2):
<iRound>:
jmp    1030 <lrint@plt>

LLVM IR (-O0):
define i64 @iRound(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @lrint(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @iRound(double %0) {
%2 = tail call i64 @lrint(double %0)
ret i64 %2
}
int omp_get_max_threads() {}


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

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

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

LLVM IR (-O2):
define i32 @omp_get_max_threads() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_livecode_comments() {
  test_parser_verify_parse(test_parser_sourcefile("livecode", " --comment"),
                           "livecode", "", "--comment", 0);
}


x86 assembly (clang, -O0):
<test_livecode_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xebc(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_livecode_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xeca(%rip),%rdx
lea    0xec5(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"livecode\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"--comment\00"
define void @test_livecode_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"livecode\00"
@.str.1 = [11 x i8] c" --comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"--comment\00"
define void @test_livecode_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
struct shmid_ds {
  int dummy;
};
struct shm_info {
  int shm_tot;
  int shm_rss;
  int shm_swp;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct shm_info *, int /*<<< orphan*/, int);
int shmctl(int shmid, int cmd, struct shmid_ds *buf) {
  struct shm_info *i = (struct shm_info *)buf;
  memset(i, 0, sizeof(*i));
  i->shm_tot = 9;
  i->shm_rss = 100;
  i->shm_swp = 9000;
  return 0;
}


x86 assembly (clang, -O0):
<shmctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x64,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x2328,0x8(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmctl>:
push   %rbx
mov    %rdx,%rbx
mov    %rdx,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
movabs $0x6400000009,%rax
mov    %rax,(%rbx)
movl   $0x2328,0x8(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.shmid_ds = type { i32 }
%struct.shm_info = type { i32, i32, i32 }
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.shmid_ds*
%7 = alloca %struct.shm_info*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.shmid_ds* %2, %struct.shmid_ds** %6
%8 = load %struct.shmid_ds*, %struct.shmid_ds** %6
%9 = bitcast %struct.shmid_ds* %8 to %struct.shm_info*
store %struct.shm_info* %9, %struct.shm_info** %7
%10 = load %struct.shm_info*, %struct.shm_info** %7
%11 = call i32 @memset(%struct.shm_info* %10, i32 0, i32 12)
%12 = load %struct.shm_info*, %struct.shm_info** %7
%13 = getelementptr inbounds %struct.shm_info, %struct.shm_info* %12, i32 0, i32 0
store i32 9, i32* %13
%14 = load %struct.shm_info*, %struct.shm_info** %7
%15 = getelementptr inbounds %struct.shm_info, %struct.shm_info* %14, i32 0, i32 1
store i32 100, i32* %15
%16 = load %struct.shm_info*, %struct.shm_info** %7
%17 = getelementptr inbounds %struct.shm_info, %struct.shm_info* %16, i32 0, i32 2
store i32 9000, i32* %17
ret i32 0
}

LLVM IR (-O2):
%struct.shmid_ds = type { i32 }
%struct.shm_info = type { i32, i32, i32 }
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* %2) {
%4 = bitcast %struct.shmid_ds* %2 to %struct.shm_info*
%5 = tail call i32 @memset(%struct.shm_info* %4, i32 0, i32 12)
%6 = getelementptr %struct.shmid_ds, %struct.shmid_ds* %2, i64 0, i32 0
store i32 9, i32* %6
%7 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %2, i64 1, i32 0
store i32 100, i32* %7
%8 = getelementptr inbounds %struct.shmid_ds, %struct.shmid_ds* %2, i64 2, i32 0
store i32 9000, i32* %8
ret i32 0
}
/* Variables and functions */
char *addOneToBinary(char *);
char *decimalBinary(char *, int);
char *invertBits(char *);
char *decimalToBinary(char *binary_returned, int decimal) {
  char *binary = binary_returned;
  if (decimal > 0) {
    binary = decimalBinary(binary, decimal);
  } else {
    binary = decimalBinary(binary, decimal);
    binary = invertBits(binary);
    binary = addOneToBinary(binary);
  }
  return binary;
}


x86 assembly (clang, -O0):
<decimalToBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1166 <decimalToBinary+0x36>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <decimalBinary@plt>
mov    %rax,-0x18(%rbp)
jmp    1190 <decimalToBinary+0x60>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <decimalBinary@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <invertBits@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <addOneToBinary@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimalToBinary>:
push   %rbx
mov    %esi,%ebx
call   1040 <decimalBinary@plt>
test   %ebx,%ebx
jle    113e <decimalToBinary+0xe>
pop    %rbx
ret
mov    %rax,%rdi
call   1050 <invertBits@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <addOneToBinary@plt>

LLVM IR (-O0):
define i8* @decimalToBinary(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 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%12 = call i8* @decimalBinary(i8* %10, i32 %11)
store i8* %12, i8** %5
br label %21
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i32, i32* %4
%16 = call i8* @decimalBinary(i8* %14, i32 %15)
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = call i8* @invertBits(i8* %17)
store i8* %18, i8** %5
%19 = load i8*, i8** %5
%20 = call i8* @addOneToBinary(i8* %19)
store i8* %20, i8** %5
br label %21
21: ; preds = %13, %9
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
define i8* @decimalToBinary(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = tail call i8* @decimalBinary(i8* %0, i32 %1)
br i1 %3, label %8, label %5
5: ; preds = %2
%6 = tail call i8* @invertBits(i8* %4)
%7 = tail call i8* @addOneToBinary(i8* %6)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ %4, %2 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strtoul(char *, int /*<<< orphan*/, int);
char *mac_address_format_convert(char *config_format) {
  int a = strtoul(config_format, 0, 16);
  printf("mac_address_format_convert is %d\n", a);
}


x86 assembly (clang, -O0):
<mac_address_format_convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_address_format_convert>:
push   %rax
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"mac_address_format_convert is %d\0A\00"
define i8* @mac_address_format_convert(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strtoul(i8* %5, i32 0, i32 16)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [34 x i8] c"mac_address_format_convert is %d\0A\00"
define noalias i8* @mac_address_format_convert(i8* %0) {
%2 = tail call i32 @strtoul(i8* %0, i32 0, i32 16)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: whois [-aAbfgiIklmQrR6] [-c country-code | -h hostname] "
          "[-p port] name ...\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [83 x i8] c"usage: whois [-aAbfgiIklmQrR6] [-c country-code | -h hostname] [-p port] name ...\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [83 x i8] c"usage: whois [-aAbfgiIklmQrR6] [-c country-code | -h hostname] [-p port] name ...\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
long sys_iopolicysys(int cmd, void *arg) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @sys_iopolicysys(i32 %0, i8* nocapture readnone %1) {
ret i64 0
}
int map_file_vm_region(char *path, void **addr, int len) {
  int ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<map_file_vm_region>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @map_file_vm_region(i8* nocapture readnone %0, i8** nocapture readnone %1, i32 %2) {
ret i32 0
}
void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc) {}


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

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

LLVM IR (-O0):
%struct.intel_crtc = type opaque
define void @intel_crtc_enable_pipe_crc(%struct.intel_crtc* %0) {
%2 = alloca %struct.intel_crtc*
store %struct.intel_crtc* %0, %struct.intel_crtc** %2
ret void
}

LLVM IR (-O2):
%struct.intel_crtc = type opaque
define void @intel_crtc_enable_pipe_crc(%struct.intel_crtc* nocapture %0) {
ret void
}
int divi(int op1, int op2) { return op1 / op2; }


x86 assembly (clang, -O0):
<divi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divi>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @divi(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @divi(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
void avio_rl16() {}


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

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

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

LLVM IR (-O2):
define void @avio_rl16() {
ret void
}
void ARGBAttenuateRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBAttenuateRow_NEON() {
ret void
}
/* Variables and functions */
int cmp(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char a[10], b[10];
  int p;
  scanf("%s", a);
  scanf("%s", b);
  p = cmp(a, b);
  printf("%d", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xe(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <cmp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xec0(%rip),%r15
lea    0x16(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <cmp@plt>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%11 = call i32 @cmp(i8* %9, i8* %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @cmp(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int from_configure;
};
typedef TYPE_1__ XUnmapEvent;

/* Variables and functions */
void set_XUnmapEvent_from_configure(void *_p, int _v) {
  ((XUnmapEvent *)_p)->from_configure = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XUnmapEvent_from_configure(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
void u8_to_hex(const uint8_t v, uint8_t hex[2]) {
  const uint8_t tbl[0x10] = {
      '0', '1', '2', '3', '4', '5', '6', '7',
      '8', '9', 'a', 'b', 'c', 'd', 'e', 'f',
  };
  hex[1] = tbl[v >> 0 & 15];
  hex[0] = tbl[v >> 4 & 15];
}


x86 assembly (clang, -O0):
<u8_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x0,%eax
and    $0xf,%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_to_hex>:
movzbl %dil,%eax
and    $0xf,%edi
lea    0xef2(%rip),%rcx
mov    (%rdi,%rcx,1),%dl
mov    %dl,0x1(%rsi)
shr    $0x4,%rax
mov    (%rax,%rcx,1),%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
@__const.u8_to_hex.tbl = [16 x i8] c"0123456789abcdef"
define void @u8_to_hex(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca [16 x i8]
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = bitcast [16 x i8]* %5 to i8*
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = ashr i32 %8, 0
%10 = and i32 %9, 15
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = ashr i32 %17, 4
%19 = and i32 %18, 15
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
@__const.u8_to_hex.tbl = [16 x i8] c"0123456789abcdef"
define void @u8_to_hex(i8 signext %0, i8* nocapture writeonly %1) {
%3 = zext i8 %0 to i32
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.u8_to_hex.tbl, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %3, 4
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.u8_to_hex.tbl, i64 0, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reportError(int /*<<< orphan*/ *);
int target(int foo) {
  if (foo == 90) {
    reportError(NULL);
    return -50;
  }
  return foo + 12;
}


x86 assembly (clang, -O0):
<target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jne    113a <target+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <reportError@plt>
movl   $0xffffffce,-0x4(%rbp)
jmp    1143 <target+0x33>
mov    -0x8(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target>:
cmp    $0x5a,%edi
jne    1127 <target+0x17>
push   %rax
xor    %edi,%edi
call   1030 <reportError@plt>
mov    $0xffffffce,%eax
add    $0x8,%rsp
ret
mov    %edi,%eax
add    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @target(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 90
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @reportError(i32* null)
store i32 -50, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 12
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @target(i32 %0) {
%2 = icmp eq i32 %0, 90
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @reportError(i32* null)
br label %7
5: ; preds = %1
%6 = add nsw i32 %0, 12
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ -50, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void store64(void *dst, uint64_t w) { *(uint64_t *)dst = w; }


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

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

LLVM IR (-O0):
define void @store64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @store64(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write2hex(int);
void write4hex(int x) {
  write2hex(x >> 8);
  write2hex(x);
}


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

x86 assembly (clang, -O2):
<write4hex>:
push   %rbx
mov    %edi,%ebx
sar    $0x8,%edi
call   1030 <write2hex@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <write2hex@plt>

LLVM IR (-O0):
define void @write4hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = call i32 @write2hex(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @write2hex(i32 %6)
ret void
}

LLVM IR (-O2):
define void @write4hex(i32 %0) {
%2 = ashr i32 %0, 8
%3 = tail call i32 @write2hex(i32 %2)
%4 = tail call i32 @write2hex(i32 %0)
ret void
}
void XtIsManaged() {}


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

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

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

LLVM IR (-O2):
define void @XtIsManaged() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mgrSendMessageToLedController(char *);
int mgrInitialize(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToLedController("/led/red/off");
  mgrSendMessageToLedController("/led/green/off");
  mgrSendMessageToLedController("/led/orange/blink");
  return 0;
}


x86 assembly (clang, -O0):
<mgrInitialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
lea    0xed7(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
lea    0xeda(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"/led/red/off\00"
@.str.1 = [15 x i8] c"/led/green/off\00"
@.str.2 = [18 x i8] c"/led/orange/blink\00"
define i32 @mgrInitialize(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"/led/red/off\00"
@.str.1 = [15 x i8] c"/led/green/off\00"
@.str.2 = [18 x i8] c"/led/orange/blink\00"
define i32 @mgrInitialize(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
unsigned short get_user_word(const short *addr) {
  unsigned short _v;
  __asm__("movw %%fs:%1,%0" : "=r"(_v) : "m"(*addr));
  return _v;
}


x86 assembly (clang, -O0):
<get_user_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %fs:(%rax),%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_word>:
mov    %fs:(%rdi),%ax
ret

LLVM IR (-O0):
define zeroext i16 @get_user_word(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = call i16 asm "movw %fs:$1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @get_user_word(i16* %0) {
%2 = tail call i16 asm "movw %fs:$1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %0)
ret i16 %2
}
void ssh_set_error() {}


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

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

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

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

/* Variables and functions */
int S_ISLNK(int /*<<< orphan*/);
int C_S_ISLNK(mode_t mode) { return S_ISLNK(mode); }


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

x86 assembly (clang, -O2):
<C_S_ISLNK>:
jmp    1030 <S_ISLNK@plt>

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

LLVM IR (-O2):
define i32 @C_S_ISLNK(i32 %0) {
%2 = tail call i32 @S_ISLNK(i32 %0)
ret i32 %2
}
/* Variables and functions */
void *malloc(size_t);
void *__alloc_malloc(void *cc, size_t n) { return malloc(n); }


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

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

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

LLVM IR (-O2):
define noalias i8* @__alloc_malloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
int _lwp_kill(int tid, int sig) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_lwp_kill(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  fprintf(stderr, msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Cbuf_AddText(char *);
int /*<<< orphan*/ Key_SetCatcher(int /*<<< orphan*/);
void CL_StartDemoLoop(void) {
  Cbuf_AddText("d1\n");
  Key_SetCatcher(0);
}


x86 assembly (clang, -O0):
<CL_StartDemoLoop>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <Cbuf_AddText@plt>
xor    %edi,%edi
call   1040 <Key_SetCatcher@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_StartDemoLoop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <Cbuf_AddText@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <Key_SetCatcher@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"d1\0A\00"
define void @CL_StartDemoLoop() {
%1 = call i32 @Cbuf_AddText(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Key_SetCatcher(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"d1\0A\00"
define void @CL_StartDemoLoop() {
%1 = tail call i32 @Cbuf_AddText(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Key_SetCatcher(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, unsigned char const *, int);
void GLUE_SET_PX_FROM_P1(void *b, int wv) {
  static const unsigned char tab[3][2] = {
      {0x90, 0x90},
      {0x89, 0xC7},
      {0x89, 0xC1},
  };
  memcpy(b, tab[wv], 2);
}


x86 assembly (clang, -O0):
<GLUE_SET_PX_FROM_P1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
lea    0xed2(%rip),%rsi
shl    $0x1,%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_SET_PX_FROM_P1>:
movslq %esi,%rax
lea    0xee6(%rip),%rcx
lea    (%rcx,%rax,2),%rsi
mov    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@GLUE_SET_PX_FROM_P1.tab = internal constant [3 x [2 x i8]] [[2 x i8] c"\90\90", [2 x i8] c"\89\C7", [2 x i8] c"\89\C1"]
define void @GLUE_SET_PX_FROM_P1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [3 x [2 x i8]], [3 x [2 x i8]]* @GLUE_SET_PX_FROM_P1.tab, i64 0, i64 %7
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%10 = call i32 @memcpy(i8* %5, i8* %9, i32 2)
ret void
}

LLVM IR (-O2):
@GLUE_SET_PX_FROM_P1.tab = internal constant [3 x [2 x i8]] [[2 x i8] c"\90\90", [2 x i8] c"\89\C7", [2 x i8] c"\89\C1"]
define void @GLUE_SET_PX_FROM_P1(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [3 x [2 x i8]], [3 x [2 x i8]]* @GLUE_SET_PX_FROM_P1.tab, i64 0, i64 %3, i64 0
%5 = tail call i32 @memcpy(i8* %0, i8* %4, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
void nnewline(int n) {
  int i;
  for (i = 0; i < n; i++)
    newline();
}


x86 assembly (clang, -O0):
<nnewline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <nnewline+0x33>
mov    $0x0,%al
call   1030 <newline@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <nnewline+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nnewline>:
push   %rbx
test   %edi,%edi
jle    112c <nnewline+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <newline@plt>
add    $0xffffffff,%ebx
jne    1120 <nnewline+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @nnewline(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @newline()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int rand();
int next_time() { return 100 + (rand() % 500); }


x86 assembly (clang, -O0):
<next_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x1f4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x64,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_time>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x1f4,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x64,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @next_time() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 500
%3 = add nsw i32 100, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @next_time() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 500
%3 = add nsw i32 %2, 100
ret i32 %3
}
unsigned int _dictionary_hash(char *input) {
  unsigned int hashval = 0;
  int i = 0;
  while (input[i++])
    hashval += (input[i - 1] * i);
  return hashval;
}


x86 assembly (clang, -O0):
<_dictionary_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1152 <_dictionary_hash+0x52>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <_dictionary_hash+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dictionary_hash>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     1124 <_dictionary_hash+0x24>
mov    $0x1,%ecx
nopl   (%rax)
movsbl %dl,%edx
imul   %ecx,%edx
add    %edx,%eax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <_dictionary_hash+0x10>
ret

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

LLVM IR (-O2):
define i32 @_dictionary_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 1, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = trunc i64 %5 to i32
%10 = mul nsw i32 %9, %8
%11 = add i32 %10, %7
%12 = add nuw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %5
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
void motion_result3(int *data) {
  int i = 0;
  int k = data[2];
  int j = 21 * data[0];
  do
    i = j + i + 1;
  while (i < k);
  data[4] = i;
}


x86 assembly (clang, -O0):
<motion_result3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x15,(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1123 <motion_result3+0x23>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_result3>:
mov    (%rdi),%ecx
mov    0x8(%rdi),%eax
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%edx
add    $0x1,%edx
xor    %ecx,%ecx
add    %edx,%ecx
cmp    %eax,%ecx
jl     1110 <motion_result3+0x10>
mov    %ecx,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @motion_result3(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = load i32, i32* %0
%5 = mul nsw i32 %4, 21
%6 = add i32 %5, 1
br label %7
7: ; preds = %7, %1
%8 = phi i32 [ 0, %1 ], [ %9, %7 ]
%9 = add i32 %6, %8
%10 = icmp slt i32 %9, %3
br i1 %10, label %7, label %11
11: ; preds = %7
%12 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %9, i32* %12
ret void
}
int foo(int *a, int *b) {
  int r = 0;
#pragma omp parallel for reduction (inscan, +:r) default(none) firstprivate (a, b)
  for (int i = 0; i < 64; i++) {
    r += a[i];
#pragma omp scan inclusive(r)
    b[i] = r;
  }
  return r;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x40,-0x18(%rbp)
jge    1151 <foo+0x51>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111a <foo+0x1a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    (%rdi,%rcx,4),%eax
mov    %eax,(%rsi,%rcx,4)
add    0x4(%rdi,%rcx,4),%eax
mov    %eax,0x4(%rsi,%rcx,4)
add    0x8(%rdi,%rcx,4),%eax
mov    %eax,0x8(%rsi,%rcx,4)
add    0xc(%rdi,%rcx,4),%eax
mov    %eax,0xc(%rsi,%rcx,4)
add    $0x4,%rcx
cmp    $0x40,%rcx
jne    1110 <foo+0x10>
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0, i32* nocapture writeonly %1) {
br label %4
3: ; preds = %4
ret i32 %24
4: ; preds = %4, %2
%5 = phi i64 [ 0, %2 ], [ %26, %4 ]
%6 = phi i32 [ 0, %2 ], [ %24, %4 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %5
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %6
%10 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %9, i32* %10
%11 = or i64 %5, 1
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = add nsw i32 %13, %9
%15 = getelementptr inbounds i32, i32* %1, i64 %11
store i32 %14, i32* %15
%16 = or i64 %5, 2
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = add nsw i32 %18, %14
%20 = getelementptr inbounds i32, i32* %1, i64 %16
store i32 %19, i32* %20
%21 = or i64 %5, 3
%22 = getelementptr inbounds i32, i32* %0, i64 %21
%23 = load i32, i32* %22
%24 = add nsw i32 %23, %19
%25 = getelementptr inbounds i32, i32* %1, i64 %21
store i32 %24, i32* %25
%26 = add nuw nsw i64 %5, 4
%27 = icmp eq i64 %26, 64
br i1 %27, label %3, label %4
}