xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
void d_defer_enable() { empty_log("defer_enable\n"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"defer_enable\0A\00"
define void @d_defer_enable() {
%1 = tail call i32 @empty_log(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef void hostent;

/* Variables and functions */
void *gethostbyname(char const *);
struct hostent *ez_hostnameto_hostent(const char *_name) {
  if (!_name)
    return ((void *)0);
  struct hostent *ret = gethostbyname(_name);
  return ret;
}


x86 assembly (clang, -O0):
<ez_hostnameto_hostent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <ez_hostnameto_hostent+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1149 <ez_hostnameto_hostent+0x39>
mov    -0x10(%rbp),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_hostnameto_hostent>:
test   %rdi,%rdi
je     111a <ez_hostnameto_hostent+0xa>
jmp    1030 <gethostbyname@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.hostent = type opaque
define %struct.hostent* @ez_hostnameto_hostent(i8* %0) {
%2 = alloca %struct.hostent*
%3 = alloca i8*
%4 = alloca %struct.hostent*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store %struct.hostent* null, %struct.hostent** %2
br label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @gethostbyname(i8* %9)
%11 = bitcast i8* %10 to %struct.hostent*
store %struct.hostent* %11, %struct.hostent** %4
%12 = load %struct.hostent*, %struct.hostent** %4
store %struct.hostent* %12, %struct.hostent** %2
br label %13
13: ; preds = %8, %7
%14 = load %struct.hostent*, %struct.hostent** %2
ret %struct.hostent* %14
}

LLVM IR (-O2):
%struct.hostent = type opaque
define %struct.hostent* @ez_hostnameto_hostent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @gethostbyname(i8* %0)
%5 = bitcast i8* %4 to %struct.hostent*
br label %6
6: ; preds = %1, %3
%7 = phi %struct.hostent* [ %5, %3 ], [ null, %1 ]
ret %struct.hostent* %7
}
int test001_runloop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test001_runloop() {
ret i32 0
}
/* Variables and functions */
char *strim(char *);
char *strstrip(char *str) { return strim(str); }


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

x86 assembly (clang, -O2):
<strstrip>:
jmp    1030 <strim@plt>

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

LLVM IR (-O2):
define i8* @strstrip(i8* %0) {
%2 = tail call i8* @strim(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *wmemchr(const wchar_t *p, wchar_t c, size_t n) {
  while (n--) {
    if (*p == c) {
      return (wchar_t *)p;
    }
    ++p;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<wmemchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1158 <wmemchr+0x58>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    1147 <wmemchr+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <wmemchr+0x60>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <wmemchr+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmemchr>:
test   %rdx,%rdx
je     1122 <wmemchr+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %rsi,(%rax)
je     1124 <wmemchr+0x24>
add    $0xffffffffffffffff,%rdx
add    $0x8,%rax
test   %rdx,%rdx
jne    1110 <wmemchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @wmemchr(i64* %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %11
%6 = phi i64 [ %8, %11 ], [ %2, %3 ]
%7 = phi i64* [ %12, %11 ], [ %0, %3 ]
%8 = add i64 %6, -1
%9 = load i64, i64* %7
%10 = icmp eq i64 %9, %1
br i1 %10, label %14, label %11
11: ; preds = %5
%12 = getelementptr inbounds i64, i64* %7, i64 1
%13 = icmp eq i64 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %11, %3
%15 = phi i64* [ null, %3 ], [ null, %11 ], [ %7, %5 ]
ret i64* %15
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_MediaRenderer_RenderingControl_SetMute(void *);
int /*<<< orphan*/ printf(char *, unsigned int, char *, int);
void UpnpMediaRenderer_RenderingControl_SetMute(void *upnptoken,
                                                unsigned int InstanceID,
                                                char *Channel,
                                                int DesiredMute) {
  printf("Invoke: UpnpMediaRenderer_RenderingControl_SetMute(%u,%s,%d);\r\n",
         InstanceID, Channel, DesiredMute);
  UpnpResponse_MediaRenderer_RenderingControl_SetMute(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpMediaRenderer_RenderingControl_SetMute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_MediaRenderer_RenderingControl_SetMute@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpMediaRenderer_RenderingControl_SetMute>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_MediaRenderer_RenderingControl_SetMute@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Invoke: UpnpMediaRenderer_RenderingControl_SetMute(%u,%s,%d);\0D\0A\00"
define void @UpnpMediaRenderer_RenderingControl_SetMute(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
%14 = call i32 @UpnpResponse_MediaRenderer_RenderingControl_SetMute(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"Invoke: UpnpMediaRenderer_RenderingControl_SetMute(%u,%s,%d);\0D\0A\00"
define void @UpnpMediaRenderer_RenderingControl_SetMute(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i32 %3)
%6 = tail call i32 @UpnpResponse_MediaRenderer_RenderingControl_SetMute(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StrlDel(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char palavras[] = "O rato roeu a rolha da garrafa";
  StrlDel(palavras, "ra");
  printf("\n%s\n", palavras);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0x4(%rbp)
mov    0xebb(%rip),%al
mov    %al,-0x2(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <StrlDel@plt>
lea    -0x20(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee3(%rip),%xmm0
movups %xmm0,0xf(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xedc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <StrlDel@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.palavras = [31 x i8] c"O rato roeu a rolha da garrafa\00"
@.str = [3 x i8] c"ra\00"
@.str.1 = [5 x i8] c"\0A%s\0A\00"
define i32 @main() {
%1 = alloca [31 x i8]
%2 = bitcast [31 x i8]* %1 to i8*
%3 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%4 = call i32 @StrlDel(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.palavras = [31 x i8] c"O rato roeu a rolha da garrafa\00"
@.str = [3 x i8] c"ra\00"
@.str.1 = [5 x i8] c"\0A%s\0A\00"
define i32 @main() {
%1 = alloca [31 x i8]
%2 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%3 = call i32 @StrlDel(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
int main() {
  char c[2] = {1, 2};
  return 1 [c];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%ax
mov    %ax,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.c = [2 x i8] c"\01\02"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
store i32 0, i32* %1
%3 = bitcast [2 x i8]* %2 to i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ chrprint2(char const *, int, int);
void chrprint(const char *s) { chrprint2(s, 1, 1); }


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

x86 assembly (clang, -O2):
<chrprint>:
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <chrprint2@plt>

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

LLVM IR (-O2):
define void @chrprint(i8* %0) {
%2 = tail call i32 @chrprint2(i8* %0, i32 1, i32 1)
ret void
}
int f(x)
int x;
{ return x; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("hola mundo cruel y gris!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"hola mundo cruel y gris!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"hola mundo cruel y gris!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double correlation_coefficient(double *x, double *y) {
  double r = 0.0;
  return r;
}


x86 assembly (clang, -O0):
<correlation_coefficient>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<correlation_coefficient>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @correlation_coefficient(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
define double @correlation_coefficient(double* nocapture readnone %0, double* nocapture readnone %1) {
ret double 0.000000e+00
}
void SavePreviousPC(void) {}


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

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

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

LLVM IR (-O2):
define void @SavePreviousPC() {
ret void
}
int cvmx_pko_get_base_queue(int port) { return port; }


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

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

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

LLVM IR (-O2):
define i32 @cvmx_pko_get_base_queue(i32 returned %0) {
ret i32 %0
}
int test_imm_D7uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xD7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D7uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xd7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D7uint64_highword_reg>:
movabs $0xd700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D7uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 215
%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_D7uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 923417968640
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int xls_is_bigendian() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xls_is_bigendian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr1(int *arr, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr1+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr1+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr1>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr1+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr1+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArr1(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr1(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct BinTree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int about(struct BinTree *dict, char *in) {
  printf("smalldicty is a small dictionary for any language(s).\n"
         "Copyright (C) 2011 Lopatin Alexander\n\n"
         "This program is free software: you can do everything you want with "
         "it. It's licensed under the terms of GPL 3 (please visit "
         "http://www.gnu.org/licenses/gpl-3.0.html for details).\n");
  return 1;
}


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

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

LLVM IR (-O0):
%struct.BinTree = type { i32 }
@.str = [272 x i8] c"smalldicty is a small dictionary for any language(s).\0ACopyright (C) 2011 Lopatin Alexander\0A\0AThis program is free software: you can do everything you want with it. It's licensed under the terms of GPL 3 (please visit http://www.gnu.org/licenses/gpl-3.0.html for details).\0A\00"
define i32 @about(%struct.BinTree* %0, i8* %1) {
%3 = alloca %struct.BinTree*
%4 = alloca i8*
store %struct.BinTree* %0, %struct.BinTree** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([272 x i8], [272 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.BinTree = type { i32 }
@str = [271 x i8] c"smalldicty is a small dictionary for any language(s).\0ACopyright (C) 2011 Lopatin Alexander\0A\0AThis program is free software: you can do everything you want with it. It's licensed under the terms of GPL 3 (please visit http://www.gnu.org/licenses/gpl-3.0.html for details).\00"
define i32 @about(%struct.BinTree* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([271 x i8], [271 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ oops();
char *strdup(char *);
int main() {
  char *a;
  a = (char *)malloc(13);
  free(a);
  a = strdup("oops");
  oops();
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xd,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xe83(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <oops@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xd,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1040 <oops@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"oops\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 13)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
%7 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %2
%8 = call i32 (...) @oops()
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 13)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
%4 = tail call i32 (...) @oops()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ do_echo();
int /*<<< orphan*/ intro();
int main(void) {
  intro();
  while (1)
    do_echo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <intro@plt>
mov    $0x0,%al
call   1040 <do_echo@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <intro@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <do_echo@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @intro()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @do_echo()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @intro()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @do_echo()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ enumerate(int);
int main() { enumerate(0x4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <enumerate@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @enumerate(i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @enumerate(i32 4)
ret i32 0
}
void listenToPort(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               84, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<listenToPort>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x54,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<listenToPort>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x54,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.listenToPort = [13 x i8] c"listenToPort\00"
define void @listenToPort() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 84, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.listenToPort, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.listenToPort = [13 x i8] c"listenToPort\00"
define void @listenToPort() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 84, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.listenToPort, i64 0, i64 0))
ret void
}
void p_sika_debug(const char *message) {}


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

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

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

LLVM IR (-O2):
define void @p_sika_debug(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ makespace(char **, int /*<<< orphan*/);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strlen(char const *);
void _xstrcat(char **str1, const char *str2) {
  if (str2 == NULL)
    str2 = "(null)";
  makespace(str1, strlen(str2));
  strcat(*str1, str2);
}


x86 assembly (clang, -O0):
<_xstrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <_xstrcat+0x26>
lea    0xeae(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <makespace@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xstrcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
lea    0xebc(%rip),%rax
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <makespace@plt>
mov    (%r14),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strcat@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define void @_xstrcat(i8** %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @makespace(i8** %0, i32 %5)
%7 = load i8*, i8** %0
%8 = tail call i32 @strcat(i8* %7, i8* %4)
ret void
}
/* Variables and functions */
int INT32_MIN;
int test_1(int ly) {
  if (ly <= INT32_MIN)
    ly = INT32_MIN + 1;
  return ly;
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecf(%rip),%rcx
cmp    (%rcx),%eax
jg     1128 <test_1+0x28>
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
lea    0x1(%rcx),%eax
cmp    %edi,%ecx
cmovl  %edi,%eax
ret

LLVM IR (-O0):
@INT32_MIN = global i32 0
define i32 @test_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @INT32_MIN
%5 = icmp sle i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @INT32_MIN
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@INT32_MIN = global i32 0
define i32 @test_1(i32 %0) {
%2 = load i32, i32* @INT32_MIN
%3 = icmp slt i32 %2, %0
%4 = add nsw i32 %2, 1
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ win_gravity;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
int get_XWindowAttributes_win_gravity(void *_p) {
  return (int)((XWindowAttributes *)_p)->win_gravity;
}


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

x86 assembly (clang, -O2):
<get_XWindowAttributes_win_gravity>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XWindowAttributes_win_gravity(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int foo(int aa, int bb, int cc) {
  int sum = aa + bb;
  return sum / cc;
}


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

x86 assembly (clang, -O2):
<foo>:
mov    %edx,%ecx
lea    (%rdi,%rsi,1),%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = sdiv i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = sdiv i32 %4, %2
ret i32 %5
}
void pcie_ecrc_get_policy(char *str) {}


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

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

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

LLVM IR (-O2):
define void @pcie_ecrc_get_policy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testCirclePoint();
int /*<<< orphan*/ testCircleSegment();
int /*<<< orphan*/ testSegmentSegment();
void interpen_unitTest(void) {
  testSegmentSegment();
  testCirclePoint();
  testCircleSegment();
}


x86 assembly (clang, -O0):
<interpen_unitTest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <testSegmentSegment@plt>
mov    $0x0,%al
call   1040 <testCirclePoint@plt>
mov    $0x0,%al
call   1050 <testCircleSegment@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpen_unitTest>:
push   %rax
xor    %eax,%eax
call   1030 <testSegmentSegment@plt>
xor    %eax,%eax
call   1040 <testCirclePoint@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <testCircleSegment@plt>

LLVM IR (-O0):
define void @interpen_unitTest() {
%1 = call i32 (...) @testSegmentSegment()
%2 = call i32 (...) @testCirclePoint()
%3 = call i32 (...) @testCircleSegment()
ret void
}

LLVM IR (-O2):
define void @interpen_unitTest() {
%1 = tail call i32 (...) @testSegmentSegment()
%2 = tail call i32 (...) @testCirclePoint()
%3 = tail call i32 (...) @testCircleSegment()
ret void
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
uint str_hash(const char *key) {
  int h = 0;
  while (*key) {
    h += *key * 31;
    key++;
  }
  return h;
}


x86 assembly (clang, -O0):
<str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <str_hash+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,%eax,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <str_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <str_hash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
sub    %ecx,%edx
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_hash(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 i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %8, 31
%10 = add nsw i32 %9, %6
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ errno_exit(char *);
void close_device(int fd) {
  if (close(fd) == -1) {
    errno_exit("close");
  }
}


x86 assembly (clang, -O0):
<close_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0xffffffff,%eax
jne    1148 <close_device+0x28>
lea    0xebd(%rip),%rdi
call   1030 <errno_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_device>:
push   %rax
call   1040 <close@plt>
cmp    $0xffffffff,%eax
je     112d <close_device+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <errno_exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"close\00"
define void @close_device(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @errno_exit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
define void @close_device(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errno_exit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
struct wbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *wbuf_salloc(struct wbuf *, size_t);
void *wbuf_swrite(struct wbuf *buf, void const *data, size_t size) {
  assert(buf != NULL);
  void *result = wbuf_salloc(buf, size);
  if (result) {
    (void)memcpy(result, data, size);
  }
  return result;
}


x86 assembly (clang, -O0):
<wbuf_swrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <wbuf_salloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1183 <wbuf_swrite+0x53>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wbuf_swrite>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <wbuf_salloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     116d <wbuf_swrite+0x3d>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.wbuf = type { i32 }
define i8* @wbuf_swrite(%struct.wbuf* %0, i8* %1, i64 %2) {
%4 = alloca %struct.wbuf*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct.wbuf* %0, %struct.wbuf** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct.wbuf*, %struct.wbuf** %4
%9 = icmp ne %struct.wbuf* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.wbuf*, %struct.wbuf** %4
%13 = load i64, i64* %6
%14 = call i8* @wbuf_salloc(%struct.wbuf* %12, i64 %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %22
17: ; preds = %3
%18 = load i8*, i8** %7
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i64 %20)
br label %22
22: ; preds = %17, %3
%23 = load i8*, i8** %7
ret i8* %23
}

LLVM IR (-O2):
%struct.wbuf = type { i32 }
define i8* @wbuf_swrite(%struct.wbuf* %0, i8* %1, i64 %2) {
%4 = icmp ne %struct.wbuf* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i8* @wbuf_salloc(%struct.wbuf* %0, i64 %2)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @memcpy(i8* %7, i8* %1, i64 %2)
br label %11
11: ; preds = %9, %3
ret i8* %7
}
void printvdifmark6muxstatistics(
    const struct vdif_mark6_mux_statistics *stats) {}


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

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

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

LLVM IR (-O2):
%struct.vdif_mark6_mux_statistics = type opaque
define void @printvdifmark6muxstatistics(%struct.vdif_mark6_mux_statistics* nocapture %0) {
ret void
}
int loc(int pos, int col, int arr[][4], int i) {
  while (arr[i][col] < pos)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<loc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
jge    113e <loc+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1111 <loc+0x11>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loc>:
movslq %esi,%rsi
movslq %ecx,%rcx
lea    -0x1(%rcx),%eax
shl    $0x4,%rcx
add    %rdx,%rcx
lea    (%rcx,%rsi,4),%rcx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
lea    0x10(%rcx),%rdx
cmp    %edi,(%rcx)
mov    %rdx,%rcx
jl     1120 <loc+0x20>
ret

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

LLVM IR (-O2):
define i32 @loc(i32 %0, i32 %1, [4 x i32]* nocapture %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = sext i32 %3 to i64
br label %7
7: ; preds = %7, %4
%8 = phi i64 [ %12, %7 ], [ %6, %4 ]
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 %8, i64 %5
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, %0
%12 = add i64 %8, 1
br i1 %11, label %7, label %13
13: ; preds = %7
%14 = trunc i64 %8 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void pp1(void *xp) { printf("%12g", *((double *)xp)); }


x86 assembly (clang, -O0):
<pp1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pp1>:
movsd  (%rdi),%xmm0
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%12g\00"
define void @pp1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to double*
%5 = load double, double* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %5)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%12g\00"
define void @pp1(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}
long long mewtwo(long k) {
  if (!k)
    return 1;
  long long p = mewtwo(k >> 1);
  return p * p * (k % 2 + 1) % 1000000007;
}


x86 assembly (clang, -O0):
<mewtwo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <mewtwo+0x24>
movq   $0x1,-0x8(%rbp)
jmp    117a <mewtwo+0x6a>
mov    -0x10(%rbp),%rdi
sar    $0x1,%rdi
call   1030 <mewtwo@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x20(%rbp),%rax
add    $0x1,%rdx
imul   %rdx,%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mewtwo>:
test   %rdi,%rdi
je     1174 <mewtwo+0x64>
push   %rbx
mov    %rdi,%rbx
sar    %rdi
call   1030 <mewtwo@plt>
mov    %rax,%rcx
mov    %rbx,%rax
shr    $0x3f,%rax
add    %rbx,%rax
and    $0xfffffffffffffffe,%rax
neg    %rax
add    %rbx,%rax
add    $0x1,%rax
imul   %rcx,%rcx
imul   %rax,%rcx
movabs $0x89705f3112a28fe5,%rdx
5f 70 89
mov    %rcx,%rax
imul   %rdx
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
pop    %rbx
mov    %rcx,%rax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @mewtwo(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i64 1, i64* %2
br label %20
8: ; preds = %1
%9 = load i64, i64* %3
%10 = ashr i64 %9, 1
%11 = call i64 @mewtwo(i64 %10)
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = load i64, i64* %4
%14 = mul nsw i64 %12, %13
%15 = load i64, i64* %3
%16 = srem i64 %15, 2
%17 = add nsw i64 %16, 1
%18 = mul nsw i64 %14, %17
%19 = srem i64 %18, 1000000007
store i64 %19, i64* %2
br label %20
20: ; preds = %8, %7
%21 = load i64, i64* %2
ret i64 %21
}

LLVM IR (-O2):
define i64 @mewtwo(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %12, %5 ], [ 1, %1 ]
ret i64 %4
5: ; preds = %1
%6 = ashr i64 %0, 1
%7 = tail call i64 @mewtwo(i64 %6)
%8 = srem i64 %0, 2
%9 = add nsw i64 %8, 1
%10 = mul i64 %7, %9
%11 = mul i64 %10, %7
%12 = srem i64 %11, 1000000007
br label %3
}
float compare(float a, float b) {
  if (a > b)
    return a;
  else
    return b;
}


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

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

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

LLVM IR (-O2):
define float @compare(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}