xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int *p;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main(void) {
  int i = 2017;
  int *p;
  p = &i;
  printf("O endereco da variavel i em memoria eh: %p\n", &i);
  printf("O endereco alocado no ponteiro eh: %p\n", p);
  printf("O conteudo de p eh: %d\n", *(p) + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7e1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x7e1,0xc(%rsp)
lea    0xedc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
add    $0x1,%esi
lea    0xf01(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"O endereco da variavel i em memoria eh: %p\0A\00"
@.str.1 = [39 x i8] c"O endereco alocado no ponteiro eh: %p\0A\00"
@.str.2 = [24 x i8] c"O conteudo de p eh: %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 2017, i32* %1
store i32* %1, i32** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32*, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"O endereco da variavel i em memoria eh: %p\0A\00"
@.str.1 = [39 x i8] c"O endereco alocado no ponteiro eh: %p\0A\00"
@.str.2 = [24 x i8] c"O conteudo de p eh: %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2017, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int _chsize_s(int, int /*<<< orphan*/);
int _ftruncate(int __fd, off_t __length) { return _chsize_s(__fd, __length); }


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

x86 assembly (clang, -O2):
<_ftruncate>:
jmp    1030 <_chsize_s@plt>

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

LLVM IR (-O2):
define i32 @_ftruncate(i32 %0, i32 %1) {
%3 = tail call i32 @_chsize_s(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HwCopterControlHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void HwCopterControlRequestUpdate() {
  UAVObjRequestUpdate(HwCopterControlHandle());
}


x86 assembly (clang, -O0):
<HwCopterControlRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <HwCopterControlHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwCopterControlRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1040 <HwCopterControlHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @HwCopterControlRequestUpdate() {
%1 = call i32 (...) @HwCopterControlHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwCopterControlRequestUpdate() {
%1 = tail call i32 (...) @HwCopterControlHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void getLocal() {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  printf("Local Time\t%s", asctime(timeinfo));
}


x86 assembly (clang, -O0):
<getLocal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1060 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,%rsi
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLocal>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1040 <asctime@plt>
lea    0xe97(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [14 x i8] c"Local Time\09%s\00"
define void @getLocal() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = call i8* @asctime(%struct.tm* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [14 x i8] c"Local Time\09%s\00"
define void @getLocal() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i8* @asctime(%struct.tm* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
void InitGraphics(int argc, char **argv) {}


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

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

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

LLVM IR (-O2):
define void @InitGraphics(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
void eatline(FILE *in) {
  int c;
  do {
    c = getc(in);
    if (c == EOF)
      return;
  } while (c != '\n');
}


x86 assembly (clang, -O0):
<eatline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
jne    113f <eatline+0x2f>
jmp    114e <eatline+0x3e>
jmp    1144 <eatline+0x34>
cmpl   $0xa,-0xc(%rbp)
jne    111c <eatline+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
je     1132 <eatline+0x22>
cmp    (%r14),%eax
jne    1120 <eatline+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @eatline(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = icmp eq i32 %3, 10
%7 = or i1 %6, %5
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void str03() {
  char *string_data = (char *)malloc(16);
  char a[16];
  int d;
  strncpy(a, string_data, sizeof(a));
  strncpy(a, string_data, 5);
  d = sizeof(int);
}


x86 assembly (clang, -O0):
<str03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
movl   $0x4,-0x24(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str03>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @str03() {
%1 = alloca i8*
%2 = alloca [16 x i8]
%3 = alloca i32
%4 = call i64 @malloc(i32 16)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = load i8*, i8** %1
%8 = call i32 @strncpy(i8* %6, i8* %7, i32 16)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%10 = load i8*, i8** %1
%11 = call i32 @strncpy(i8* %9, i8* %10, i32 5)
store i32 4, i32* %3
ret void
}

LLVM IR (-O2):
define void @str03() {
%1 = alloca [16 x i8]
%2 = tail call i64 @malloc(i32 16)
%3 = inttoptr i64 %2 to i8*
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %3, i32 16)
%6 = call i32 @strncpy(i8* %4, i8* %3, i32 5)
ret void
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void send_rig3(struct ship *ship, long a) { Write(35, ship, a, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_rig3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x23,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_rig3>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x23,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_rig3(%struct.ship* %0, i64 %1) {
%3 = alloca %struct.ship*
%4 = alloca i64
store %struct.ship* %0, %struct.ship** %3
store i64 %1, i64* %4
%5 = load %struct.ship*, %struct.ship** %3
%6 = load i64, i64* %4
%7 = call i32 @Write(i32 35, %struct.ship* %5, i64 %6, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_rig3(%struct.ship* %0, i64 %1) {
%3 = tail call i32 @Write(i32 35, %struct.ship* %0, i64 %1, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ system_log(char *, char *, int, char *);
void sig_bus(int signo) {
  system_log("<F>",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/master/src/"
             "init_afd/init_afd_worker.c",
             909, ("Uuurrrggh! Received SIGBUS."));
  abort();
}


x86 assembly (clang, -O0):
<sig_bus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0x38d,%edx
lea    0xf57(%rip),%rcx
call   1040 <system_log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sig_bus>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x38d,%edx
call   1040 <system_log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"<F>\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/master/src/init_afd/init_afd_worker.c\00"
@.str.2 = [28 x i8] c"Uuurrrggh! Received SIGBUS.\00"
define void @sig_bus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i32 909, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"<F>\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/master/src/init_afd/init_afd_worker.c\00"
@.str.2 = [28 x i8] c"Uuurrrggh! Received SIGBUS.\00"
define void @sig_bus(i32 %0) {
%2 = tail call i32 @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i32 909, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void option3() { printf("You have selected option 3\n"); }


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"You have selected option 3\00"
define void @option3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int d30(int);
int d31(int a) { return d30(d30(a)); }


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

x86 assembly (clang, -O2):
<d31>:
push   %rax
call   1030 <d30@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d30@plt>

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

LLVM IR (-O2):
define i32 @d31(i32 %0) {
%2 = tail call i32 @d30(i32 %0)
%3 = tail call i32 @d30(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ notifyEvent(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void sesc_fast_sim_begin() { notifyEvent("sesc_fast_sim_begin", 0, 0, 0); }


x86 assembly (clang, -O0):
<sesc_fast_sim_begin>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <notifyEvent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sesc_fast_sim_begin>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <notifyEvent@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"sesc_fast_sim_begin\00"
define void @sesc_fast_sim_begin() {
%1 = tail call i32 @notifyEvent(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0)
ret void
}
int mkDestroyDevRequest(unsigned char *out, char *faceid,
                        char *private_key_path) {
  return 0;
}


x86 assembly (clang, -O0):
<mkDestroyDevRequest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mkDestroyDevRequest(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int idx_msb(unsigned int);
unsigned int clr_lv_msb(unsigned int x) {
  unsigned int ret = 0;
  if (x > 0) {
    ret = (1 << (idx_msb(x) - 1));
  }
  return ret;
}


x86 assembly (clang, -O0):
<clr_lv_msb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1143 <clr_lv_msb+0x33>
mov    -0x4(%rbp),%edi
call   1030 <idx_msb@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_lv_msb>:
test   %edi,%edi
je     1129 <clr_lv_msb+0x19>
push   %rax
call   1030 <idx_msb@plt>
lea    -0x1(%rax),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @clr_lv_msb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp ugt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @idx_msb(i32 %7)
%9 = sub nsw i32 %8, 1
%10 = shl i32 1, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %6, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @clr_lv_msb(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @idx_msb(i32 %0)
%5 = add nsw i32 %4, -1
%6 = shl nuw i32 1, %5
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
void vrt_cmd_threads_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @vrt_cmd_threads_cleanup() {
ret void
}
int atoi(const char *s) {
  const char *p;
  int i;
  i = 0;
  for (p = s; *p != 0; p++) {
    i = i * 10;
    i = i + (*p - '0');
  }
  return i;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <atoi+0x51>
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <atoi+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <atoi+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %6, 10
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_decrypt_cbc();
int /*<<< orphan*/ test_decrypt_ecb();
int /*<<< orphan*/ test_encrypt_cbc();
int /*<<< orphan*/ test_encrypt_ecb();
int /*<<< orphan*/ test_encrypt_ecb_verbose();
int main(void) {
  printf("\nTesting AES128\n\n");
  test_encrypt_cbc();
  test_decrypt_cbc();
  test_decrypt_ecb();
  test_encrypt_ecb();
  test_encrypt_ecb_verbose();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <test_encrypt_cbc@plt>
mov    $0x0,%al
call   1060 <test_decrypt_cbc@plt>
mov    $0x0,%al
call   1030 <test_decrypt_ecb@plt>
mov    $0x0,%al
call   1070 <test_encrypt_ecb@plt>
mov    $0x0,%al
call   1080 <test_encrypt_ecb_verbose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test_encrypt_cbc@plt>
xor    %eax,%eax
call   1060 <test_decrypt_cbc@plt>
xor    %eax,%eax
call   1040 <test_decrypt_ecb@plt>
xor    %eax,%eax
call   1070 <test_encrypt_ecb@plt>
xor    %eax,%eax
call   1080 <test_encrypt_ecb_verbose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0ATesting AES128\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_encrypt_cbc()
%4 = call i32 (...) @test_decrypt_cbc()
%5 = call i32 (...) @test_decrypt_ecb()
%6 = call i32 (...) @test_encrypt_ecb()
%7 = call i32 (...) @test_encrypt_ecb_verbose()
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"\0ATesting AES128\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_encrypt_cbc()
%3 = tail call i32 (...) @test_decrypt_cbc()
%4 = tail call i32 (...) @test_decrypt_ecb()
%5 = tail call i32 (...) @test_encrypt_ecb()
%6 = tail call i32 (...) @test_encrypt_ecb_verbose()
ret i32 0
}
/* Type definitions */
typedef int __feh;

/* Variables and functions */
int write(int, short *, int);
int lewrite16(int fd, short c) {
  int r;
  do {
    short __feh = c;
    if (1)
      c = c;
    else
      c = ((((__feh) >> 8) & 0xff) | (((__feh)&0xff) << 8));
  } while (0);
  r = write(fd, &c, 2);
  return r;
}


x86 assembly (clang, -O0):
<lewrite16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0xe(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x6(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lewrite16>:
push   %rax
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lewrite16(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32
%6 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
br label %7
7: ; preds = %2
%8 = load i16, i16* %4
store i16 %8, i16* %6
%9 = load i16, i16* %4
store i16 %9, i16* %4
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @write(i32 %11, i16* %4, i32 2)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @lewrite16(i32 %0, i16 signext %1) {
%3 = alloca i16
store i16 %1, i16* %3
%4 = call i32 @write(i32 %0, i16* %3, i32 2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ randomTick();
void animate(void) {
  randomTick();
  glutPostRedisplay();
}


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

x86 assembly (clang, -O2):
<animate>:
push   %rax
xor    %eax,%eax
call   1040 <randomTick@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glutPostRedisplay@plt>

LLVM IR (-O0):
define void @animate() {
%1 = call i32 (...) @randomTick()
%2 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @animate() {
%1 = tail call i32 (...) @randomTick()
%2 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
unsigned char genchecksum(unsigned char *, size_t);
int /*<<< orphan*/ write(int, unsigned char *, int);
ssize_t writecs(int fd, const void *buf, size_t count) {
  ssize_t result = write(fd, buf, count);
  unsigned char checksum[1];
  checksum[0] = genchecksum((unsigned char *)&buf, count);
  write(fd, checksum, 1);
  return result;
}


x86 assembly (clang, -O0):
<writecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <genchecksum@plt>
mov    %al,-0x1d(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1d(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writecs>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %edi,%ebp
mov    %rsi,0x8(%rsp)
call   1030 <write@plt>
mov    %eax,%r14d
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <genchecksum@plt>
mov    %al,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @writecs(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca [1 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
%13 = call i32 @write(i32 %9, i8* %10, i32 %12)
store i32 %13, i32* %7
%14 = bitcast i8** %5 to i8*
%15 = load i64, i64* %6
%16 = call zeroext i8 @genchecksum(i8* %14, i64 %15)
%17 = getelementptr inbounds [1 x i8], [1 x i8]* %8, i64 0, i64 0
store i8 %16, i8* %17
%18 = load i32, i32* %4
%19 = getelementptr inbounds [1 x i8], [1 x i8]* %8, i64 0, i64 0
%20 = call i32 @write(i32 %18, i8* %19, i32 1)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @writecs(i32 %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca [1 x i8]
store i8* %1, i8** %4
%6 = trunc i64 %2 to i32
%7 = tail call i32 @write(i32 %0, i8* %1, i32 %6)
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%9 = bitcast i8** %4 to i8*
%10 = call zeroext i8 @genchecksum(i8* %9, i64 %2)
store i8 %10, i8* %8
%11 = call i32 @write(i32 %0, i8* %8, i32 1)
ret i32 %7
}
/* Variables and functions */
int strcmp(char *, char *);
int seqlist_compare(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

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

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

LLVM IR (-O2):
define i32 @seqlist_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
unsigned f5(int x, unsigned y) { return (unsigned)(x | (int)y); }


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

x86 assembly (clang, -O2):
<f5>:
mov    %edi,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct Timer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Timer *);
void tmr_free(struct Timer *self) { free(self); }


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

x86 assembly (clang, -O2):
<tmr_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Timer = type { i32 }
define void @tmr_free(%struct.Timer* %0) {
%2 = alloca %struct.Timer*
store %struct.Timer* %0, %struct.Timer** %2
%3 = load %struct.Timer*, %struct.Timer** %2
%4 = call i32 @free(%struct.Timer* %3)
ret void
}

LLVM IR (-O2):
%struct.Timer = type { i32 }
define void @tmr_free(%struct.Timer* nocapture %0) {
%2 = tail call i32 @free(%struct.Timer* %0)
ret void
}
/* Variables and functions */
int remove(char const *);
int _remove(const char *path) { return remove(path); }


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

x86 assembly (clang, -O2):
<_remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @_remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ startSuitesample2();
int main(int argc, char *argv[]) {
  startSuitesample2();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <startSuitesample2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @startSuitesample2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @startSuitesample2()
ret i32 0
}
void soru_2(int a) { int sonuc; }


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

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

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

LLVM IR (-O2):
define void @soru_2(i32 %0) {
ret void
}
void gotoxy(x, y) { printf("%c[%d;%df", 0x1B, y, x); }


x86 assembly (clang, -O0):
<gotoxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xed5(%rip),%rdi
mov    $0x1b,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoxy>:
mov    %esi,%edx
mov    %edi,%ecx
lea    0xee5(%rip),%rdi
mov    $0x1b,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%c[%d;%df\00"
define void @gotoxy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%c[%d;%df\00"
define void @gotoxy(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_matrix(int);
int main() {
  int num = 5;
  print_matrix(num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <print_matrix@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <print_matrix@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_matrix(i32 5)
ret i32 0
}
void outportb(unsigned short _port, unsigned char _data) {
  asm volatile("outb %1, %0" ::"dN"(_port), "a"(_data));
}


x86 assembly (clang, -O0):
<outportb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @outportb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
foo() { return 0; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ReadToken(char *);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void assert_token(char *ref) {
  char token[250];
  ReadToken(token);
  if (strcmp(ref, token) != 0) {
    sprintf(token, "\"%s\" expected", ref);
    error(token);
  }
}


x86 assembly (clang, -O0):
<assert_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
call   1060 <ReadToken@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1198 <assert_token+0x58>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe79(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <error@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_token>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1060 <ReadToken@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1185 <assert_token+0x45>
lea    0xe91(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1040 <error@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\22%s\22 expected\00"
define void @assert_token(i8* %0) {
%2 = alloca i8*
%3 = alloca [250 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%5 = call i32 @ReadToken(i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%12 = load i8*, i8** %2
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%15 = call i32 @error(i8* %14)
br label %16
16: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\22%s\22 expected\00"
define void @assert_token(i8* %0) {
%2 = alloca [250 x i8]
%3 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 0
%4 = call i32 @ReadToken(i8* %3)
%5 = call i64 @strcmp(i8* %0, i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = call i32 @error(i8* %3)
br label %10
10: ; preds = %7, %1
ret void
}
void Ustar_newt2(double *prim, double *Us, double sK, double sC, double x[2],
                 struct parList *pars) {}


x86 assembly (clang, -O0):
<Ustar_newt2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.parList = type opaque
define void @Ustar_newt2(double* %0, double* %1, double %2, double %3, double* %4, %struct.parList* %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca %struct.parList*
store double* %0, double** %7
store double* %1, double** %8
store double %2, double* %9
store double %3, double* %10
store double* %4, double** %11
store %struct.parList* %5, %struct.parList** %12
ret void
}

LLVM IR (-O2):
%struct.parList = type opaque
define void @Ustar_newt2(double* nocapture %0, double* nocapture %1, double %2, double %3, double* nocapture %4, %struct.parList* nocapture %5) {
ret void
}
int x41_process_request(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x41_process_request(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct modemchannel {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pktsetdcd(struct modemchannel *, int);
void p3drxstate(struct modemchannel *chan, unsigned int synced,
                unsigned int carrierfreq) {
  pktsetdcd(chan, !!synced);
}


x86 assembly (clang, -O0):
<p3drxstate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
call   1030 <pktsetdcd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p3drxstate>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    %eax,%esi
jmp    1030 <pktsetdcd@plt>

LLVM IR (-O0):
%struct.modemchannel = type { i32 }
define void @p3drxstate(%struct.modemchannel* %0, i32 %1, i32 %2) {
%4 = alloca %struct.modemchannel*
%5 = alloca i32
%6 = alloca i32
store %struct.modemchannel* %0, %struct.modemchannel** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.modemchannel*, %struct.modemchannel** %4
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = call i32 @pktsetdcd(%struct.modemchannel* %7, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.modemchannel = type { i32 }
define void @p3drxstate(%struct.modemchannel* %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %1, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @pktsetdcd(%struct.modemchannel* %0, i32 %5)
ret void
}
/* Type definitions */
struct block_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bdev_get_queue(struct block_device *);
int queue_io_opt(int /*<<< orphan*/);
__attribute__((always_)) int bdev_io_opt(struct block_device *bdev) {
  return queue_io_opt(bdev_get_queue(bdev));
}


x86 assembly (clang, -O0):
<bdev_io_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bdev_get_queue@plt>
mov    %eax,%edi
call   1030 <queue_io_opt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdev_io_opt>:
push   %rax
call   1040 <bdev_get_queue@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <queue_io_opt@plt>

LLVM IR (-O0):
%struct.block_device = type { i32 }
define i32 @bdev_io_opt(%struct.block_device* %0) {
%2 = alloca %struct.block_device*
store %struct.block_device* %0, %struct.block_device** %2
%3 = load %struct.block_device*, %struct.block_device** %2
%4 = call i32 @bdev_get_queue(%struct.block_device* %3)
%5 = call i32 @queue_io_opt(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.block_device = type { i32 }
define i32 @bdev_io_opt(%struct.block_device* %0) {
%2 = tail call i32 @bdev_get_queue(%struct.block_device* %0)
%3 = tail call i32 @queue_io_opt(i32 %2)
ret i32 %3
}
unsigned int hash_string(const char *str) {
  unsigned int hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <hash_string+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_string+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash_string+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash_string+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ set_port_a(int);
void set_high_port_a_pin(uint8_t pin) {
  set_port_a((*(uint16_t *)0x5000) | (1 << pin));
}


x86 assembly (clang, -O0):
<set_high_port_a_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x5000,%eax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%edi
call   1030 <set_port_a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_high_port_a_pin>:
mov    0x5000,%eax
bts    %edi,%eax
mov    %eax,%edi
jmp    1030 <set_port_a@plt>

LLVM IR (-O0):
define void @set_high_port_a_pin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* inttoptr (i64 20480 to i32*)
%4 = load i32, i32* %2
%5 = shl i32 1, %4
%6 = or i32 %3, %5
%7 = call i32 @set_port_a(i32 %6)
ret void
}

LLVM IR (-O2):
define void @set_high_port_a_pin(i32 %0) {
%2 = load i32, i32* inttoptr (i64 20480 to i32*)
%3 = shl nuw i32 1, %0
%4 = or i32 %2, %3
%5 = tail call i32 @set_port_a(i32 %4)
ret void
}
int test_imm_DBint64_midword_reg(long long val) {
  return ((val >> 16) & (0xDB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DBint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xdb,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DBint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14352384
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}