xunge/DecIR huggingface dataset:
int int_size_is_32_for_16bit() {
  int set_msb = 1 << 15 << 15 << 1;
  int beyond_msb = set_msb << 1;
  return set_msb && !beyond_msb;
}


x86 assembly (clang, -O0):
<int_size_is_32_for_16bit>:
push   %rbp
mov    %rsp,%rbp
movl   $0x80000000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     112f <int_size_is_32_for_16bit+0x2f>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @int_size_is_32_for_16bit() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ _change_decimal_from_locale_to_dot(char *);
int /*<<< orphan*/ _ensure_decimal_point(char *, size_t);
int /*<<< orphan*/ _ensure_minimum_exponent_length(char *, size_t);
char *_fix_ascii_format(char *buf, size_t buflen, int decimal) {
  _change_decimal_from_locale_to_dot(buf);
  _ensure_minimum_exponent_length(buf, buflen);
  if (decimal != 0) {
    _ensure_decimal_point(buf, buflen);
  }
  return buf;
}


x86 assembly (clang, -O0):
<_fix_ascii_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_change_decimal_from_locale_to_dot@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <_ensure_minimum_exponent_length@plt>
cmpl   $0x0,-0x14(%rbp)
je     1170 <_fix_ascii_format+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_ensure_decimal_point@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fix_ascii_format>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <_change_decimal_from_locale_to_dot@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <_ensure_minimum_exponent_length@plt>
test   %ebp,%ebp
je     115b <_fix_ascii_format+0x2b>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <_ensure_decimal_point@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @_fix_ascii_format(i8* returned %0, i64 %1, i32 %2) {
%4 = tail call i32 @_change_decimal_from_locale_to_dot(i8* %0)
%5 = tail call i32 @_ensure_minimum_exponent_length(i8* %0, i64 %1)
%6 = icmp eq i32 %2, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @_ensure_decimal_point(i8* %0, i64 %1)
br label %9
9: ; preds = %7, %3
ret i8* %0
}
int test_imm_C6uint8_reg(unsigned char val) {
  return ((val) & (-0xC6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C6uint8_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, -198
%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_C6uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 58
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *xmalloc(size_t n) {
  void *v;
  v = malloc(n);
  if (!v)
    abort();
  return v;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
int test_imm_5Duint8_reg(unsigned char val) {
  return ((val) & (0x5D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Duint8_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, 93
%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_5Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 93
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float add_six(f1, f2, f3, i1, i2, i3)
float f1, f2, f3;
int i1, i2, i3;
{ return f1 + f2 + f3 + i1 + i2 + i3; }


x86 assembly (clang, -O0):
<add_six>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm2,-0x20(%rbp)
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm2,%xmm2
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm2,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_six>:
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %edi,%xmm1
addss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cvtsi2ss %esi,%xmm2
addss  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @add_six(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = fptrunc double %0 to float
%14 = fptrunc double %1 to float
%15 = fptrunc double %2 to float
store float %13, float* %7
store float %14, float* %8
store float %15, float* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load float, float* %7
%17 = load float, float* %8
%18 = fadd float %16, %17
%19 = load float, float* %9
%20 = fadd float %18, %19
%21 = load i32, i32* %10
%22 = sitofp i32 %21 to float
%23 = fadd float %20, %22
%24 = load i32, i32* %11
%25 = sitofp i32 %24 to float
%26 = fadd float %23, %25
%27 = load i32, i32* %12
%28 = sitofp i32 %27 to float
%29 = fadd float %26, %28
ret float %29
}

LLVM IR (-O2):
define float @add_six(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = fptrunc double %0 to float
%8 = fptrunc double %1 to float
%9 = fptrunc double %2 to float
%10 = fadd float %7, %8
%11 = fadd float %10, %9
%12 = sitofp i32 %3 to float
%13 = fadd float %11, %12
%14 = sitofp i32 %4 to float
%15 = fadd float %13, %14
%16 = sitofp i32 %5 to float
%17 = fadd float %15, %16
ret float %17
}
void halt_system(void) {
  out_print("-----SYSTEM HALTED-----");
halt:
  asm volatile("cli");
  asm volatile("hlt");
  goto halt;
}


x86 assembly (clang, -O0):
<halt_system>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <out_print@plt>
cli
hlt
jmp    1122 <halt_system+0x12>

x86 assembly (clang, -O2):
<halt_system>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <out_print@plt>
nop
cli
hlt
jmp    1120 <halt_system+0x10>

LLVM IR (-O0):
@.str = [24 x i8] c"-----SYSTEM HALTED-----\00"
define void @halt_system() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @out_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [24 x i8] c"-----SYSTEM HALTED-----\00"
define void @halt_system() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @out_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %2
}
long _xte_chunk_max(long in_1, long in_2) {
  if (in_1 > in_2)
    return in_1;
  else
    return in_2;
}


x86 assembly (clang, -O0):
<_xte_chunk_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <_xte_chunk_max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <_xte_chunk_max+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xte_chunk_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @_xte_chunk_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int c;
  while (c = getchar() != EOF) {
    printf("%d\n", c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x8(%rbp)
test   $0x1,%al
jne    115b <main+0x3b>
jmp    116f <main+0x4f>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%rax
je     1159 <main+0x39>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%rax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
store i32 %7, i32* %2
br i1 %6, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = tail call i64 (...) @getchar()
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
struct attractiveness {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void attractiveness_compute(struct attractiveness *attr) {
  printf("Evaluating attractiveness\n");
}


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

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

LLVM IR (-O0):
%struct.attractiveness = type { i32 }
@.str = [27 x i8] c"Evaluating attractiveness\0A\00"
define void @attractiveness_compute(%struct.attractiveness* %0) {
%2 = alloca %struct.attractiveness*
store %struct.attractiveness* %0, %struct.attractiveness** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.attractiveness = type { i32 }
@str = [26 x i8] c"Evaluating attractiveness\00"
define void @attractiveness_compute(%struct.attractiveness* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct mat2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat2_zero(float *);
__attribute__((always_)) struct mat2 *psmat2_zero(struct mat2 *result) {
  mat2_zero((float *)result);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat2_zero>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat2_zero@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_zero(%struct.mat2* %0) {
%2 = alloca %struct.mat2*
store %struct.mat2* %0, %struct.mat2** %2
%3 = load %struct.mat2*, %struct.mat2** %2
%4 = bitcast %struct.mat2* %3 to float*
%5 = call i32 @mat2_zero(float* %4)
%6 = load %struct.mat2*, %struct.mat2** %2
ret %struct.mat2* %6
}

LLVM IR (-O2):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_zero(%struct.mat2* returned %0) {
%2 = bitcast %struct.mat2* %0 to float*
%3 = tail call i32 @mat2_zero(float* %2)
ret %struct.mat2* %0
}
float __FM_reciprocalf(float x) {
  union {
    float dbl;
    unsigned uint;
  } u;
  u.dbl = x;
  u.uint = (0xbe6eb3beU - u.uint) >> (unsigned char)1;
  u.dbl *= u.dbl;
  return u.dbl;
}


x86 assembly (clang, -O0):
<__FM_reciprocalf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0xbe6eb3be,%eax
sub    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__FM_reciprocalf>:
movd   %xmm0,%eax
mov    $0xbe6eb3be,%ecx
sub    %eax,%ecx
shr    %ecx
movd   %ecx,%xmm0
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @__FM_reciprocalf(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = sub i32 -1100041282, %7
%9 = lshr i32 %8, 1
%10 = bitcast %union.anon* %3 to i32*
store i32 %9, i32* %10
%11 = bitcast %union.anon* %3 to float*
%12 = load float, float* %11
%13 = bitcast %union.anon* %3 to float*
%14 = load float, float* %13
%15 = fmul float %14, %12
store float %15, float* %13
%16 = bitcast %union.anon* %3 to float*
%17 = load float, float* %16
ret float %17
}

LLVM IR (-O2):
define float @__FM_reciprocalf(float %0) {
%2 = bitcast float %0 to i32
%3 = sub i32 -1100041282, %2
%4 = lshr i32 %3, 1
%5 = bitcast i32 %4 to float
%6 = fmul float %5, %5
ret float %6
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int *allocate_1d_array(int m) {
  if (m <= 0)
    return NULL;
  return (int *)calloc(m, sizeof(int));
}


x86 assembly (clang, -O0):
<allocate_1d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1132 <allocate_1d_array+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1143 <allocate_1d_array+0x33>
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_1d_array>:
test   %edi,%edi
jle    1124 <allocate_1d_array+0x14>
push   %rax
mov    $0x4,%esi
call   1030 <calloc@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @allocate_1d_array(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32* null, i32** %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @calloc(i32 %8, i32 4)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %2
br label %11
11: ; preds = %7, %6
%12 = load i32*, i32** %2
ret i32* %12
}

LLVM IR (-O2):
define i32* @allocate_1d_array(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @calloc(i32 %0, i32 4)
%5 = inttoptr i64 %4 to i32*
br label %6
6: ; preds = %1, %3
%7 = phi i32* [ %5, %3 ], [ null, %1 ]
ret i32* %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xa4() {
  Assert_real((isalnum(164) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              825, ("isalnum should be 0 for 0xa4"));
}


x86 assembly (clang, -O0):
<t_isalnum_0xa4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa4,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x339,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0xa4>:
push   %rax
mov    $0xa4,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x339,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa4\00"
define void @t_isalnum_0xa4() {
%1 = call i64 @isalnum(i32 164)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 825, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa4\00"
define void @t_isalnum_0xa4() {
%1 = tail call i64 @isalnum(i32 164)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 825, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void power_supply_init_attrs(void) {}


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

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

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

LLVM IR (-O2):
define void @power_supply_init_attrs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_int_put(int *dest, const int *src, size_t len, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_int_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_int_put(i32* %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_int_put(i32* nocapture readnone %0, i32* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *hydrology_library_get_datatype_units(char *, char *);
char *hydrology_library_get_stage_units(char *application_name) {
  return hydrology_library_get_datatype_units(application_name, "stage");
}


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

x86 assembly (clang, -O2):
<hydrology_library_get_stage_units>:
lea    0xee9(%rip),%rsi
jmp    1030 <hydrology_library_get_datatype_units@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"stage\00"
define i8* @hydrology_library_get_stage_units(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @hydrology_library_get_datatype_units(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"stage\00"
define i8* @hydrology_library_get_stage_units(i8* %0) {
%2 = tail call i8* @hydrology_library_get_datatype_units(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int main() {
  volatile unsigned char a = 1;
  long long b = 0x80000000L;
  int c = -((int)(-b) - (-0x7fffffff * a));
  if (c != 1)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
mov    $0x80000000,%eax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x5(%rbp),%al
movzbl %al,%eax
imul   $0x80000001,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     1158 <main+0x48>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x1,0x7(%rsp)
movzbl 0x7(%rsp),%eax
mov    %eax,%ecx
shl    $0x1f,%ecx
sub    %eax,%ecx
cmp    $0x7fffffff,%ecx
jne    112e <main+0x1e>
xor    %eax,%eax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
store volatile i8 1, i8* %2
store i64 2147483648, i64* %3
%5 = load i64, i64* %3
%6 = sub nsw i64 0, %5
%7 = trunc i64 %6 to i32
%8 = load volatile i8, i8* %2
%9 = zext i8 %8 to i32
%10 = mul nsw i32 -2147483647, %9
%11 = sub nsw i32 %7, %10
%12 = sub nsw i32 0, %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %0
unreachable
16: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
store volatile i8 1, i8* %1
%2 = load volatile i8, i8* %1
%3 = zext i8 %2 to i32
%4 = mul i32 %3, 2147483647
%5 = icmp eq i32 %4, 2147483647
br i1 %5, label %7, label %6
6: ; preds = %0
tail call void @abort()
unreachable
7: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ id3map_add_from_string(int /*<<< orphan*/);
char *strtok(char *, char *);
int /*<<< orphan*/ trim(char *);
void id3map_add_multiple_from_string(char *id) {
  char *tok;
  tok = strtok(id, ",");
  while (tok != NULL) {
    id3map_add_from_string(trim(tok));
    tok = strtok(NULL, ",");
  }
}


x86 assembly (clang, -O0):
<id3map_add_multiple_from_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1184 <id3map_add_multiple_from_string+0x54>
mov    -0x10(%rbp),%rdi
call   1030 <trim@plt>
mov    %eax,%edi
call   1050 <id3map_add_from_string@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe8a(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
jmp    1150 <id3map_add_multiple_from_string+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<id3map_add_multiple_from_string>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1040 <strtok@plt>
test   %rax,%rax
je     116e <id3map_add_multiple_from_string+0x3e>
lea    0xeb7(%rip),%rbx
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <trim@plt>
mov    %eax,%edi
call   1050 <id3map_add_from_string@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <strtok@plt>
test   %rax,%rax
jne    1150 <id3map_add_multiple_from_string+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
define void @id3map_add_multiple_from_string(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %2, %1 ]
%6 = tail call i32 @trim(i8* %5)
%7 = tail call i32 @id3map_add_from_string(i32 %6)
%8 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
int h(int x) { int y$1; }


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

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

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

LLVM IR (-O2):
define i32 @h(i32 %0) {
ret i32 undef
}
/* Variables and functions */
char tolower(char);
void lowerstr(char *s) {
  for (; '\0' != *s; s++)
    *s = tolower(*s);
}


x86 assembly (clang, -O0):
<lowerstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1152 <lowerstr+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lowerstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowerstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lowerstr+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lowerstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lowerstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t getScaleFactor(uint32_t multiply, uint32_t divide) {
  return divide == 0 ? 0 : ((uint64_t)multiply << 32) / divide + 1;
}


x86 assembly (clang, -O0):
<getScaleFactor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111e <getScaleFactor+0x1e>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <getScaleFactor+0x32>
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getScaleFactor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %14
8: ; preds = %2
%9 = load i32, i32* %3
%10 = shl i32 %9, 32
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
%13 = add nsw i32 %12, 1
br label %14
14: ; preds = %8, %7
%15 = phi i32 [ 0, %7 ], [ %13, %8 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @getScaleFactor(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetRedVideoBlackLevel(void *,
                                                                       int);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPRenderingControl_GetRedVideoBlackLevel(void *upnptoken,
                                                unsigned int InstanceID) {
  printf("Invoke: UPnPRenderingControl_GetRedVideoBlackLevel(%u);\r\n",
         InstanceID);
  UPnPResponse_RenderingControl_GetRedVideoBlackLevel(upnptoken, 250);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetRedVideoBlackLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfa,%esi
call   1030 <UPnPResponse_RenderingControl_GetRedVideoBlackLevel@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [58 x i8] c"Invoke: UPnPRenderingControl_GetRedVideoBlackLevel(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetRedVideoBlackLevel(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_RenderingControl_GetRedVideoBlackLevel(i8* %7, i32 250)
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"Invoke: UPnPRenderingControl_GetRedVideoBlackLevel(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetRedVideoBlackLevel(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_RenderingControl_GetRedVideoBlackLevel(i8* %0, i32 250)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/JosenChareles/os-virt-viewer/refs/"
             "heads/master/src/.libs/lt-remote-viewer.c",
             332, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x14c,%esi
lea    0xf4f(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf6a(%rip),%rdx
mov    $0x14c,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JosenChareles/os-virt-viewer/refs/heads/master/src/.libs/lt-remote-viewer.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0), i32 332, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JosenChareles/os-virt-viewer/refs/heads/master/src/.libs/lt-remote-viewer.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0), i32 332, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
void kobject_del(struct kobject *x) { return; }


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
define void @kobject_del(%struct.kobject* nocapture %0) {
ret void
}
void sonix_setAutobright(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @sonix_setAutobright(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char const *,
                            char const *);
int phRegister2(const char *username, const char *server, int timeout) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "REG T=%d U=%s S=%s", timeout, username,
           server);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phRegister2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x3e8,%esi
lea    0xeac(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phRegister2>:
push   %rbx
sub    $0x3f0,%rsp
mov    %edx,%ecx
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xec9(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"REG T=%d U=%s S=%s\00"
define i32 @phRegister2(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1000 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 @snprintf(i8* %8, i32 1000, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%14 = call i32 @ph_rpc(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"REG T=%d U=%s S=%s\00"
define i32 @phRegister2(i8* %0, i8* %1, i32 %2) {
%4 = alloca [1000 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 1000, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0, i8* %1)
%7 = call i32 @ph_rpc(i8* %5)
ret i32 %7
}
int test_imm_4Cuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x4C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Cuint64_midword_mem>:
testb  $0x4c,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Cuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4980736
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ilog2(unsigned val) {
  int x = -1;
  while (val != 0) {
    val >>= 1;
    ++x;
  }
  return x;
}


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <ilog2+0x2f>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ilog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     111c <ilog2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ilog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ -1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
struct _icmAlloc {
  int dummy;
};

/* Variables and functions */
void *malloc(size_t);
void *icmAllocStd_malloc(struct _icmAlloc *pp, size_t size) {
  return malloc(size);
}


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

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

LLVM IR (-O0):
%struct._icmAlloc = type { i32 }
define i8* @icmAllocStd_malloc(%struct._icmAlloc* %0, i64 %1) {
%3 = alloca %struct._icmAlloc*
%4 = alloca i64
store %struct._icmAlloc* %0, %struct._icmAlloc** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i8* @malloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct._icmAlloc = type { i32 }
define noalias i8* @icmAllocStd_malloc(%struct._icmAlloc* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
/* Variables and functions */
bool test_integrate() { return true; }


x86 assembly (clang, -O0):
<test_integrate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_integrate() {
ret i32 1
}

LLVM IR (-O2):
define i32 @test_integrate() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dci_format1B_sizeof(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t dci_format1D_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
  return dci_format1B_sizeof(nof_prb, nof_ports);
}


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

x86 assembly (clang, -O2):
<dci_format1D_sizeof>:
jmp    1030 <dci_format1B_sizeof@plt>

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

LLVM IR (-O2):
define i32 @dci_format1D_sizeof(i32 %0, i32 %1) {
%3 = tail call i32 @dci_format1B_sizeof(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double log1p(double);
double c_to_f(double c) {
  double cp1 = 1.0 + c;
  return (c * cp1 / (log1p(c) * cp1 - c));
}


x86 assembly (clang, -O0):
<c_to_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_to_f>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movsd  0xedf(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1030 <log1p@plt>
mulsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @c_to_f(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %2
%10 = call double @log1p(double %9)
%11 = load double, double* %3
%12 = load double, double* %2
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %10, double %11, double %13)
%15 = fdiv double %8, %14
ret double %15
}

LLVM IR (-O2):
define double @c_to_f(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fmul double %2, %0
%4 = tail call double @log1p(double %0)
%5 = fneg double %0
%6 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %5)
%7 = fdiv double %3, %6
ret double %7
}