xunge/DecIR huggingface dataset:
/* Variables and functions */
int left(int);
int right(int i) { return left(i) + 1; }


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

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

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

LLVM IR (-O2):
define i32 @right(i32 %0) {
%2 = tail call i32 @left(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
float fmaxf(float, float);
float distance_sub(float d1, float d2) { return fmaxf(d1, -d2); }


x86 assembly (clang, -O0):
<distance_sub>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_sub>:
xorps  0xef9(%rip),%xmm1
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
maxss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @distance_sub(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fneg float %6
%8 = call float @llvm.maxnum.f32(float %5, float %7)
ret float %8
}

LLVM IR (-O2):
define float @distance_sub(float %0, float %1) {
%3 = fneg float %1
%4 = tail call float @llvm.maxnum.f32(float %0, float %3)
ret float %4
}
int bar(int n) {
  int ret;
  if (n > 10)
    ret = 10;
  else
    ret = n / 2;
  return ret;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    111d <bar+0x1d>
movl   $0xa,-0x8(%rbp)
jmp    112b <bar+0x2b>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0xa,%eax
cmp    $0xa,%edi
jg     1113 <bar+0x13>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp sgt i32 %0, 10
%3 = sdiv i32 %0, 2
%4 = select i1 %2, i32 10, i32 %3
ret i32 %4
}
void pci_restore_pasid_state(struct pci_dev *pdev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_restore_pasid_state(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int a = 0xff;
  if ((a << 4) >> 12)
    printf("Right");
  else
    printf("Wrong");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
sar    $0xc,%eax
cmp    $0x0,%eax
je     1149 <main+0x39>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <main+0x45>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"Wrong\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ backtrack_co(char const *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void backtrack(const char *sequence) {
  backtrack_co(sequence, 0, 0);
  return;
}


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

x86 assembly (clang, -O2):
<backtrack>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <backtrack_co@plt>

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

LLVM IR (-O2):
define void @backtrack(i8* %0) {
%2 = tail call i32 @backtrack_co(i8* %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
bool isSolution(int k, int n) { return k == n; }


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

x86 assembly (clang, -O2):
<isSolution>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isSolution(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isSolution(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
float division(float x, float y) { return x / y; }


x86 assembly (clang, -O0):
<division>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<division>:
divss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @division(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
void VMR3Create(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3Create() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sysCall(int, int, int, char, char, char);
void sysPaintPixel(int x, int y, char B, char G, char R) {
  sysCall(5, x, y, B, G, R);
}


x86 assembly (clang, -O0):
<sysPaintPixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %r8b,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x9(%rbp),%cl
mov    -0xa(%rbp),%al
mov    $0x5,%edi
movsbl %cl,%ecx
movsbl %al,%r8d
movsbl -0xb(%rbp),%r9d
call   1030 <sysCall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysPaintPixel>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x5,%edi
jmp    1030 <sysCall@plt>

LLVM IR (-O0):
define void @sysPaintPixel(i32 %0, i32 %1, i8 signext %2, i8 signext %3, i8 signext %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i8 %4, i8* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8, i8* %8
%14 = load i8, i8* %9
%15 = load i8, i8* %10
%16 = call i32 @sysCall(i32 5, i32 %11, i32 %12, i8 signext %13, i8 signext %14, i8 signext %15)
ret void
}

LLVM IR (-O2):
define void @sysPaintPixel(i32 %0, i32 %1, i8 signext %2, i8 signext %3, i8 signext %4) {
%6 = tail call i32 @sysCall(i32 5, i32 %0, i32 %1, i8 signext %2, i8 signext %3, i8 signext %4)
ret void
}
/* Variables and functions */
int linear(int);
int log_n(int);
int n_squared(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char *argv[]) {
  int iterations = 100;
  int n2_result = 0;
  int n_result = 0;
  int log_result = 0;
  n2_result = n_squared(iterations);
  n_result = linear(iterations);
  log_result = log_n(iterations);
  printf("Results.\nn^2: %d\nn: %d\nlog n: %d\n", n2_result, n_result,
         log_result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <n_squared@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <linear@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <log_n@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x64,%edi
call   1030 <n_squared@plt>
mov    %eax,%ebx
mov    $0x64,%edi
call   1050 <linear@plt>
mov    %eax,%ebp
mov    $0x64,%edi
call   1060 <log_n@plt>
lea    0xe94(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Results.\0An^2: %d\0An: %d\0Alog n: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %6
%11 = call i32 @n_squared(i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = call i32 @linear(i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %6
%15 = call i32 @log_n(i32 %14)
store i32 %15, i32* %9
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Results.\0An^2: %d\0An: %d\0Alog n: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @n_squared(i32 100)
%4 = tail call i32 @linear(i32 100)
%5 = tail call i32 @log_n(i32 100)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret i32 0
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/tcexp.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/tcexp.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/tcexp.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
void Reserved_Handler28(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler28>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler28+0x9>
jmp    1109 <Reserved_Handler28+0x9>

x86 assembly (clang, -O2):
<Reserved_Handler28>:
jmp    1100 <Reserved_Handler28>

LLVM IR (-O0):
define void @Reserved_Handler28() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Reserved_Handler28() {
br label %1
1: ; preds = %0, %1
br label %1
}
void edg_ini(int md, int nv, int *hx) {
  int n, i;
  n = md * nv;
  for (i = 0; i < n; i++)
    hx[i] = -1;
}


x86 assembly (clang, -O0):
<edg_ini>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1148 <edg_ini+0x48>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111f <edg_ini+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<edg_ini>:
imul   %esi,%edi
test   %edi,%edi
jle    1132 <edg_ini+0x22>
push   %rax
mov    %edi,%eax
shl    $0x2,%rax
mov    %rdx,%rdi
mov    $0xff,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @edg_ini(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = mul i32 %1, %0
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = bitcast i32* %2 to i8*
%8 = zext i32 %4 to i64
%9 = shl nuw nsw i64 %8, 2
br label %10
10: ; preds = %6, %3
ret void
}
/* Variables and functions */
int WTERMSIG(int);
int wtermsig(int status) { return WTERMSIG(status); }


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

x86 assembly (clang, -O2):
<wtermsig>:
jmp    1030 <WTERMSIG@plt>

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

LLVM IR (-O2):
define i32 @wtermsig(i32 %0) {
%2 = tail call i32 @WTERMSIG(i32 %0)
ret i32 %2
}
/* Variables and functions */
char getBaseRandom(int);
char change(char ch) {
  switch (ch) {
  case 'A':
    return getBaseRandom(3);
  case 'T':
    return getBaseRandom(2);
  case 'C':
    return getBaseRandom(1);
  case 'G':
    return getBaseRandom(0);
  }
  return ch;
}


x86 assembly (clang, -O0):
<change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     118d <change+0x7d>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x3,%edi
call   1030 <getBaseRandom@plt>
mov    %al,-0x1(%rbp)
jmp    1193 <change+0x83>
mov    $0x2,%edi
call   1030 <getBaseRandom@plt>
mov    %al,-0x1(%rbp)
jmp    1193 <change+0x83>
mov    $0x1,%edi
call   1030 <getBaseRandom@plt>
mov    %al,-0x1(%rbp)
jmp    1193 <change+0x83>
xor    %edi,%edi
call   1030 <getBaseRandom@plt>
mov    %al,-0x1(%rbp)
jmp    1193 <change+0x83>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change>:
mov    %edi,%eax
lea    -0x41(%rax),%ecx
cmp    $0x13,%ecx
ja     1139 <change+0x29>
mov    $0x3,%edi
lea    0xeda(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1,%edi
jmp    1030 <getBaseRandom@plt>
ret
xor    %edi,%edi
jmp    1030 <getBaseRandom@plt>
mov    $0x2,%edi
jmp    1030 <getBaseRandom@plt>

LLVM IR (-O0):
define signext i8 @change(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %14 [
i32 65, label %6
i32 84, label %8
i32 67, label %10
i32 71, label %12
]
6: ; preds = %1
%7 = call signext i8 @getBaseRandom(i32 3)
store i8 %7, i8* %2
br label %16
8: ; preds = %1
%9 = call signext i8 @getBaseRandom(i32 2)
store i8 %9, i8* %2
br label %16
10: ; preds = %1
%11 = call signext i8 @getBaseRandom(i32 1)
store i8 %11, i8* %2
br label %16
12: ; preds = %1
%13 = call signext i8 @getBaseRandom(i32 0)
store i8 %13, i8* %2
br label %16
14: ; preds = %1
%15 = load i8, i8* %3
store i8 %15, i8* %2
br label %16
16: ; preds = %14, %12, %10, %8, %6
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @change(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 65, label %6
i32 84, label %3
i32 67, label %4
i32 71, label %5
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %3, %4, %5
%7 = phi i32 [ 0, %5 ], [ 1, %4 ], [ 2, %3 ], [ 3, %1 ]
%8 = tail call signext i8 @getBaseRandom(i32 %7)
br label %9
9: ; preds = %6, %1
%10 = phi i8 [ %0, %1 ], [ %8, %6 ]
ret i8 %10
}
/* Variables and functions */
int detect_sse();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ game();
int /*<<< orphan*/ stderr;
void solve() {
  int sse;
  sse = detect_sse();
  if (sse == 0) {
    fprintf(stderr, "no SSE support\n");
    return;
  }
  game();
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <detect_sse@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1166 <solve+0x36>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
jmp    116d <solve+0x3d>
mov    $0x0,%al
call   1040 <game@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %rax
xor    %eax,%eax
call   1050 <detect_sse@plt>
test   %eax,%eax
je     1144 <solve+0x14>
xor    %eax,%eax
pop    %rcx
jmp    1040 <game@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"no SSE support\0A\00"
define void @solve() {
%1 = alloca i32
%2 = call i32 (...) @detect_sse()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 (...) @game()
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"no SSE support\0A\00"
define void @solve() {
%1 = tail call i32 (...) @detect_sse()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @game()
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, total_km;
  float litters;
  scanf("%d%d", &a, &b);
  total_km = a * b;
  litters = (float)total_km / 12;
  printf("%0.3f\n", litters);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm0
movss  0xea6(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
imul   0x4(%rsp),%eax
cvtsi2ss %eax,%xmm0
divss  0xeb7(%rip),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%0.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to float
%12 = fdiv float %11, 1.200000e+01
store float %12, float* %5
%13 = load float, float* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%0.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = sitofp i32 %8 to float
%10 = fdiv float %9, 1.200000e+01
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ETH_P_ALL;
int /*<<< orphan*/ PF_PACKET;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int openSocket() {
  int sockFd;
  sockFd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
  return sockFd;
}


x86 assembly (clang, -O0):
<openSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openSocket>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rax
mov    (%rax),%ebx
mov    0x2ead(%rip),%rax
mov    (%rax),%ebp
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <socket@plt>

LLVM IR (-O0):
@PF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@ETH_P_ALL = global i32 0
define i32 @openSocket() {
%1 = alloca i32
%2 = load i32, i32* @PF_PACKET
%3 = load i32, i32* @SOCK_RAW
%4 = load i32, i32* @ETH_P_ALL
%5 = call i32 @htons(i32 %4)
%6 = call i32 @socket(i32 %2, i32 %3, i32 %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@PF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@ETH_P_ALL = global i32 0
define i32 @openSocket() {
%1 = load i32, i32* @PF_PACKET
%2 = load i32, i32* @SOCK_RAW
%3 = load i32, i32* @ETH_P_ALL
%4 = tail call i32 @htons(i32 %3)
%5 = tail call i32 @socket(i32 %1, i32 %2, i32 %4)
ret i32 %5
}
void ff_hevc_put_hevc_bi_qpel_v24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v24_12_sse4() {
ret void
}
/* Variables and functions */
char *stpcpy(char *, char const *);
void StrAppend4(char target[], const char a[], const char b[], const char c[],
                const char d[]) {
  stpcpy(stpcpy(stpcpy(stpcpy(target, a), b), c), d);
}


x86 assembly (clang, -O0):
<StrAppend4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <stpcpy@plt>
mov    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <stpcpy@plt>
mov    %rax,%rdi
mov    -0x20(%rbp),%rsi
call   1030 <stpcpy@plt>
mov    %rax,%rdi
mov    -0x28(%rbp),%rsi
call   1030 <stpcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrAppend4>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
call   1040 <stpcpy@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <stpcpy@plt>
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <stpcpy@plt>
mov    %rax,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @StrAppend4(i8* %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4) {
%6 = tail call i8* @stpcpy(i8* %0, i8* %1)
%7 = tail call i8* @stpcpy(i8* %6, i8* %2)
%8 = tail call i8* @stpcpy(i8* %7, i8* %3)
%9 = tail call i8* @strcpy(i8* dereferenceable(1) %8, i8* dereferenceable(1) %4)
ret void
}
void BitSet(void *Data, unsigned Bit) {
  unsigned char *D = Data;
  D[Bit / 8] |= 0x01 << (Bit % 8);
}


x86 assembly (clang, -O0):
<BitSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitSet>:
mov    %esi,%eax
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
shr    $0x3,%rax
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @BitSet(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = urem i32 %7, 8
%9 = shl i32 1, %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%12 = udiv i32 %11, 8
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = or i32 %16, %9
%18 = trunc i32 %17 to i8
store i8 %18, i8* %14
ret void
}

LLVM IR (-O2):
define void @BitSet(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = lshr i32 %1, 3
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x14() {
  Assert_real((isalnum(20) == 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",
              105, ("isalnum should be 0 for 0x14"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x14>:
push   %rax
mov    $0x14,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x69,%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 0x14\00"
define void @t_isalnum_0x14() {
%1 = call i64 @isalnum(i32 20)
%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 105, 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 0x14\00"
define void @t_isalnum_0x14() {
%1 = tail call i64 @isalnum(i32 20)
%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 105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_disable_setlocale() {}


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

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

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

LLVM IR (-O2):
define void @gtk_disable_setlocale() {
ret void
}
void foo_1_2_1_2_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_1_1_2_2() {
ret void
}
/* Variables and functions */
float sin(float);
float fcn_sin(float x) { return (sin(x)); }


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

x86 assembly (clang, -O2):
<fcn_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define float @fcn_sin(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
double SIM_power_gatecap(width, wirelength)
double width;
double wirelength;
{
  double overlapCap;
  double gateCap;
  double l = 0.1525;
  return (width * (0.8 * 0.0875) * (1.950000e-15) +
          wirelength * (0.25e-15 * (172.2157) * 0.0875) * (0.8 * 0.0875));
}


x86 assembly (clang, -O0):
<SIM_power_gatecap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xf02(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xee5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_power_gatecap>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm2
mulsd  0xef0(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @SIM_power_gatecap(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 1.525000e-01, double* %7
%8 = load double, double* %3
%9 = fmul double %8, 0x3FB1EB851EB851EB
%10 = load double, double* %4
%11 = fmul double %10, 0x3CF0F74EA1538D70
%12 = fmul double %11, 0x3FB1EB851EB851EB
%13 = call double @llvm.fmuladd.f64(double %9, double 1.950000e-15, double %12)
ret double %13
}

LLVM IR (-O2):
define double @SIM_power_gatecap(double %0, double %1) {
%3 = fmul double %0, 0x3FB1EB851EB851EB
%4 = fmul double %1, 0x3CF0F74EA1538D70
%5 = fmul double %4, 0x3FB1EB851EB851EB
%6 = tail call double @llvm.fmuladd.f64(double %3, double 1.950000e-15, double %5)
ret double %6
}
/* Variables and functions */
int strcmp(char const *const, char const *const);
int cmp_names(const void *p1, const void *p2) {
  const char *const *s1 = p1, *const *s2 = p2;
  return strcmp(*s1, *s2);
}


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

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

LLVM IR (-O0):
define i32 @cmp_names(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp_names(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
int lg4ff_deinit(struct hid_device *hdev) { return -1; }


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

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

LLVM IR (-O0):
%struct.hid_device = type opaque
define i32 @lg4ff_deinit(%struct.hid_device* %0) {
%2 = alloca %struct.hid_device*
store %struct.hid_device* %0, %struct.hid_device** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.hid_device = type opaque
define i32 @lg4ff_deinit(%struct.hid_device* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() { printf("Help currently not available.\n"); }


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

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

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

LLVM IR (-O2):
@str = [30 x i8] c"Help currently not available.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int bin_is_end(uint8_t b) { return ((b & 0b01010000) == 0b01010000); }


x86 assembly (clang, -O0):
<bin_is_end>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x50,%eax
cmp    $0x50,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_is_end>:
not    %edi
xor    %eax,%eax
test   $0x50,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @bin_is_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 80
%5 = icmp eq i32 %4, 80
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @bin_is_end(i32 %0) {
%2 = and i32 %0, 80
%3 = icmp eq i32 %2, 80
%4 = zext i1 %3 to i32
ret i32 %4
}
int egg_unix_credentials_setup(int sock) {
  int retval = 0;
  return retval;
}


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

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

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

LLVM IR (-O2):
define i32 @egg_unix_credentials_setup(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x9f() {
  Assert_real((ispunct(159) == 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_ispunct.c",
              800, ("ispunct should be 0 for 0x9f"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x9f>:
push   %rax
mov    $0x9f,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x320,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x9f\00"
define void @t_ispunct_0x9f() {
%1 = call i64 @ispunct(i32 159)
%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 800, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x9f\00"
define void @t_ispunct_0x9f() {
%1 = tail call i64 @ispunct(i32 159)
%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 800, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void mat_init_zero(float *a, int n) {
  int i;
  for (i = 0; i < n * n; i++) {
    a[i] = 0.0f;
  }
}


x86 assembly (clang, -O0):
<mat_init_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    1142 <mat_init_zero+0x42>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <mat_init_zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_init_zero>:
imul   %esi,%esi
test   %esi,%esi
je     1129 <mat_init_zero+0x19>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @mat_init_zero(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = icmp slt i32 %7, %10
br i1 %11, label %12, label %20
12: ; preds = %6
%13 = load float*, float** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
store float 0.000000e+00, float* %16
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @mat_init_zero(float* nocapture writeonly %0, i32 %1) {
%3 = mul i32 %1, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = bitcast float* %0 to i8*
%7 = zext i32 %3 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %2
ret void
}
unsigned int lobit(unsigned int x) {
  unsigned int res = 32;
  while (x & 0xffffff) {
    x <<= 8;
    res -= 8;
  }
  while (x) {
    x <<= 1;
    res -= 1;
  }
  return res;
}


x86 assembly (clang, -O0):
<lobit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
cmp    $0x0,%eax
je     1136 <lobit+0x36>
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <lobit+0xe>
jmp    113b <lobit+0x3b>
cmpl   $0x0,-0x4(%rbp)
je     115c <lobit+0x5c>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <lobit+0x3b>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lobit>:
mov    $0x20,%eax
test   $0xffffff,%edi
je     111d <lobit+0x1d>
mov    %edi,%ecx
nop
shl    $0x8,%edi
add    $0xfffffff8,%eax
test   %cx,%cx
mov    %edi,%ecx
jne    1110 <lobit+0x10>
test   %edi,%edi
je     1129 <lobit+0x29>
bsf    %edi,%ecx
or     $0xffffffe0,%ecx
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @lobit(i32 %0) {
%2 = and i32 %0, 16777215
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %12, %1
%5 = phi i32 [ %0, %1 ], [ %15, %12 ]
%6 = phi i32 [ 32, %1 ], [ %16, %12 ]
%7 = icmp eq i32 %5, 0
br i1 %7, label %19, label %8
8: ; preds = %4
%9 = call i32 @llvm.cttz.i32(i32 %5, i1 true)
%10 = or i32 %9, -32
%11 = add i32 %10, %6
br label %19
12: ; preds = %1, %12
%13 = phi i32 [ %16, %12 ], [ 32, %1 ]
%14 = phi i32 [ %15, %12 ], [ %0, %1 ]
%15 = shl i32 %14, 8
%16 = add i32 %13, -8
%17 = and i32 %14, 65535
%18 = icmp eq i32 %17, 0
br i1 %18, label %4, label %12
19: ; preds = %8, %4
%20 = phi i32 [ %6, %4 ], [ %11, %8 ]
ret i32 %20
}
int xrand(void) {
  static long randx = 1;
  return ((randx = randx * 1103515245 + 12345) & 0x7fffffff);
}


x86 assembly (clang, -O0):
<xrand>:
push   %rbp
mov    %rsp,%rbp
imul   $0x41c64e6d,0x2f11(%rip),%rax
6d 4e c6 41
add    $0x3039,%rax
mov    %rax,0x2f04(%rip)
and    $0x7fffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrand>:
imul   $0x41c64e6d,0x2f15(%rip),%rax
6d 4e c6 41
add    $0x3039,%rax
mov    %rax,0x2f08(%rip)
and    $0x7fffffff,%eax
ret

LLVM IR (-O0):
@xrand.randx = internal global i64 1
define i32 @xrand() {
%1 = load i64, i64* @xrand.randx
%2 = mul nsw i64 %1, 1103515245
%3 = add nsw i64 %2, 12345
store i64 %3, i64* @xrand.randx
%4 = and i64 %3, 2147483647
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@xrand.randx = internal unnamed_addr global i64 1
define i32 @xrand() {
%1 = load i64, i64* @xrand.randx
%2 = mul nsw i64 %1, 1103515245
%3 = add nsw i64 %2, 12345
store i64 %3, i64* @xrand.randx
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 2147483647
ret i32 %5
}
double tan(double x) { return 0; }


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @tan(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ addInt(long long);
int /*<<< orphan*/ addString(char *);
void addValue(char *s, long long i) {
  addString(s);
  addInt(i);
}


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

x86 assembly (clang, -O2):
<addValue>:
push   %rbx
mov    %rsi,%rbx
call   1030 <addString@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <addInt@plt>

LLVM IR (-O0):
define void @addValue(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 = call i32 @addString(i8* %5)
%7 = load i64, i64* %4
%8 = call i32 @addInt(i64 %7)
ret void
}

LLVM IR (-O2):
define void @addValue(i8* %0, i64 %1) {
%3 = tail call i32 @addString(i8* %0)
%4 = tail call i32 @addInt(i64 %1)
ret void
}