xunge/DecIR huggingface dataset:
signed char unsigned_int_to_signed_char(unsigned int src) { return src; }


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

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

LLVM IR (-O0):
define signext i8 @unsigned_int_to_signed_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @unsigned_int_to_signed_char(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
int compress_uint(unsigned i, unsigned char p[]) {
  int j = -1;
  do {
    j++;
    p[j] = (i & 127) | 128;
    i = i >> 7;
  } while (i > 0);
  p[j] = p[j] & 127;
  return (j + 1);
}


x86 assembly (clang, -O0):
<compress_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
or     $0x80,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
shr    $0x7,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
ja     1112 <compress_uint+0x12>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x7f,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compress_uint>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%ecx
mov    %ecx,%edx
or     $0x80,%dl
mov    %dl,(%rsi,%rax,1)
shr    $0x7,%edi
add    $0x1,%rax
cmp    $0x7f,%ecx
ja     1110 <compress_uint+0x10>
and    $0x7f,%cl
mov    %cl,-0x1(%rsi,%rax,1)
ret

LLVM IR (-O0):
define i32 @compress_uint(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 -1, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = and i32 %9, 127
%11 = or i32 %10, 128
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 %12, i8* %16
%17 = load i32, i32* %3
%18 = lshr i32 %17, 7
store i32 %18, i32* %3
br label %19
19: ; preds = %6
%20 = load i32, i32* %3
%21 = icmp ugt i32 %20, 0
br i1 %21, label %6, label %22
22: ; preds = %19
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = and i32 %28, 127
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %4
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
store i8 %30, i8* %34
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
ret i32 %36
}

LLVM IR (-O2):
define i32 @compress_uint(i32 %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %6, %3 ], [ -1, %2 ]
%5 = phi i32 [ %10, %3 ], [ %0, %2 ]
%6 = add nsw i64 %4, 1
%7 = trunc i32 %5 to i8
%8 = or i8 %7, -128
%9 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %8, i8* %9
%10 = lshr i32 %5, 7
%11 = icmp ult i32 %5, 128
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = trunc i32 %5 to i8
%14 = getelementptr inbounds i8, i8* %1, i64 %6
%15 = trunc i64 %4 to i32
%16 = and i8 %13, 127
store i8 %16, i8* %14
%17 = add nsw i32 %15, 2
ret i32 %17
}
void testtodoubled_(double *z, double *x) { *z = (double)*x; }


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

x86 assembly (clang, -O2):
<testtodoubled_>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @testtodoubled_(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = load double*, double** %3
store double %6, double* %7
ret void
}

