xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_list_iter_desc_add();
int /*<<< orphan*/ test_list_iter_desc_remove();
void test_list_iter_desc() {
  test_list_iter_desc_remove();
  test_list_iter_desc_add();
}


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

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

LLVM IR (-O0):
define void @test_list_iter_desc() {
%1 = call i32 (...) @test_list_iter_desc_remove()
%2 = call i32 (...) @test_list_iter_desc_add()
ret void
}

LLVM IR (-O2):
define void @test_list_iter_desc() {
%1 = tail call i32 (...) @test_list_iter_desc_remove()
%2 = tail call i32 (...) @test_list_iter_desc_add()
ret void
}
void panic(s) char *s;
{
  putline("\007\007\007\r\n");
  putline(s);
  putline("\r\n");
  quit();
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <putline@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <putline@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <putline@plt>
mov    $0x0,%al
call   1040 <quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <putline@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <putline@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <putline@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <quit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\07\07\07\0D\0A\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @putline to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @putline to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @putline to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @quit()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\07\07\07\0D\0A\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @panic(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @putline to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @putline to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @putline to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @quit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ voltea(char *);
int main(void) {
  int longitud;
  extern int max;
  extern char linea_max[1000];
  char *mi_cadena = "esta es una cadena";
  char mi_cadena2[] = "esta es otra";
  voltea(mi_cadena);
  voltea(mi_cadena2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0x1d(%rbp)
mov    0xee0(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xedb(%rip),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <voltea@plt>
lea    -0x1d(%rbp),%rdi
call   1030 <voltea@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6172746f207365,%rax
mov    %rax,0xd(%rsp)
movabs $0x2073652061747365,%rax
65 73 20
mov    %rax,0x8(%rsp)
lea    0xec7(%rip),%rdi
call   1030 <voltea@plt>
lea    0x8(%rsp),%rdi
call   1030 <voltea@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"esta es una cadena\00"
@__const.main.mi_cadena2 = [13 x i8] c"esta es otra\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [13 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = bitcast [13 x i8]* %4 to i8*
%6 = load i8*, i8** %3
%7 = call i32 @voltea(i8* %6)
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%9 = call i32 @voltea(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"esta es una cadena\00"
@__const.main.mi_cadena2 = [13 x i8] c"esta es otra\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @voltea(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @voltea(i8* %2)
ret i32 0
}
int windows_drive_letter(const char *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @windows_drive_letter(i8* nocapture readnone %0) {
ret i32 0
}
void OCSP_RESPDATA_new(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_RESPDATA_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  for (int i = 0; i < 10; i++) {
    x = 0;
  }
  assert(x == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1145 <main+0x35>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
int mask(int x, int y) { return (x & 0xFF) | (y & ~0xFF); }


x86 assembly (clang, -O0):
<mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%ecx
and    $0xffffff00,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask>:
movzbl %dil,%eax
and    $0xffffff00,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @mask(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 = and i32 %5, 255
%7 = load i32, i32* %4
%8 = and i32 %7, -256
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @mask(i32 %0, i32 %1) {
%3 = and i32 %0, 255
%4 = and i32 %1, -256
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
float mad(float const, float const, float const);
float linear_blend(const float v0, const float v1, const float interp) {
  return mad(v1 - v0, interp, v0);
}


x86 assembly (clang, -O0):
<linear_blend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
call   1030 <mad@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_blend>:
movaps %xmm0,%xmm3
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <mad@plt>

LLVM IR (-O0):
define float @linear_blend(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = load float, float* %6
%11 = load float, float* %4
%12 = call float @mad(float %9, float %10, float %11)
ret float %12
}

LLVM IR (-O2):
define float @linear_blend(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @mad(float %4, float %2, float %0)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: erase boot flag\n");
  printf("	force	: force erase\n");
  printf("	auto	: erase depend boot flag\n");
  printf("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
lea    0xedc(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"usage: erase boot flag\0A\00"
@.str.1 = [22 x i8] c"\09force\09: force erase\0A\00"
@.str.2 = [32 x i8] c"\09auto\09: erase depend boot flag\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"usage: erase boot flag\00"
@str.4 = [21 x i8] c"\09force\09: force erase\00"
@str.5 = [31 x i8] c"\09auto\09: erase depend boot flag\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @exit(i32 1)
unreachable
}
int g() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @g() {
ret i32 0
}
int dist(int x, int y, int a, int b) {
  return ((x - a) * (x - a)) + ((y - b) * (y - b));
}


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

x86 assembly (clang, -O2):
<dist>:
sub    %edx,%edi
imul   %edi,%edi
sub    %ecx,%esi
imul   %esi,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = mul nsw i32 %5, %5
%7 = sub nsw i32 %1, %3
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %6
ret i32 %9
}
/* Variables and functions */
scalar_t__ read(int, int /*<<< orphan*/, int);
void flush(int fd) {
  while (read(fd, 0, 1))
    ;
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
je     1139 <flush+0x29>
jmp    111b <flush+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
jne    1120 <flush+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @flush(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @read(i32 %0, i32 0, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("All hail VK, hopefully last of his name, King of the contract "
         "puppets and Lord of the Seven Rooms !");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [100 x i8] c"All hail VK, hopefully last of his name, King of the contract puppets and Lord of the Seven Rooms !\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [100 x i8] c"All hail VK, hopefully last of his name, King of the contract puppets and Lord of the Seven Rooms !\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int _my_getnbr_base_val(char c, char *base) {
  int i;
  i = 0;
  while (base[i]) {
    if (base[i] == c)
      return (i);
    i++;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<_my_getnbr_base_val>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1158 <_my_getnbr_base_val+0x58>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <_my_getnbr_base_val+0x4a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <_my_getnbr_base_val+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <_my_getnbr_base_val+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_my_getnbr_base_val>:
mov    (%rsi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <_my_getnbr_base_val+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,%dl
je     1123 <_my_getnbr_base_val+0x23>
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <_my_getnbr_base_val+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_my_getnbr_base_val(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %9 ]
ret i32 %17
}
/* Type definitions */
struct iax_session {
  int dummy;
};

/* Variables and functions */
int __send_command(struct iax_session *, char, int, unsigned int,
                   unsigned char *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                   int, int /*<<< orphan*/, int /*<<< orphan*/);
int send_command_transfer(struct iax_session *i, char type, int command,
                          unsigned int ts, unsigned char *data, int datalen) {
  return __send_command(i, type, command, ts, data, datalen, 0, 0, 1, 0, 0);
}


x86 assembly (clang, -O0):
<send_command_transfer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
xor    %esi,%esi
movsbl %al,%esi
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x1,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
call   1030 <__send_command@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_command_transfer>:
push   %rax
sub    $0x8,%rsp
push   $0x0
push   $0x0
push   $0x1
push   $0x0
push   $0x0
call   1030 <__send_command@plt>
add    $0x30,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.iax_session = type { i32 }
define i32 @send_command_transfer(%struct.iax_session* %0, i8 signext %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca %struct.iax_session*
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store %struct.iax_session* %0, %struct.iax_session** %7
store i8 %1, i8* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load %struct.iax_session*, %struct.iax_session** %7
%14 = load i8, i8* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i8*, i8** %11
%18 = load i32, i32* %12
%19 = call i32 @__send_command(%struct.iax_session* %13, i8 signext %14, i32 %15, i32 %16, i8* %17, i32 %18, i32 0, i32 0, i32 1, i32 0, i32 0)
ret i32 %19
}

LLVM IR (-O2):
%struct.iax_session = type { i32 }
define i32 @send_command_transfer(%struct.iax_session* %0, i8 signext %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = tail call i32 @__send_command(%struct.iax_session* %0, i8 signext %1, i32 %2, i32 %3, i8* %4, i32 %5, i32 0, i32 0, i32 1, i32 0, i32 0)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int uwsgi_hook_rpc(char *);
int uwsgi_hook_retryrpc(char *arg) {
  for (;;) {
    int ret = uwsgi_hook_rpc(arg);
    if (!ret)
      break;
    sleep(2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<uwsgi_hook_retryrpc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <uwsgi_hook_rpc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1147 <uwsgi_hook_retryrpc+0x27>
jmp    1156 <uwsgi_hook_retryrpc+0x36>
mov    $0x2,%edi
call   1040 <sleep@plt>
jmp    112c <uwsgi_hook_retryrpc+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_hook_retryrpc>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <uwsgi_hook_rpc@plt>
test   %eax,%eax
je     1148 <uwsgi_hook_retryrpc+0x28>
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
jmp    1130 <uwsgi_hook_retryrpc+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @uwsgi_hook_retryrpc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = call i32 @uwsgi_hook_rpc(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %4
br label %12
10: ; preds = %4
%11 = call i32 @sleep(i32 2)
br label %4
12: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @uwsgi_hook_retryrpc(i8* %0) {
%2 = tail call i32 @uwsgi_hook_rpc(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 @sleep(i32 2)
%6 = tail call i32 @uwsgi_hook_rpc(i8* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void recover_memory(int *p) {
  free(p);
  p = NULL;
}


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

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

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

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

/* Variables and functions */
int ffsll(int /*<<< orphan*/);
int first(uint64_t s) { return ffsll(s); }


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

x86 assembly (clang, -O2):
<first>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @first(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doindent(unsigned depth) {
  unsigned i;
  for (i = 0; i < depth; i++) {
    printf("   ");
  }
}


x86 assembly (clang, -O0):
<doindent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1148 <doindent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <doindent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doindent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <doindent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <doindent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
define void @doindent(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int errno;
int renameat(int, char const *, int, char const *);
int __sulong_posix_renameat(int oldfd, const char *old, int newfd,
                            const char *new) {
  {
    int native_errno = errno;
    int result = renameat(oldfd, old, newfd, new);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_renameat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <renameat@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    1162 <__sulong_posix_renameat+0x52>
xor    %eax,%eax
mov    0x2e85(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%ecx
mov    0x2e74(%rip),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_renameat>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <renameat@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_renameat(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @errno
%6 = tail call i32 @renameat(i32 %0, i8* %1, i32 %2, i8* %3)
%7 = icmp eq i32 %6, -1
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = select i1 %7, i32 %9, i32 %6
store i32 %5, i32* @errno
ret i32 %10
}
void av_match_name() {}


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

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

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

LLVM IR (-O2):
define void @av_match_name() {
ret void
}
short rq_date_is_leap_year(short yr) {
  return yr % 400 == 0 || (yr % 4 == 0 && yr % 100 != 0);
}


x86 assembly (clang, -O0):
<rq_date_is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x3(%rbp)
je     115a <rq_date_is_leap_year+0x5a>
movswl -0x2(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x4(%rbp)
jne    1154 <rq_date_is_leap_year+0x54>
movswl -0x2(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_date_is_leap_year>:
imul   $0x5c29,%edi,%eax
add    $0x510,%eax
ror    $0x4,%ax
movzwl %ax,%eax
cmp    $0xa3,%eax
jb     1122 <rq_date_is_leap_year+0x22>
test   $0x3,%dil
je     1127 <rq_date_is_leap_year+0x27>
xor    %eax,%eax
ret
mov    $0x1,%ax
ret
imul   $0x5c29,%edi,%eax
add    $0x51c,%eax
ror    $0x2,%ax
movzwl %ax,%ecx
xor    %eax,%eax
cmp    $0x28f,%ecx
setae  %al
ret

LLVM IR (-O0):
define signext i16 @rq_date_is_leap_year(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = srem i32 %4, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i16, i16* %2
%9 = sext i16 %8 to i32
%10 = srem i32 %9, 4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i16, i16* %2
%14 = sext i16 %13 to i32
%15 = srem i32 %14, 100
%16 = icmp ne i32 %15, 0
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ false, %7 ], [ %16, %12 ]
br label %19
19: ; preds = %17, %1
%20 = phi i1 [ true, %1 ], [ %18, %17 ]
%21 = zext i1 %20 to i32
%22 = trunc i32 %21 to i16
ret i16 %22
}

LLVM IR (-O2):
define signext i16 @rq_date_is_leap_year(i16 signext %0) {
%2 = srem i16 %0, 400
%3 = icmp eq i16 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i16 %0, 3
%6 = icmp eq i16 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i16 %0, 100
%9 = icmp ne i16 %8, 0
%10 = zext i1 %9 to i16
br label %11
11: ; preds = %4, %7, %1
%12 = phi i16 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i16 %12
}
void gtk_scroll_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scroll_type_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ system(char *);
int edit_hosts(void) {
  endwin();
  system(" /usr/bin/ee "
         " /etc/hosts");
  return 0;
}


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

x86 assembly (clang, -O2):
<edit_hosts>:
push   %rax
xor    %eax,%eax
call   1040 <endwin@plt>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c" /usr/bin/ee /etc/hosts\00"
define i32 @edit_hosts() {
%1 = call i32 (...) @endwin()
%2 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c" /usr/bin/ee /etc/hosts\00"
define i32 @edit_hosts() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void i2a_ASN1_INTEGER(void) {}


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

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

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

LLVM IR (-O2):
define void @i2a_ASN1_INTEGER() {
ret void
}
void g_tuples_destroy() {}


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

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

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

LLVM IR (-O2):
define void @g_tuples_destroy() {
ret void
}
int test_imm_5Fuint8_reg(unsigned char val) {
  return ((val) & (0x5F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Fuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x5f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Fuint8_reg>:
test   $0x5f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Fuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 95
%6 = icmp ne i32 %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_5Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 95
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
float Saturatef(float x, float low, float high) {
  assert(low <= high);
  return x < low ? low : (x > high ? high : x);
}


x86 assembly (clang, -O0):
<Saturatef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1163 <Saturatef+0x53>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1195 <Saturatef+0x85>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1181 <Saturatef+0x71>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    118b <Saturatef+0x7b>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Saturatef>:
sub    $0x38,%rsp
movaps %xmm2,(%rsp)
movaps %xmm1,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
xor    %edi,%edi
ucomiss %xmm1,%xmm2
setae  %dil
call   1030 <assert@plt>
movaps 0x20(%rsp),%xmm1
movaps (%rsp),%xmm2
minss  %xmm1,%xmm2
movaps 0x10(%rsp),%xmm3
cmpltss %xmm3,%xmm1
movaps %xmm1,%xmm0
andnps %xmm2,%xmm0
andps  %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define float @Saturatef(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %6
%9 = fcmp ole float %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load float, float* %4
%13 = load float, float* %5
%14 = fcmp olt float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load float, float* %5
br label %27
17: ; preds = %3
%18 = load float, float* %4
%19 = load float, float* %6
%20 = fcmp ogt float %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load float, float* %6
br label %25
23: ; preds = %17
%24 = load float, float* %4
br label %25
25: ; preds = %23, %21
%26 = phi float [ %22, %21 ], [ %24, %23 ]
br label %27
27: ; preds = %25, %15
%28 = phi float [ %16, %15 ], [ %26, %25 ]
ret float %28
}

LLVM IR (-O2):
define float @Saturatef(float %0, float %1, float %2) {
%4 = fcmp ole float %1, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fcmp olt float %0, %1
%8 = fcmp ogt float %0, %2
%9 = select i1 %8, float %2, float %0
%10 = select i1 %7, float %1, float %9
ret float %10
}
foo(int *a) {
  *a = 5;
  *a = 3;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x3,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture writeonly %0) {
store i32 3, i32* %0
ret i32 undef
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
void *cgdb_calloc(size_t nmemb, size_t size) {
  void *t = calloc(nmemb, size);
  if (t)
    return t;
  exit(-1);
}


x86 assembly (clang, -O0):
<cgdb_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <cgdb_calloc+0x36>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cgdb_calloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     112d <cgdb_calloc+0xd>
pop    %rcx
ret
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @cgdb_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %5
ret i8* %12
13: ; preds = %2
%14 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define noalias i8* @cgdb_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i8* %3
6: ; preds = %2
%7 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t square_sum(uint64_t num) {
  uint64_t n = 0;
  for (uint64_t i = 0; i < num; i++) {
    n += (i << 1) + 1;
  }
  return n;
}


x86 assembly (clang, -O0):
<square_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113e <square_sum+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <square_sum+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_sum>:
test   %edi,%edi
jle    1119 <square_sum+0x19>
lea    (%rdi,%rdi,2),%eax
lea    -0x1(%rdi),%ecx
add    $0xfffffffe,%edi
imul   %ecx,%edi
and    $0xfffffffe,%edi
add    %edi,%eax
add    $0xfffffffe,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @square_sum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = mul i32 %0, 3
%5 = add nsw i32 %0, -1
%6 = add nsw i32 %0, -2
%7 = mul i32 %5, %6
%8 = and i32 %7, -2
%9 = add i32 %4, %8
%10 = add i32 %9, -2
br label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void hello(char *s) { printf("Hello %s\n", s); }


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

x86 assembly (clang, -O2):
<hello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @hello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @hello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void black_magic(int *incantation) {
  *(((long *)&incantation) + 2) += *incantation;
}


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

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

LLVM IR (-O0):
define void @black_magic(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = bitcast i32** %2 to i64*
%7 = getelementptr inbounds i64, i64* %6, i64 2
%8 = load i64, i64* %7
%9 = add nsw i64 %8, %5
store i64 %9, i64* %7
ret void
}

LLVM IR (-O2):
define void @black_magic(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int lddec(long double);
int /*<<< orphan*/ sprintf(char *, char *, int, long double);
char *ldtoa(long double x) {
  int dec = lddec(x);
  static char output[(45 + 3) - 1];
  sprintf(output, "%.*Lf", ((45 + 3) - 3 - dec), x);
  return output;
}


x86 assembly (clang, -O0):
<ldtoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <lddec@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2d,%edx
sub    %eax,%edx
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0x2ee9(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ed6(%rip),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldtoa>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <lddec@plt>
mov    $0x2d,%edx
sub    %eax,%edx
fldt   0x14(%rsp)
fstpt  (%rsp)
lea    0x2ef4(%rip),%rbx
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@ldtoa.output = internal global [47 x i8] zeroinitializer
@.str = [6 x i8] c"%.*Lf\00"
define i8* @ldtoa(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i32
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call i32 @lddec(x86_fp80 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sub nsw i32 45, %6
%8 = load x86_fp80, x86_fp80* %2
%9 = call i32 @sprintf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @ldtoa.output, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7, x86_fp80 %8)
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @ldtoa.output, i64 0, i64 0)
}

LLVM IR (-O2):
@ldtoa.output = internal global [47 x i8] zeroinitializer
@.str = [6 x i8] c"%.*Lf\00"
define i8* @ldtoa(x86_fp80 %0) {
%2 = tail call i32 @lddec(x86_fp80 %0)
%3 = sub nsw i32 45, %2
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @ldtoa.output, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, x86_fp80 %0)
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @ldtoa.output, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ __ptr_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int msync(__ptr_t addr, size_t len, int flags) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<msync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msync>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @msync(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @msync(i32 %0, i64 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
void commit_dcache(void) {}


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

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

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

LLVM IR (-O2):
define void @commit_dcache() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void AnsiTerm_fg24(uint32_t c) {
  uint8_t r = (c >> 16) & 0xff;
  uint8_t g = (c >> 8) & 0xff;
  uint8_t b = c & 0xff;
  printf("\x1B[38;2;%d;%d;%dm", r, g, b);
}


x86 assembly (clang, -O0):
<AnsiTerm_fg24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AnsiTerm_fg24>:
mov    %edi,%eax
movzbl %ah,%edx
movzbl %al,%ecx
shr    $0x10,%eax
movzbl %al,%esi
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\1B[38;2;%d;%d;%dm\00"
define void @AnsiTerm_fg24(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = and i32 %7, 255
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = and i32 %12, 255
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\1B[38;2;%d;%d;%dm\00"
define void @AnsiTerm_fg24(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = and i32 %0, 255
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %6)
ret void
}