xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x7c() {
  Assert_real((isbdigit(124) == 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_isbdigit.c",
              625, ("isbdigit should be 0 for |"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x7c>:
push   %rax
mov    $0x7c,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x271,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for |\00"
define void @t_isbdigit_0x7c() {
%1 = call i64 @isbdigit(i32 124)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 625, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for |\00"
define void @t_isbdigit_0x7c() {
%1 = tail call i64 @isbdigit(i32 124)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 625, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xa2() {
  Assert_real((islower(162) == 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_islower.c",
              815, ("islower should be 0 for 0xa2"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xa2>:
push   %rax
mov    $0xa2,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x32f,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa2\00"
define void @t_islower_0xa2() {
%1 = call i64 @islower(i32 162)
%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 815, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa2\00"
define void @t_islower_0xa2() {
%1 = tail call i64 @islower(i32 162)
%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 815, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int DestroyMat(double **A, int NumRow) {
  int i;
  for (i = 0; i < NumRow; ++i) {
    free(A[i]);
  }
  free(A);
  return 0;
}


x86 assembly (clang, -O0):
<DestroyMat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <DestroyMat+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <DestroyMat+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DestroyMat>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <DestroyMat+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <DestroyMat+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @DestroyMat(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void modify_room() { printf("Modyfikowanie pokoju\n"); }


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Modyfikowanie pokoju\00"
define void @modify_room() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
void store(int *ptr, int val) { __atomic_store_n(ptr, val, 5); }


x86 assembly (clang, -O0):
<store>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xchg   %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store>:
xchg   %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @store(i32* nocapture writeonly %0, i32 %1) {
store atomic i32 %1, i32* %0 seq_cst
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Reals_ConvertL(float, int, void *, long long);
void Reals_Convert(float x, int n, unsigned char *d, long long d__len) {
  Reals_ConvertL(x, n, (void *)d, d__len);
}


x86 assembly (clang, -O0):
<Reals_Convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <Reals_ConvertL@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reals_Convert>:
jmp    1030 <Reals_ConvertL@plt>

LLVM IR (-O0):
define void @Reals_Convert(float %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca float
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store float %0, float* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load float, float* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @Reals_ConvertL(float %9, i32 %10, i8* %11, i64 %12)
ret void
}

LLVM IR (-O2):
define void @Reals_Convert(float %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 @Reals_ConvertL(float %0, i32 %1, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ child();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
void fork_child(void) {
  switch (fork()) {
  case 0:
    child();
    exit(0);
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<fork_child>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
jne    1156 <fork_child+0x26>
jmp    1148 <fork_child+0x18>
mov    $0x0,%al
call   1030 <child@plt>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    115b <fork_child+0x2b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_child>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     113e <fork_child+0xe>
pop    %rax
ret
xor    %eax,%eax
call   1030 <child@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fork_child() {
%1 = call i32 (...) @fork()
switch i32 %1, label %5 [
i32 0, label %2
]
2: ; preds = %0
%3 = call i32 (...) @child()
%4 = call i32 @exit(i32 0)
unreachable
5: ; preds = %0
br label %6
6: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @fork_child() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @child()
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
ret void
}
int test_pmd_ring(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_pmd_ring() {
ret i32 0
}
void cfatal(str) char *str;
{
  cmsg("CPP-FATAL error", str);
  exit(255);
}


x86 assembly (clang, -O0):
<cfatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <cmsg@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cfatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <cmsg@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"CPP-FATAL error\00"
define void @cfatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @cmsg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"CPP-FATAL error\00"
define void @cfatal(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @cmsg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void @exit(i32 255)
unreachable
}
int other(int t) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @other(i32 %0) {
ret i32 2
}
/* Variables and functions */
int adpcm_encode_mono(short *, unsigned char *, int);
int adpcm_encode_stereo(short *, unsigned char *, int);
int adpcm_encode(short *indata, unsigned char *outdata, int len, int channels) {
  if (channels == 2) {
    return adpcm_encode_stereo(indata, outdata, len);
  }
  return adpcm_encode_mono(indata, outdata, len);
}


x86 assembly (clang, -O0):
<adpcm_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpl   $0x2,-0x20(%rbp)
jne    1158 <adpcm_encode+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <adpcm_encode_stereo@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <adpcm_encode+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <adpcm_encode_mono@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adpcm_encode>:
cmp    $0x2,%ecx
jne    112a <adpcm_encode+0xa>
jmp    1040 <adpcm_encode_stereo@plt>
jmp    1030 <adpcm_encode_mono@plt>

LLVM IR (-O0):
define i32 @adpcm_encode(i16* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i16*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i16* %0, i16** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i16*, i16** %6
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @adpcm_encode_stereo(i16* %13, i8* %14, i32 %15)
store i32 %16, i32* %5
br label %22
17: ; preds = %4
%18 = load i16*, i16** %6
%19 = load i8*, i8** %7
%20 = load i32, i32* %8
%21 = call i32 @adpcm_encode_mono(i16* %18, i8* %19, i32 %20)
store i32 %21, i32* %5
br label %22
22: ; preds = %17, %12
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @adpcm_encode(i16* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 2
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @adpcm_encode_stereo(i16* %0, i8* %1, i32 %2)
br label %10
8: ; preds = %4
%9 = tail call i32 @adpcm_encode_mono(i16* %0, i8* %1, i32 %2)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
int test_imm_49uint8_reg(unsigned char val) {
  return ((val) & (-0x49 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_49uint8_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, -73
%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_49uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -73
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *strndup(char const *, unsigned int);
int testStrndup(const char *s, unsigned validIndex, unsigned size) {
  char *s2 = strndup(s, size);
  s2[validIndex + 1] = 'b';
  if (s2[validIndex] != 'a')
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<testStrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <strndup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movb   $0x62,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
je     1162 <testStrndup+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1169 <testStrndup+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStrndup>:
push   %rbx
mov    %esi,%ebx
mov    %edx,%esi
call   1030 <strndup@plt>
mov    %ebx,%edx
xor    %ecx,%ecx
cmpb   $0x61,(%rax,%rdx,1)
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @testStrndup(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i8* @strndup(i8* %0, i32 %2)
%5 = zext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 97
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f2(void) { abort(); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<f2>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f2() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ toggle_screensaver();
void key1_event() { toggle_screensaver(); }


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

x86 assembly (clang, -O2):
<key1_event>:
xor    %eax,%eax
jmp    1030 <toggle_screensaver@plt>

LLVM IR (-O0):
define void @key1_event() {
%1 = call i32 (...) @toggle_screensaver()
ret void
}

LLVM IR (-O2):
define void @key1_event() {
%1 = tail call i32 (...) @toggle_screensaver()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *ptr) {
  if (NULL != ptr) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1131 <xfree+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ COND_LT();
int /*<<< orphan*/ EA_AY_DI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_slt_8_di(void) {
  m68ki_write_8(EA_AY_DI_8(), COND_LT() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_slt_8_di>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_DI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_LT@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_slt_8_di>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_DI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_LT@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_slt_8_di() {
%1 = call i32 (...) @EA_AY_DI_8()
%2 = call i64 (...) @COND_LT()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_slt_8_di() {
%1 = tail call i32 (...) @EA_AY_DI_8()
%2 = tail call i64 (...) @COND_LT()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
int issep(char *ch) {
  int ret;
  if ((ch == ' ') || (ch == ',') || (ch == '\n') || (ch == '\t'))
    ret = 1;
  else
    ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<issep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x20,%eax
cmp    %rax,-0x8(%rbp)
je     1144 <issep+0x44>
mov    $0x2c,%eax
cmp    %rax,-0x8(%rbp)
je     1144 <issep+0x44>
mov    $0xa,%eax
cmp    %rax,-0x8(%rbp)
je     1144 <issep+0x44>
mov    $0x9,%eax
cmp    %rax,-0x8(%rbp)
jne    1150 <issep+0x50>
movl   $0x1,-0xc(%rbp)
jmp    1157 <issep+0x57>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<issep>:
cmp    $0x2c,%rdi
ja     111c <issep+0x1c>
mov    $0x1,%eax
movabs $0x100100000600,%rcx
bt     %rdi,%rcx
jae    111c <issep+0x1c>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @issep(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, inttoptr (i64 32 to i8*)
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = icmp eq i8* %7, inttoptr (i64 44 to i8*)
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = icmp eq i8* %10, inttoptr (i64 10 to i8*)
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i8*, i8** %2
%14 = icmp eq i8* %13, inttoptr (i64 9 to i8*)
br i1 %14, label %15, label %16
15: ; preds = %12, %9, %6, %1
store i32 1, i32* %3
br label %17
16: ; preds = %12
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @issep(i8* %0) {
%2 = ptrtoint i8* %0 to i64
switch i64 %2, label %3 [
i64 44, label %4
i64 32, label %4
i64 10, label %4
i64 9, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
int flcmp_cb_dec(void *a, void *b) { return -(*(int *)a - *(int *)b); }


x86 assembly (clang, -O0):
<flcmp_cb_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @flcmp_cb_dec(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @flcmp_cb_dec(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub i32 %6, %4
ret i32 %7
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *btp_skip_whitespace(const char *s) {
  while (isspace(*s))
    ++s;
  return (char *)s;
}


x86 assembly (clang, -O0):
<btp_skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <btp_skip_whitespace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <btp_skip_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btp_skip_whitespace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <btp_skip_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @btp_skip_whitespace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x01() {
  Assert_real((isupper(1) == 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_isupper.c",
              10, ("isupper should be 0 for 0x01"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x01>:
push   %rax
mov    $0x1,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x01\00"
define void @t_isupper_0x01() {
%1 = call i64 @isupper(i32 1)
%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 10, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x01\00"
define void @t_isupper_0x01() {
%1 = tail call i64 @isupper(i32 1)
%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 10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void about() {
  printf("\n\n\n\t\t\t\tABOUT US\n");
  printf("\t\t\t====================== \n\n");
  printf("\n\n\t\tThe Cow-Bull game is designed by Nikhil Supekar.\n\n");
}


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

x86 assembly (clang, -O2):
<about>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\0A\0A\0A\09\09\09\09ABOUT US\0A\00"
@.str.1 = [29 x i8] c"\09\09\09====================== \0A\0A\00"
@.str.2 = [55 x i8] c"\0A\0A\09\09The Cow-Bull game is designed by Nikhil Supekar.\0A\0A\00"
define void @about() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"\0A\0A\0A\09\09\09\09ABOUT US\00"
@str.3 = [28 x i8] c"\09\09\09====================== \0A\00"
@str.4 = [54 x i8] c"\0A\0A\09\09The Cow-Bull game is designed by Nikhil Supekar.\0A\00"
define void @about() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned short inw_local(unsigned short);
unsigned short x_inw(unsigned short port) {
  unsigned short val;
  val = inw_local(port);
  return val;
}


x86 assembly (clang, -O0):
<x_inw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <inw_local@plt>
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_inw>:
jmp    1030 <inw_local@plt>

LLVM IR (-O0):
define zeroext i16 @x_inw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call zeroext i16 @inw_local(i16 zeroext %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @x_inw(i16 zeroext %0) {
%2 = tail call zeroext i16 @inw_local(i16 zeroext %0)
ret i16 %2
}
int abs(int n) { return n > 0 ? n : -n; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <abs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int pipe(int *);
int octave_pipe_wrapper(int *fd) { return pipe(fd); }


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

x86 assembly (clang, -O2):
<octave_pipe_wrapper>:
jmp    1030 <pipe@plt>

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

LLVM IR (-O2):
define i32 @octave_pipe_wrapper(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
ret i32 %2
}
void cheap_uni2ascii(char *src, char *dest, int l) {
  for (; l > 0; l -= 2) {
    *dest = *src;
    dest++;
    src += 2;
  }
  *dest = 0;
}


x86 assembly (clang, -O0):
<cheap_uni2ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    114b <cheap_uni2ascii+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <cheap_uni2ascii+0xf>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheap_uni2ascii>:
test   %edx,%edx
jle    1125 <cheap_uni2ascii+0x25>
add    $0x2,%edx
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
mov    %al,(%rsi)
add    $0x1,%rsi
add    $0x2,%rdi
add    $0xfffffffe,%edx
cmp    $0x2,%edx
ja     1110 <cheap_uni2ascii+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @cheap_uni2ascii(i8* nocapture %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %12, %5 ], [ %2, %3 ]
%7 = phi i8* [ %10, %5 ], [ %1, %3 ]
%8 = phi i8* [ %11, %5 ], [ %0, %3 ]
%9 = load i8, i8* %8
store i8 %9, i8* %7
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = getelementptr inbounds i8, i8* %8, i64 2
%12 = add nsw i32 %6, -2
%13 = icmp ugt i32 %6, 2
br i1 %13, label %5, label %14
14: ; preds = %5, %3
%15 = phi i8* [ %1, %3 ], [ %10, %5 ]
store i8 0, i8* %15
ret void
}
__attribute__((deprecated)) void DVBPSI_DEBUG_ARG(char *src, const char *str,
                                                  ...) {}


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

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

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

LLVM IR (-O2):
define void @DVBPSI_DEBUG_ARG(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
void XSharpDestroyImage(void *image) {}


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

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

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

LLVM IR (-O2):
define void @XSharpDestroyImage(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int pdu_npack(char *, char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int pdu_pack(char *dest, const char *src, int udhpadding) {
  return pdu_npack(dest, src, udhpadding, strlen(src));
}


x86 assembly (clang, -O0):
<pdu_pack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
call   1040 <pdu_npack@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_pack>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <pdu_npack@plt>

LLVM IR (-O0):
define i32 @pdu_pack(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %5
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @pdu_npack(i8* %7, i8* %8, i32 %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @pdu_pack(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @pdu_npack(i8* %0, i8* %1, i32 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long, long long, long long);
long long estimated_flops() {
  long long muls, divs, adds;
  muls = 512 * 512;
  divs = 512 * 512;
  adds = 512 * 512;
  muls += 512 * 512 * 512;
  adds += 512 * 512 * 512;
  adds += 512 * 512;
  printf("adds: %lld muls: %lld divs: %lld\n", adds, muls, divs);
  return adds + muls + divs;
}


x86 assembly (clang, -O0):
<estimated_flops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x40000,-0x8(%rbp)
movq   $0x40000,-0x10(%rbp)
movq   $0x40000,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8000000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8000000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x40000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimated_flops>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8080000,%esi
mov    $0x8040000,%edx
mov    $0x40000,%ecx
call   1030 <printf@plt>
mov    $0x10100000,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"adds: %lld muls: %lld divs: %lld\0A\00"
define i64 @estimated_flops() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
store i64 262144, i64* %1
store i64 262144, i64* %2
store i64 262144, i64* %3
%4 = load i64, i64* %1
%5 = add nsw i64 %4, 134217728
store i64 %5, i64* %1
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 134217728
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 262144
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = load i64, i64* %1
%12 = load i64, i64* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %10, i64 %11, i64 %12)
%14 = load i64, i64* %3
%15 = load i64, i64* %1
%16 = add nsw i64 %14, %15
%17 = load i64, i64* %2
%18 = add nsw i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
@.str = [34 x i8] c"adds: %lld muls: %lld divs: %lld\0A\00"
define i64 @estimated_flops() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 134742016, i64 134479872, i64 262144)
ret i64 269484032
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mytest(char const *recp, int reclen, char const *udata, int uleng) {
  (void)recp, (void)reclen, (void)udata, (void)uleng;
  assert(reclen > 0);
  int ret = 0;
  return !!ret;
}


x86 assembly (clang, -O0):
<mytest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mytest>:
push   %rax
xor    %edi,%edi
test   %esi,%esi
setg   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mytest(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %6
%15 = icmp sgt i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
store i32 0, i32* %9
%18 = load i32, i32* %9
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @mytest(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}
long int atol(const char *nptr) {
  long val = 0;
  while (*nptr) {
    val = val * 10 + (*nptr - '0');
    nptr++;
  }
  return val;
}


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <atol+0x47>
imul   $0xa,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <atol+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <atol+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%rax
movsbq %cl,%rcx
lea    (%rcx,%rax,2),%rax
add    $0xffffffffffffffd0,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atol+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul nsw i64 %6, 10
%9 = sext i8 %5 to i64
%10 = add i64 %8, -48
%11 = add i64 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %16
}
/* Variables and functions */
unsigned int x(unsigned int);
unsigned int h(unsigned int a, unsigned int b) { return x(a) | b; }


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

x86 assembly (clang, -O2):
<h>:
push   %rbx
mov    %esi,%ebx
call   1030 <x@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @h(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 = call i32 @x(i32 %5)
%7 = load i32, i32* %4
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @h(i32 %0, i32 %1) {
%3 = tail call i32 @x(i32 %0)
%4 = or i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "Usage: table_util\n"
                "  [-b number]   or --buckets    num buckets to adjust table\n"
                "  [-o file]     or --out-file   output filename\n"
                "  [-v]          or --verbose    verbose messages\n"
                "  file                          input table filename\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [229 x i8] c"Usage: table_util\0A [-b number] or --buckets num buckets to adjust table\0A [-o file] or --out-file output filename\0A [-v] or --verbose verbose messages\0A file input table filename\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [229 x i8] c"Usage: table_util\0A [-b number] or --buckets num buckets to adjust table\0A [-o file] or --out-file output filename\0A [-v] or --verbose verbose messages\0A file input table filename\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int getDecimalVal(char binary[]) {
  int decimal = 0, i;
  for (i = 0; binary[i] != '\0'; i++)
    decimal = (decimal << 1) + (binary[i] - '0');
  return decimal;
}


x86 assembly (clang, -O0):
<getDecimalVal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <getDecimalVal+0x53>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <getDecimalVal+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDecimalVal>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <getDecimalVal+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <getDecimalVal+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getDecimalVal(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = shl i32 %7, 1
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}