xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_current_century(int);
int get_previous_century(int optional_current_year) {
  int current_century = get_current_century(optional_current_year);
  return current_century - 100;
}


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

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

LLVM IR (-O0):
define i32 @get_previous_century(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @get_current_century(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 100
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_previous_century(i32 %0) {
%2 = tail call i32 @get_current_century(i32 %0)
%3 = add nsw i32 %2, -100
ret i32 %3
}
extern void outb(unsigned char value, unsigned short port) {
  __asm__ __volatile__("out"
                       "b"
                       " %"
                       "b"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
ret void
}
int isdigit(int c) { return ((c >= '0') && (c <= '9')); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x76() {
  Assert_real((isgraph(118)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              595, ("isgraph should be 1 for v"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x76>:
push   %rbp
mov    %rsp,%rbp
mov    $0x76,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x253,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x76>:
push   %rax
mov    $0x76,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x253,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for v\00"
define void @t_isgraph_0x76() {
%1 = call i32 @isgraph(i32 118)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 595, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for v\00"
define void @t_isgraph_0x76() {
%1 = tail call i32 @isgraph(i32 118)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 595, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PUSH(int /*<<< orphan*/);
int /*<<< orphan*/ availchar();
int /*<<< orphan*/ getchar();
void key(void) {
  while (!availchar())
    ;
  PUSH(getchar());
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <key+0x9>
mov    $0x0,%al
call   1050 <availchar@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1155 <key+0x25>
jmp    115a <key+0x2a>
jmp    1139 <key+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%edi
call   1040 <PUSH@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <availchar@plt>
test   %eax,%eax
je     1140 <key+0x10>
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <PUSH@plt>

LLVM IR (-O0):
define void @key() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @availchar()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call i32 (...) @getchar()
%8 = call i32 @PUSH(i32 %7)
ret void
}

LLVM IR (-O2):
define void @key() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @availchar()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 (...) @getchar()
%6 = tail call i32 @PUSH(i32 %5)
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int main(void) {
  int *p;
  p = malloc(sizeof(int));
  *p = 33;
  printf("%d \n", *p);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x21,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1050 <malloc@plt>
lea    0xebe(%rip),%rdi
mov    $0x21,%esi
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d \0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 33, i32* %3
%4 = load i32*, i32** %1
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 33)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main() {
  int size = strlen("毛sting");
  printf("%d\n", size);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\E6\AF\9Bsting\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"\E6\AF\9Bsting\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ int8Clear(int /*<<< orphan*/ *);
void int8Destroy(int8_t *data) {
  int8Clear(data);
  free(data);
}


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

x86 assembly (clang, -O2):
<int8Destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <int8Clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @int8Destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @int8Clear(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @int8Destroy(i32* %0) {
%2 = tail call i32 @int8Clear(i32* %0)
%3 = tail call i32 @free(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int inicializa_auxiliar(char *arquivoAuxiliar) {
  FILE *fp;
  fp = fopen(arquivoAuxiliar, "w");
  if (fp == NULL) {
    return (1);
  }
  fputc('1', fp);
  fclose(fp);
  return (0);
}


x86 assembly (clang, -O0):
<inicializa_auxiliar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1167 <inicializa_auxiliar+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1185 <inicializa_auxiliar+0x55>
mov    -0x18(%rbp),%rsi
mov    $0x31,%edi
call   1040 <fputc@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicializa_auxiliar>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115e <inicializa_auxiliar+0x2e>
mov    %rax,%rbx
mov    $0x31,%edi
mov    %rax,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define i32 @inicializa_auxiliar(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %15
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = call i32 @fputc(i8 signext 49, i32* %11)
%13 = load i32*, i32** %4
%14 = call i32 @fclose(i32* %13)
store i32 0, i32* %2
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @inicializa_auxiliar(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @fputc(i8 signext 49, i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ geopm_region_id_is_mpi(int);
int geopm_region_id_is_nested(uint64_t rid) {
  return (geopm_region_id_is_mpi(rid) && (rid << 32));
}


x86 assembly (clang, -O0):
<geopm_region_id_is_nested>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <geopm_region_id_is_mpi@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1148 <geopm_region_id_is_nested+0x38>
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @geopm_region_id_is_nested(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @geopm_region_id_is_mpi(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = shl i32 %7, 32
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @geopm_region_id_is_nested(i32 %0) {
%2 = tail call i64 @geopm_region_id_is_mpi(i32 %0)
ret i32 0
}
void yy_1_TableHeaderTransient(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_TableHeaderTransient(i8* nocapture %0, i32 %1) {
ret void
}
int max(int a, int b, int c) {
  if (a > b) {
    if (a > c)
      return a;
    else
      return c;
  } else {
    if (b > c)
      return b;
    else
      return c;
  }
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <max+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <max+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1152 <max+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edx,%eax
cmp    %edx,%edi
cmovg  %edi,%eax
cmp    %esi,%eax
cmovle %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
main() {
  printf("hello,world\n");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello,world\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello,world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
void SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled = [50 x i8] c"SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled\00"
define void @SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @__func__.SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled = [50 x i8] c"SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled\00"
define void @SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @__func__.SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled, i64 0, i64 0), i8* %0)
ret void
}
void RTP_set_extension(unsigned char *p, int v) {
  p[0] = (p[0] & 0xef) | (((unsigned char)v) << 4);
}


x86 assembly (clang, -O0):
<RTP_set_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xef,%eax
mov    -0xc(%rbp),%ecx
movzbl %cl,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_set_extension>:
mov    (%rdi),%al
and    $0xef,%al
shl    $0x4,%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @RTP_set_extension(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %8, 239
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 4
%14 = or i32 %9, %13
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @RTP_set_extension(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = and i8 %3, -17
%5 = trunc i32 %1 to i8
%6 = shl i8 %5, 4
%7 = or i8 %4, %6
store i8 %7, i8* %0
ret void
}
/* Type definitions */
struct mempool {
  int dummy;
};

/* Variables and functions */
scalar_t__ mp_memdup(struct mempool *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *mp_strdup(struct mempool *mp, const char *str) {
  return (char *)mp_memdup(mp, str, strlen(str) + 1);
}


x86 assembly (clang, -O0):
<mp_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <mp_memdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mp_memdup@plt>

LLVM IR (-O0):
%struct.mempool = type { i32 }
define i8* @mp_strdup(%struct.mempool* %0, i8* %1) {
%3 = alloca %struct.mempool*
%4 = alloca i8*
store %struct.mempool* %0, %struct.mempool** %3
store i8* %1, i8** %4
%5 = load %struct.mempool*, %struct.mempool** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i64 @mp_memdup(%struct.mempool* %5, i8* %6, i64 %9)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
%struct.mempool = type { i32 }
define i8* @mp_strdup(%struct.mempool* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i64 @mp_memdup(%struct.mempool* %0, i8* %1, i64 %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
void a12(int n) { malloc(n); }


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

x86 assembly (clang, -O2):
<a12>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define void @a12(i32 %0) {
%2 = tail call i32 @malloc(i32 %0)
ret void
}
void gsi_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @gsi_debugfs_init() {
ret void
}
/* Variables and functions */
size_t f_strlen(const char *s) {
  size_t len = 0;
  while (*s++ != '\0')
    len++;
  return len;
}


x86 assembly (clang, -O0):
<f_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <f_strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <f_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_strlen>:
cmpb   $0x0,(%rdi)
je     111f <f_strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <f_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @f_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int foo(int *);
int bar(int b) {
  int var = b + 1;
  return foo(&var);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
add    $0x1,%edi
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = add nsw i32 %0, 1
store i32 %4, i32* %2
%5 = call i32 @foo(i32* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ kitsune_register_var(char const *, char const *,
                                        char const *, char const *, void *,
                                        size_t, int /*<<< orphan*/);
void kitsune_note_var(const char *var_name, const char *funcname,
                      const char *filename, const char *namespace, void *addr,
                      size_t size) {
  kitsune_register_var(var_name, funcname, filename, namespace, addr, size, 0);
}


x86 assembly (clang, -O0):
<kitsune_note_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <kitsune_register_var@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kitsune_note_var>:
push   %rax
movl   $0x0,(%rsp)
call   1030 <kitsune_register_var@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @kitsune_note_var(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i64 %5) {
%7 = tail call i32 @kitsune_register_var(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i64 %5, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setdetachstate(int /*<<< orphan*/ *, int);
int my_pthread_attr_setdetachstate(pthread_attr_t *__attr, int state) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  return pthread_attr_setdetachstate(realattr, state);
}


x86 assembly (clang, -O0):
<my_pthread_attr_setdetachstate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <pthread_attr_setdetachstate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_setdetachstate>:
mov    (%rdi),%edi
jmp    1030 <pthread_attr_setdetachstate@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_setdetachstate(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = call i32 @pthread_attr_setdetachstate(i32* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_setdetachstate(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_setdetachstate(i32* %5, i32 %1)
ret i32 %6
}
/* Variables and functions */
int unlink(char const *);
int daemon_exit(const char *pidfile) { return unlink(pidfile); }


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

x86 assembly (clang, -O2):
<daemon_exit>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @daemon_exit(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ rand_double_range(double, double);
scalar_t__ round(int /*<<< orphan*/);
int rand_int_range(int low, int high) {
  return (int)round(rand_double_range((double)low, (double)high));
}


x86 assembly (clang, -O0):
<rand_int_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
call   1040 <rand_double_range@plt>
mov    %eax,%edi
call   1030 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int_range>:
push   %rax
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
call   1040 <rand_double_range@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <round@plt>

LLVM IR (-O0):
define i32 @rand_int_range(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 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = call i32 @rand_double_range(double %6, double %8)
%10 = call i64 @round(i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @rand_int_range(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = tail call i32 @rand_double_range(double %3, double %4)
%6 = tail call i64 @round(i32 %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strdup(char *s) {
  char *result = (char *)malloc(strlen(s) + 1);
  if (result == (char *)0)
    return (char *)0;
  strcpy(result, s);
  return result;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115a <strdup+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115c <strdup+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t dv_int16_t(int16_t a, int16_t b) { return a / b; }


x86 assembly (clang, -O0):
<dv_int16_t>:
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):
<dv_int16_t>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @dv_int16_t(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 @dv_int16_t(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int curl_toupper(int c) {
  if (c >= 'a' && c <= 'z') {
    return ('A' + c - 'a');
  }
  return c;
}


x86 assembly (clang, -O0):
<curl_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <curl_toupper+0x2c>
cmpl   $0x7a,-0x8(%rbp)
jg     112c <curl_toupper+0x2c>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <curl_toupper+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<curl_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @curl_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 65, %10
%12 = sub nsw i32 %11, 97
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @curl_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void ff_hevc_put_hevc_uni_qpel_hv24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_hv24_8_sse4() {
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ netAdrsFromHost(struct sockaddr_in *, struct hostent *, int);
void netAdrsFromName(struct sockaddr_in *adrs, char *name, int port) {
  struct hostent *h = gethostbyname(name);
  netAdrsFromHost(adrs, h, port);
}


x86 assembly (clang, -O0):
<netAdrsFromName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gethostbyname@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <netAdrsFromHost@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netAdrsFromName>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <gethostbyname@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <netAdrsFromHost@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.hostent = type { i32 }
define void @netAdrsFromName(%struct.sockaddr_in* %0, i8* %1, i32 %2) {
%4 = alloca %struct.sockaddr_in*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.hostent*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = call %struct.hostent* @gethostbyname(i8* %8)
store %struct.hostent* %9, %struct.hostent** %7
%10 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%11 = load %struct.hostent*, %struct.hostent** %7
%12 = load i32, i32* %6
%13 = call i32 @netAdrsFromHost(%struct.sockaddr_in* %10, %struct.hostent* %11, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.hostent = type { i32 }
define void @netAdrsFromName(%struct.sockaddr_in* %0, i8* %1, i32 %2) {
%4 = tail call %struct.hostent* @gethostbyname(i8* %1)
%5 = tail call i32 @netAdrsFromHost(%struct.sockaddr_in* %0, %struct.hostent* %4, i32 %2)
ret void
}
/* Variables and functions */
int div16(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = -31;
  int res = div16(x);
  printf("res is %d\n", res);
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"res is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 -31, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @div16(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"res is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @div16(i32 -31)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pars_arg_eol_do(int);
void pars_arg_semicolon(void) { pars_arg_eol_do(true); }


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

x86 assembly (clang, -O2):
<pars_arg_semicolon>:
mov    $0x1,%edi
jmp    1030 <pars_arg_eol_do@plt>

LLVM IR (-O0):
define void @pars_arg_semicolon() {
%1 = call i32 @pars_arg_eol_do(i32 1)
ret void
}

LLVM IR (-O2):
define void @pars_arg_semicolon() {
%1 = tail call i32 @pars_arg_eol_do(i32 1)
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t usec_now() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  uint64_t res = tv.tv_sec;
  res *= 1000000;
  res += tv.tv_usec;
  return res;
}


x86 assembly (clang, -O0):
<usec_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0xf4240,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usec_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%eax
add    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @usec_now() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 1000000
store i32 %7, i32* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @usec_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = add i32 %6, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage:\n"
         "\tcp [-h] [-r|-R] SOURCE DEST\n"
         "\tcp [-h] [-r|-R] SOURCE DIR\n");
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c"Usage:\0A\09cp [-h] [-r|-R] SOURCE DEST\0A\09cp [-h] [-r|-R] SOURCE DIR\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c"Usage:\0A\09cp [-h] [-r|-R] SOURCE DEST\0A\09cp [-h] [-r|-R] SOURCE DIR\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret void
}
int fibonacci(int N) {
  if (N == 0)
    return 0;
  else if (N == 1 || N == 2)
    return 1;
  return fibonacci(N - 1) + fibonacci(N - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1179 <fibonacci+0x69>
cmpl   $0x1,-0x8(%rbp)
je     1145 <fibonacci+0x35>
cmpl   $0x2,-0x8(%rbp)
jne    1151 <fibonacci+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1179 <fibonacci+0x69>
jmp    1156 <fibonacci+0x46>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1146 <fibonacci+0x36>
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1148 <fibonacci+0x38>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <fibonacci@plt>
add    %eax,%ebx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <fibonacci+0x20>
add    $0x1,%ebx
jmp    1148 <fibonacci+0x38>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = icmp ult i32 %4, 2
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %13, %6 ], [ %4, %3 ]
%8 = phi i32 [ %12, %6 ], [ 0, %3 ]
%9 = phi i32 [ %11, %6 ], [ %0, %3 ]
%10 = tail call i32 @fibonacci(i32 %7)
%11 = add nsw i32 %9, -2
%12 = add nsw i32 %10, %8
%13 = add i32 %9, -3
%14 = icmp ult i32 %13, 2
br i1 %14, label %15, label %6
15: ; preds = %6
%16 = add i32 %12, 1
br label %17
17: ; preds = %3, %15, %1
%18 = phi i32 [ 0, %1 ], [ %16, %15 ], [ 1, %3 ]
ret i32 %18
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ _write_decimal(scalar_t__);
void _write_decimal_1000(uint16_t value) {
  uint8_t decimal_1000 = (value % 10000) / 1000;
  if (decimal_1000 != 0) {
    _write_decimal(decimal_1000);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <_write_decimal_1000+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <_write_decimal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
movslq %edi,%rax
imul   $0x68db8bad,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
imul   $0x2710,%eax,%eax
mov    %eax,%ecx
neg    %ecx
add    %edi,%ecx
add    $0x3e7,%ecx
cmp    $0x7cf,%ecx
jae    1142 <_write_decimal_1000+0x32>
ret
sub    %eax,%edi
movswl %di,%eax
imul   $0xffff8313,%eax,%eax
shr    $0x10,%eax
add    %edi,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x9,%ecx
add    %eax,%ecx
movswq %cx,%rdi
jmp    1030 <_write_decimal@plt>

LLVM IR (-O0):
define void @_write_decimal_1000(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10000
%6 = sdiv i32 %5, 1000
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = call i32 @_write_decimal(i64 %11)
br label %13
13: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @_write_decimal_1000(i32 %0) {
%2 = srem i32 %0, 10000
%3 = add nsw i32 %2, 999
%4 = icmp ult i32 %3, 1999
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = trunc i32 %2 to i16
%7 = sdiv i16 %6, 1000
%8 = sext i16 %7 to i64
%9 = tail call i32 @_write_decimal(i64 %8)
br label %10
10: ; preds = %5, %1
ret void
}
void *bmend(void *shm) { return shm + (8 * 1024 * 1024) / 2; }


x86 assembly (clang, -O0):
<bmend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x400000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmend>:
lea    0x400000(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @bmend(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 4194304
ret i8* %4
}

LLVM IR (-O2):
define i8* @bmend(i8* readnone %0) {
%2 = getelementptr i8, i8* %0, i64 4194304
ret i8* %2
}