LLVM IR (-O2):
define void @testtodoubled_(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
ret void
}
int main(void) {
  int a = 0;
  while (a) {
    continue;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void INS_BLANK(void) {}


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

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

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

LLVM IR (-O2):
define void @INS_BLANK() {
ret void
}
void ClearVideoInterruptHost(unsigned long MMIOBase, unsigned long value) {
  *(volatile unsigned long *)((unsigned long)(0x1E700000) +
                              (unsigned long)(0x308 + 0x0)) =
      (unsigned long)(value);
}


x86 assembly (clang, -O0):
<ClearVideoInterruptHost>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1e700308,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearVideoInterruptHost>:
mov    %rsi,0x1e700308
1e
ret

LLVM IR (-O0):
define void @ClearVideoInterruptHost(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
store volatile i64 %5, i64* inttoptr (i64 510657288 to i64*)
ret void
}

LLVM IR (-O2):
define void @ClearVideoInterruptHost(i64 %0, i64 %1) {
store volatile i64 %1, i64* inttoptr (i64 510657288 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello World!");
  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 <puts@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 = [13 x i8] c"Hello World!\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 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *check_not_null(void *);
void *xcalloc(size_t n, size_t size) {
  void *result = calloc(n, size);
  return (check_not_null(result));
}


x86 assembly (clang, -O0):
<xcalloc>:
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   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <check_not_null@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1040 <calloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <check_not_null@plt>

LLVM IR (-O0):
define i8* @xcalloc(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 = call i8* @check_not_null(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = tail call i8* @check_not_null(i8* %3)
ret i8* %4
}
double getMidSegment(double min, double range, int dim, int i) {
  return (i + 0.5) * range / dim + min;
}


x86 assembly (clang, -O0):
<getMidSegment>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMidSegment>:
cvtsi2sd %esi,%xmm2
addsd  0xef4(%rip),%xmm2
mulsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @getMidSegment(double %0, double %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 5.000000e-01
%12 = load double, double* %6
%13 = fmul double %11, %12
%14 = load i32, i32* %7
%15 = sitofp i32 %14 to double
%16 = fdiv double %13, %15
%17 = load double, double* %5
%18 = fadd double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @getMidSegment(double %0, double %1, i32 %2, i32 %3) {
%5 = sitofp i32 %3 to double
%6 = fadd double %5, 5.000000e-01
%7 = fmul double %6, %1
%8 = sitofp i32 %2 to double
%9 = fdiv double %7, %8
%10 = fadd double %9, %0
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ ft_sastantua(int);
int main(void) {
  ft_sastantua(6);
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ft_sastantua(i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ft_sastantua(i32 6)
ret i32 0
}
/* Type definitions */
struct in_addr {
  scalar_t__ s_addr;
};

/* Variables and functions */
__attribute__((always_)) int ip4cmp(const struct in_addr *a,
                                    const struct in_addr *b) {
  return a->s_addr > b->s_addr ? +1 : a->s_addr < b->s_addr ? -1 : 0;
}


x86 assembly (clang, -O0):
<ip4cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jle    112d <ip4cmp+0x2d>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <ip4cmp+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip4cmp>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setl   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
%struct.in_addr = type { i64 }
define i32 @ip4cmp(%struct.in_addr* nocapture %0, %struct.in_addr* nocapture %1) {
%3 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void PrintStr(char *cString) {
  char cSlash;
  cSlash = '\\';
  int i;
  i = 0;
  putchar('\'');
  while (cString[i]) {
    putchar(cString[i]);
    i++;
  }
  putchar('\'');
  putchar(0x20);
}


x86 assembly (clang, -O0):
<PrintStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x5c,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1162 <PrintStr+0x52>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <PrintStr+0x21>
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintStr>:
push   %rbx
mov    %rdi,%rbx
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    (%rbx),%al
test   %al,%al
je     1143 <PrintStr+0x33>
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <PrintStr+0x20>
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @PrintStr(i8* nocapture %0) {
%2 = tail call i32 @putchar(i32 39)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8 [ %12, %5 ], [ %3, %1 ]
%8 = sext i8 %7 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = tail call i32 @putchar(i32 39)
%16 = tail call i32 @putchar(i32 32)
ret void
}
/* Variables and functions */
int lireligne(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int l;
  char ligne[1000];
  while ((l = lireligne(ligne, 1000)) > 0) {
    if (l >= 80)
      printf("%s", ligne);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <lireligne@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x50,-0x8(%rbp)
jl     116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <lireligne@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <lireligne@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x50,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @lireligne(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 79
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @lireligne(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
void g_node_pop_allocator() {}


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

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

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

LLVM IR (-O2):
define void @g_node_pop_allocator() {
ret void
}
void iscsiAuthRandomSetData(unsigned char *data, unsigned int length) {}


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

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

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

LLVM IR (-O2):
define void @iscsiAuthRandomSetData(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *argv[]) {
  fprintf(stderr, "Usage: %s <SIGNUM 2|10|15> <PID>\n", argv[0]);
  return -1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xedc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s <SIGNUM 2|10|15> <PID>\0A\00"
define i32 @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s <SIGNUM 2|10|15> <PID>\0A\00"
define i32 @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}
void LED_Control() {}


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

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

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

LLVM IR (-O2):
define void @LED_Control() {
ret void
}
unsigned xrop3_246_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk1 = T | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_246_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_246_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xff,%edx
or     %ecx,%edx
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_246_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_246_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = or i32 %6, %7
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;

/* Variables and functions */
int /*<<< orphan*/ GMP_RNDN;
int /*<<< orphan*/ mpfr_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpfr_set_d(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void mpfr_zinit(mpfr_t m) {
  mpfr_init(m);
  mpfr_set_d(m, 0, GMP_RNDN);
}


x86 assembly (clang, -O0):
<mpfr_zinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mpfr_init@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <mpfr_set_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfr_zinit>:
push   %rbx
mov    %edi,%ebx
call   1030 <mpfr_init@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <mpfr_set_d@plt>

LLVM IR (-O0):
@GMP_RNDN = global i32 0
define void @mpfr_zinit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @mpfr_init(i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* @GMP_RNDN
%7 = call i32 @mpfr_set_d(i32 %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
@GMP_RNDN = global i32 0
define void @mpfr_zinit(i32 %0) {
%2 = tail call i32 @mpfr_init(i32 %0)
%3 = load i32, i32* @GMP_RNDN
%4 = tail call i32 @mpfr_set_d(i32 %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exponent(int, int);
int /*<<< orphan*/ printf(char *, int, int, int /*<<< orphan*/);
int main() {
  int base = 2, power = 32;
  printf("Value of %d raised to the power %d is %lld", base, power,
         exponent(base, power));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <exponent@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x20,%esi
call   1040 <exponent@plt>
lea    0xec9(%rip),%rdi
mov    $0x2,%esi
mov    $0x20,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Value of %d raised to the power %d is %lld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 32, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @exponent(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"Value of %d raised to the power %d is %lld\00"
define i32 @main() {
%1 = tail call i32 @exponent(i32 2, i32 32)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 2, i32 32, i32 %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
int clock_t_comparator(const void *a, const void *b) {
  return (*(clock_t *)a > *(clock_t *)b) - (*(clock_t *)a < *(clock_t *)b);
}


x86 assembly (clang, -O0):
<clock_t_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_t_comparator>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @clock_t_comparator(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp sgt i64 %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = icmp slt i64 %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @clock_t_comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void println() { printf("\n"); }


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

x86 assembly (clang, -O2):
<println>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @println() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
void get_free_memory(double *free_db, double *used_db, double *total_db) {}


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

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

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

LLVM IR (-O2):
define void @get_free_memory(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ while_upto20_bad(int);
void call_while_upto20_minus100_bad() { while_upto20_bad(-100); }


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

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

LLVM IR (-O0):
define void @call_while_upto20_minus100_bad() {
%1 = call i32 @while_upto20_bad(i32 -100)
ret void
}

LLVM IR (-O2):
define void @call_while_upto20_minus100_bad() {
%1 = tail call i32 @while_upto20_bad(i32 -100)
ret void
}
unsigned long krhash(unsigned char *str) {
  unsigned int hash = 0;
  int c;
  while ((c = *str++))
    hash += c;
  return hash;
}


x86 assembly (clang, -O0):
<krhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113b <krhash+0x3b>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <krhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<krhash>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <krhash+0x22>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <krhash+0x10>
mov    %eax,%eax
ret

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

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

/* Variables and functions */
uint32_t func32for(uint32_t x) {
  uint32_t n = 0;
  for (int i = 0; i < 32; i++) {
    if (x & 0x01) {
      n = (n << 1) | 0x01;
    } else {
      n = (n << 1);
    }
    x = x >> 1;
  }
  return n;
}


x86 assembly (clang, -O0):
<func32for>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    115f <func32for+0x5f>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113f <func32for+0x3f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <func32for+0x48>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <func32for+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func32for>:
xor    %eax,%eax
mov    $0x20,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x2,%edx
mov    %edi,%esi
and    $0x1,%esi
shl    $0x2,%esi
lea    (%rsi,%rax,8),%eax
or     %edx,%eax
mov    %edi,%edx
shr    $0x2,%edx
and    $0x1,%edx
or     %eax,%edx
mov    %edi,%eax
shr    $0x3,%eax
and    $0x1,%eax
lea    (%rax,%rdx,2),%eax
sar    $0x4,%edi
add    $0xfffffffc,%ecx
jne    1110 <func32for+0x10>
ret

LLVM IR (-O0):
define i32 @func32for(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 = %22, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %3
%14 = shl i32 %13, 1
%15 = or i32 %14, 1
store i32 %15, i32* %3
br label %19
16: ; preds = %8
%17 = load i32, i32* %3
%18 = shl i32 %17, 1
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %12
%20 = load i32, i32* %2
%21 = ashr i32 %20, 1
store i32 %21, i32* %2
br label %22
22: ; preds = %19
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %5
25: ; preds = %5
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @func32for(i32 %0) {
br label %3
2: ; preds = %3
ret i32 %19
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %21, %3 ]
%5 = phi i32 [ 0, %1 ], [ %19, %3 ]
%6 = phi i32 [ %0, %1 ], [ %20, %3 ]
%7 = and i32 %6, 2
%8 = shl i32 %5, 3
%9 = shl i32 %6, 2
%10 = and i32 %9, 4
%11 = or i32 %8, %10
%12 = or i32 %11, %7
%13 = lshr i32 %6, 2
%14 = and i32 %13, 1
%15 = or i32 %12, %14
%16 = lshr i32 %6, 3
%17 = and i32 %16, 1
%18 = shl i32 %15, 1
%19 = or i32 %18, %17
%20 = ashr i32 %6, 4
%21 = add nuw nsw i32 %4, 4
%22 = icmp eq i32 %21, 32
br i1 %22, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ outlnf(char *, char const *);
void put_dpix(const char *var) { outlnf("    buf[dpix++] = %s;", var); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c" buf[dpix++] = %s;\00"
define void @put_dpix(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @outlnf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c" buf[dpix++] = %s;\00"
define void @put_dpix(i8* %0) {
%2 = tail call i32 @outlnf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(void *, void *);
int key_equals_string(void *key1, void *key2) { return !strcmp(key1, key2); }


x86 assembly (clang, -O0):
<key_equals_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_equals_string>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @key_equals_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @key_equals_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ tangani_request(int);
void terima_koneksi(int sd) {
  struct sockaddr_in caddr;
  int caddr_len;
  int csd;
  int pid = 0;
  while (1) {
    csd = accept(sd, (struct sockaddr *)&caddr, &caddr_len);
    tangani_request(csd);
    close(csd);
  }
}


x86 assembly (clang, -O0):
<terima_koneksi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <accept@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <tangani_request@plt>
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
jmp    1142 <terima_koneksi+0x12>

x86 assembly (clang, -O2):
<terima_koneksi>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
lea    0x4(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <accept@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <tangani_request@plt>
mov    %ebp,%edi
call   1040 <close@plt>
jmp    1150 <terima_koneksi+0x20>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define void @terima_koneksi(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %6
br label %7
7: ; preds = %1, %7
%8 = load i32, i32* %2
%9 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%10 = call i32 @accept(i32 %8, %struct.sockaddr* %9, i32* %4)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i32 @tangani_request(i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @close(i32 %13)
br label %7
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define void @terima_koneksi(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
br label %7
7: ; preds = %7, %1
%8 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
%9 = call i32 @tangani_request(i32 %8)
%10 = call i32 @close(i32 %8)
br label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
float byteSwapFloat(float);
int /*<<< orphan*/ memcpy(float *, char *, int);
float memReadFloat(char **pPt, int isSwapped) {
  float val;
  memcpy(&val, *pPt, sizeof(val));
  if (isSwapped)
    val = byteSwapFloat(val);
  *pPt += sizeof(val);
  return val;
}


x86 assembly (clang, -O0):
<memReadFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
cmpl   $0x0,-0xc(%rbp)
je     115d <memReadFloat+0x3d>
movss  -0x10(%rbp),%xmm0
call   1030 <byteSwapFloat@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memReadFloat>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
movss  0x4(%rsp),%xmm0
test   %ebp,%ebp
je     1149 <memReadFloat+0x29>
call   1030 <byteSwapFloat@plt>
addq   $0x4,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @memReadFloat(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca float
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = call i32 @memcpy(float* %5, i8* %7, i32 4)
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load float, float* %5
%13 = call float @byteSwapFloat(float %12)
store float %13, float* %5
br label %14
14: ; preds = %11, %2
%15 = load i8**, i8*** %3
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 4
store i8* %17, i8** %15
%18 = load float, float* %5
ret float %18
}

LLVM IR (-O2):
define float @memReadFloat(i8** nocapture %0, i32 %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = load i8*, i8** %0
%6 = call i32 @memcpy(float* %3, i8* %5, i32 4)
%7 = icmp eq i32 %1, 0
%8 = load float, float* %3
br i1 %7, label %11, label %9
9: ; preds = %2
%10 = call float @byteSwapFloat(float %8)
br label %11
11: ; preds = %2, %9
%12 = phi float [ %10, %9 ], [ %8, %2 ]
%13 = load i8*, i8** %0
%14 = getelementptr inbounds i8, i8* %13, i64 4
store i8* %14, i8** %0
ret float %12
}
int test4(int g, int h) { return (g ^ h) != h; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = xor i32 %5, %6
%8 = load i32, i32* %4
%9 = icmp ne i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test4(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
char *list_close(int type) {
  switch (type) {
  case 7:
    return ")";
  case 14:
    return "]";
  case 15:
    return "}";
  }
  return "";
}


x86 assembly (clang, -O0):
<list_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x7,%eax
je     113d <list_close+0x3d>
jmp    111b <list_close+0x1b>
mov    -0x10(%rbp),%eax
sub    $0xe,%eax
je     114d <list_close+0x4d>
jmp    112c <list_close+0x2c>
mov    -0x10(%rbp),%eax
sub    $0xf,%eax
je     115d <list_close+0x5d>
jmp    116d <list_close+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <list_close+0x78>
lea    0xeae(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <list_close+0x78>
lea    0xea0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <list_close+0x78>
lea    0xe8d(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_close>:
cmp    $0x7,%edi
je     1117 <list_close+0x17>
cmp    $0xf,%edi
je     111f <list_close+0x1f>
cmp    $0xe,%edi
jne    1127 <list_close+0x27>
lea    0xeec(%rip),%rax
ret
lea    0xee2(%rip),%rax
ret
lea    0xede(%rip),%rax
ret
lea    0xed3(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c")\00"
@.str.1 = [2 x i8] c"]\00"
@.str.2 = [2 x i8] c"}\00"
@.str.3 = [1 x i8] zeroinitializer
define i8* @list_close(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 7, label %5
i32 14, label %6
i32 15, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [2 x i8] c")\00"
@.str.1 = [2 x i8] c"]\00"
@.str.2 = [2 x i8] c"}\00"
@.str.3 = [1 x i8] zeroinitializer
define i8* @list_close(i32 %0) {
switch i32 %0, label %4 [
i32 7, label %5
i32 14, label %2
i32 15, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
void ARGBExtractAlphaRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBExtractAlphaRow_Any_SSE2() {
ret void
}
int adb_mouse_close(__attribute__((unused)) void *private) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @adb_mouse_close(i8* nocapture readnone %0) {
ret i32 0
}
float HalfLinearInterpolation(float p) {
  if (p < 0.5) {
    return 2 * p;
  } else {
    return 1.0;
  }
}


x86 assembly (clang, -O0):
<HalfLinearInterpolation>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <HalfLinearInterpolation+0x3b>
movss  0xee0(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1148 <HalfLinearInterpolation+0x48>
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<HalfLinearInterpolation>:
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
cmpltss 0xef0(%rip),%xmm0
andps  %xmm0,%xmm1
movss  0xee9(%rip),%xmm2
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @HalfLinearInterpolation(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 5.000000e-01
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = fmul float 2.000000e+00, %8
store float %9, float* %2
br label %11
10: ; preds = %1
store float 1.000000e+00, float* %2
br label %11
11: ; preds = %10, %7
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @HalfLinearInterpolation(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
%3 = fmul float %0, 2.000000e+00
%4 = select i1 %2, float %3, float 1.000000e+00
ret float %4
}
/* Type definitions */
typedef long uint32_t;

/* Variables and functions */
long crc32(void const *, unsigned long, long);
uint32_t efi_crc32(const void *buf, unsigned long len) {
  return (crc32(buf, len, ~0L) ^ ~0L);
}


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

x86 assembly (clang, -O2):
<efi_crc32>:
push   %rax
mov    $0xffffffffffffffff,%rdx
call   1030 <crc32@plt>
not    %rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @efi_crc32(i8* %0, i64 %1) {
%3 = tail call i64 @crc32(i8* %0, i64 %1, i64 -1)
%4 = xor i64 %3, -1
ret i64 %4
}