xunge/DecIR huggingface dataset:
void SetTrials(int *internal, int user) {
  if (user > 0 && user <= *internal) {
    *internal = user;
  } else {
  }
}


x86 assembly (clang, -O0):
<SetTrials>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1132 <SetTrials+0x32>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jg     1132 <SetTrials+0x32>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1137 <SetTrials+0x37>
jmp    1137 <SetTrials+0x37>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetTrials>:
test   %esi,%esi
jle    110a <SetTrials+0xa>
cmp    %esi,(%rdi)
jl     110a <SetTrials+0xa>
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @SetTrials(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* %0
%6 = icmp slt i32 %5, %1
br i1 %6, label %8, label %7
7: ; preds = %4
store i32 %1, i32* %0
br label %8
8: ; preds = %2, %4, %7
ret void
}
/* Variables and functions */
int spi(int, int /*<<< orphan*/);
int cmd_flush(int fd) {
  int timeout = 512;
  while ((spi(fd, 0) != 0xBB) && timeout)
    timeout--;
  return timeout;
}


x86 assembly (clang, -O0):
<cmd_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x200,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <spi@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xbb,%ecx
mov    %al,-0x9(%rbp)
je     1149 <cmd_flush+0x39>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1159 <cmd_flush+0x49>
jmp    1167 <cmd_flush+0x57>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <cmd_flush+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_flush>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x201,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <spi@plt>
mov    %eax,%ecx
lea    -0x1(%rbx),%eax
cmp    $0xbb,%ecx
je     113d <cmd_flush+0x2d>
cmp    $0x1,%ebx
mov    %eax,%ebx
jne    1120 <cmd_flush+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cmd_flush(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 512, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %2
%6 = call i32 @spi(i32 %5, i32 0)
%7 = icmp ne i32 %6, 187
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %8, %4
%12 = phi i1 [ false, %4 ], [ %10, %8 ]
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, -1
store i32 %15, i32* %3
br label %4
16: ; preds = %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @cmd_flush(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 512, %1 ], [ %8, %2 ]
%4 = tail call i32 @spi(i32 %0, i32 0)
%5 = icmp ne i32 %4, 187
%6 = icmp ne i32 %3, 0
%7 = select i1 %5, i1 %6, i1 false
%8 = add nsw i32 %3, -1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int max_phrase_length(char *);
char *max_phrase_length_01b() {
  char hex[] = "00020000000100030000";
  do {
    if (!(max_phrase_length(hex) == 59))
      return "return 59 (words plus spaces) for a hex string of 9 characters";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<max_phrase_length_01b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed7(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <max_phrase_length@plt>
cmp    $0x3b,%eax
je     1162 <max_phrase_length_01b+0x52>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <max_phrase_length_01b+0x5f>
jmp    1167 <max_phrase_length_01b+0x57>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_phrase_length_01b>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x30303030333030,%rax
mov    %rax,0xd(%rsp)
mov    %rsp,%rdi
call   1030 <max_phrase_length@plt>
xor    %ecx,%ecx
cmp    $0x3b,%eax
lea    0xed3(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.max_phrase_length_01b.hex = [21 x i8] c"00020000000100030000\00"
@.str = [63 x i8] c"return 59 (words plus spaces) for a hex string of 9 characters\00"
define i8* @max_phrase_length_01b() {
%1 = alloca i8*
%2 = alloca [21 x i8]
%3 = bitcast [21 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%6 = call i32 @max_phrase_length(i8* %5)
%7 = icmp eq i32 %6, 59
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.max_phrase_length_01b.hex = [21 x i8] c"00020000000100030000\00"
@.str = [63 x i8] c"return 59 (words plus spaces) for a hex string of 9 characters\00"
define i8* @max_phrase_length_01b() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 @max_phrase_length(i8* %2)
%4 = icmp eq i32 %3, 59
%5 = select i1 %4, i8* null, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
void *uDMAControlAlternateBaseGet(void) {
  return ((void *)(*((volatile unsigned long *)(0x400FF000 + 0x0000000C))));
}


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

x86 assembly (clang, -O2):
<uDMAControlAlternateBaseGet>:
mov    0x400ff00c,%rax
40
ret

LLVM IR (-O0):
define i8* @uDMAControlAlternateBaseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786316 to i64*)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @uDMAControlAlternateBaseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786316 to i64*)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x6b() {
  Assert_real((ispunct(107) == 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",
              540, ("ispunct should be 0 for k"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x6b>:
push   %rax
mov    $0x6b,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x21c,%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 = [26 x i8] c"ispunct should be 0 for k\00"
define void @t_ispunct_0x6b() {
%1 = call i64 @ispunct(i32 107)
%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 540, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"ispunct should be 0 for k\00"
define void @t_ispunct_0x6b() {
%1 = tail call i64 @ispunct(i32 107)
%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 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ test();
int main() {
  test();
  char c;
  scanf("%c", &c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <test@plt>
lea    0xeca(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test@plt>
lea    0xed1(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 (...) @test()
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (...) @test()
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(~1 == 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ b();
int main(void) {
  b();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @b()
ret i32 0
}
/* Type definitions */
struct bitree {
  int dummy;
};

/* Variables and functions */
int bitree_destroy(struct bitree *);
int bi_search_tree_destroy(struct bitree *b) { return bitree_destroy(b); }


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

x86 assembly (clang, -O2):
<bi_search_tree_destroy>:
jmp    1030 <bitree_destroy@plt>

LLVM IR (-O0):
%struct.bitree = type { i32 }
define i32 @bi_search_tree_destroy(%struct.bitree* %0) {
%2 = alloca %struct.bitree*
store %struct.bitree* %0, %struct.bitree** %2
%3 = load %struct.bitree*, %struct.bitree** %2
%4 = call i32 @bitree_destroy(%struct.bitree* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.bitree = type { i32 }
define i32 @bi_search_tree_destroy(%struct.bitree* %0) {
%2 = tail call i32 @bitree_destroy(%struct.bitree* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int x) { printf("old print: %d\n", x); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"old print: %d\0A\00"
define void @print(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int core4_swap(char *, int);
int U_EMRRECTANGLE_swap(char *record, int torev) {
  return (core4_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRRECTANGLE_swap>:
jmp    1030 <core4_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRRECTANGLE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isblank(char);
int main(void) { return !isblank(' ') || !isblank('\t') || isblank('_'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x20,%edi
call   1030 <isblank@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     116b <main+0x5b>
mov    $0x9,%edi
call   1030 <isblank@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     116b <main+0x5b>
mov    $0x5f,%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x20,%edi
call   1030 <isblank@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     1146 <main+0x36>
mov    $0x9,%edi
call   1030 <isblank@plt>
test   %rax,%rax
je     1146 <main+0x36>
mov    $0x5f,%edi
call   1030 <isblank@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @isblank(i8 signext 32)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = call i64 @isblank(i8 signext 9)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = call i64 @isblank(i8 signext 95)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %7, %4, %0
%11 = phi i1 [ true, %4 ], [ true, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @isblank(i8 signext 32)
%2 = icmp eq i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 @isblank(i8 signext 9)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @isblank(i8 signext 95)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %3 ], [ 1, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ signed_range(int, int);
int /*<<< orphan*/ wr3_1(int /*<<< orphan*/, int, void *);
void test_wr3_1(void) {
  {
    void *null = 0;
    void *p = &null;
    wr3_1(signed_range((0), (1)), 0, null);
    wr3_1(signed_range((1), (1)), 0, p);
  }
  void *null = 0;
  wr3_1(signed_range((1), (2)), 1, null);
}


x86 assembly (clang, -O0):
<test_wr3_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <signed_range@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <wr3_1@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <signed_range@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <wr3_1@plt>
movq   $0x0,-0x18(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <signed_range@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rdx
mov    $0x1,%esi
call   1030 <wr3_1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_wr3_1>:
push   %rax
movq   $0x0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <signed_range@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <wr3_1@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <signed_range@plt>
mov    %rsp,%rdx
mov    %eax,%edi
xor    %esi,%esi
call   1030 <wr3_1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <signed_range@plt>
mov    %eax,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wr3_1@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_wr3_1() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
store i8* null, i8** %1
%4 = bitcast i8** %1 to i8*
store i8* %4, i8** %2
%5 = call i32 @signed_range(i32 0, i32 1)
%6 = load i8*, i8** %1
%7 = call i32 @wr3_1(i32 %5, i32 0, i8* %6)
%8 = call i32 @signed_range(i32 1, i32 1)
%9 = load i8*, i8** %2
%10 = call i32 @wr3_1(i32 %8, i32 0, i8* %9)
store i8* null, i8** %3
%11 = call i32 @signed_range(i32 1, i32 2)
%12 = load i8*, i8** %3
%13 = call i32 @wr3_1(i32 %11, i32 1, i8* %12)
ret void
}

LLVM IR (-O2):
define void @test_wr3_1() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = tail call i32 @signed_range(i32 0, i32 1)
%4 = tail call i32 @wr3_1(i32 %3, i32 0, i8* null)
%5 = tail call i32 @signed_range(i32 1, i32 1)
%6 = call i32 @wr3_1(i32 %5, i32 0, i8* %2)
%7 = call i32 @signed_range(i32 1, i32 2)
%8 = call i32 @wr3_1(i32 %7, i32 1, i8* null)
ret void
}
int division_of_zero_Good(int x) {
  int i = 4 * x;
  i /= 2;
  i /= 2;
  return i;
}


x86 assembly (clang, -O0):
<division_of_zero_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @division_of_zero_Good(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 4, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @division_of_zero_Good(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct program {
  int dummy;
};
struct action {
  int dummy;
};

/* Variables and functions */
struct action **action_pointer(struct program *, char *);
struct action *prog_action(struct program *prog, char *name) {
  struct action **ptr = action_pointer(prog, name);
  return (ptr) ? *ptr : NULL;
}


x86 assembly (clang, -O0):
<prog_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <action_pointer@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <prog_action+0x3c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1157 <prog_action+0x47>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1157 <prog_action+0x47>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_action>:
push   %rax
call   1030 <action_pointer@plt>
test   %rax,%rax
je     1120 <prog_action+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.action = type { i32 }
%struct.program = type { i32 }
define %struct.action* @prog_action(%struct.program* %0, i8* %1) {
%3 = alloca %struct.program*
%4 = alloca i8*
%5 = alloca %struct.action**
store %struct.program* %0, %struct.program** %3
store i8* %1, i8** %4
%6 = load %struct.program*, %struct.program** %3
%7 = load i8*, i8** %4
%8 = call %struct.action** @action_pointer(%struct.program* %6, i8* %7)
store %struct.action** %8, %struct.action*** %5
%9 = load %struct.action**, %struct.action*** %5
%10 = icmp ne %struct.action** %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load %struct.action**, %struct.action*** %5
%13 = load %struct.action*, %struct.action** %12
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %11
%16 = phi %struct.action* [ %13, %11 ], [ null, %14 ]
ret %struct.action* %16
}

LLVM IR (-O2):
%struct.action = type { i32 }
%struct.program = type { i32 }
define %struct.action* @prog_action(%struct.program* %0, i8* %1) {
%3 = tail call %struct.action** @action_pointer(%struct.program* %0, i8* %1)
%4 = icmp eq %struct.action** %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = load %struct.action*, %struct.action** %3
br label %7
7: ; preds = %2, %5
%8 = phi %struct.action* [ %6, %5 ], [ null, %2 ]
ret %struct.action* %8
}
/* Variables and functions */
int isalpha(int);
int sim_isalpha(int c) { return ((c < 0) || (c >= 128)) ? 0 : isalpha(c); }


x86 assembly (clang, -O0):
<sim_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1132 <sim_isalpha+0x22>
cmpl   $0x80,-0x4(%rbp)
jl     113c <sim_isalpha+0x2c>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <sim_isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_isalpha>:
cmp    $0x7f,%edi
jbe    1118 <sim_isalpha+0x8>
xor    %eax,%eax
ret
jmp    1030 <isalpha@plt>

LLVM IR (-O0):
define i32 @sim_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 128
br i1 %7, label %8, label %9
8: ; preds = %5, %1
br label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = call i32 @isalpha(i32 %10)
br label %12
12: ; preds = %9, %8
%13 = phi i32 [ 0, %8 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @sim_isalpha(i32 %0) {
%2 = icmp ugt i32 %0, 127
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @isalpha(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void av_timecode_check_frame_rate() {}


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

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

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

LLVM IR (-O2):
define void @av_timecode_check_frame_rate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x03() {
  Assert_real((ispunct(3) == 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",
              20, ("ispunct should be 0 for 0x03"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x03>:
push   %rax
mov    $0x3,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14,%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 0x03\00"
define void @t_ispunct_0x03() {
%1 = call i64 @ispunct(i32 3)
%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 20, 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 0x03\00"
define void @t_ispunct_0x03() {
%1 = tail call i64 @ispunct(i32 3)
%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 20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int open(char const *, int);
int my_open(const char *I_pszFilename, int I_iFlags) {
  int iFd = -1;
  iFd = open(I_pszFilename, I_iFlags);
  return iFd;
}


x86 assembly (clang, -O0):
<my_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <open@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @my_open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isspace(char);
char *delete_whitespace(char *text) {
  while (isspace(*text) && *text != '\0')
    text++;
  return text;
}


x86 assembly (clang, -O0):
<delete_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     114a <delete_whitespace+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115a <delete_whitespace+0x4a>
jmp    116b <delete_whitespace+0x5b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <delete_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_whitespace>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <delete_whitespace+0x29>
cmpb   $0x0,(%rbx)
je     1139 <delete_whitespace+0x29>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <delete_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @delete_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %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 %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @delete_whitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isspace(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = tail call i64 @isspace(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
%15 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %5 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ command;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ stdout;
void textstyle(int attr) {
  char command[13];
  snprintf(command, sizeof(command), "\033[%im", attr);
  fprintf(stdout, "%s", command);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<textstyle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x11(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0xd,%esi
lea    0xeb2(%rip),%rdx
call   1030 <snprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    -0x11(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textstyle>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ecx
lea    0xec0(%rip),%rdx
lea    0xb(%rsp),%r14
mov    %r14,%rdi
mov    $0xd,%esi
call   1030 <snprintf@plt>
mov    0x2e87(%rip),%rbx
mov    (%rbx),%edi
lea    0xea4(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%im\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @textstyle(i32 %0) {
%2 = alloca i32
%3 = alloca [13 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%im\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @textstyle(i32 %0) {
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}
int bin8_to_32(unsigned char *a) {
  return ((a[0] << 24) + (a[1] << 16) + (a[2] << 8) + a[3]);
}


x86 assembly (clang, -O0):
<bin8_to_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin8_to_32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @bin8_to_32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = add nsw i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @bin8_to_32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ gsc_styled_char(int /*<<< orphan*/, char);
void gsc_normal_char(char c) { gsc_styled_char((0), c); }


x86 assembly (clang, -O0):
<gsc_normal_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movsbl -0x1(%rbp),%esi
call   1030 <gsc_styled_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsc_normal_char>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <gsc_styled_char@plt>

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

LLVM IR (-O2):
define void @gsc_normal_char(i8 signext %0) {
%2 = tail call i32 @gsc_styled_char(i32 0, i8 signext %0)
ret void
}
float ceilf(float x) {
  long r;
  r = x;
  if (r < 0)
    return r;
  else
    return (r + ((r < x) ? 1 : 0));
}


x86 assembly (clang, -O0):
<ceilf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    112e <ceilf+0x2e>
cvtsi2ssq -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115a <ceilf+0x5a>
mov    -0x10(%rbp),%rax
cvtsi2ssq -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
xor    %ecx,%ecx
mov    $0x1,%edx
ucomiss %xmm1,%xmm0
cmova  %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilf>:
cvttss2si %xmm0,%rax
cvtsi2ss %rax,%xmm1
test   %rax,%rax
setns  %cl
ucomiss %xmm1,%xmm0
seta   %dl
and    %cl,%dl
movzbl %dl,%ecx
add    %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2ss %rcx,%xmm0
ret

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

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = fptosi float %0 to i64
%3 = icmp sgt i64 %2, -1
%4 = sitofp i64 %2 to float
%5 = fcmp olt float %4, %0
%6 = and i1 %3, %5
%7 = zext i1 %6 to i64
%8 = add nsw i64 %7, %2
%9 = sitofp i64 %8 to float
ret float %9
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int t_clear() { return fputs("[2J", stdout); }


x86 assembly (clang, -O0):
<t_clear>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_clear>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@stdout = global i32 0
define i32 @t_clear() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@stdout = global i32 0
define i32 @t_clear() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void c_unlink_(char *path, int plen) { unlink(path); }


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

x86 assembly (clang, -O2):
<c_unlink_>:
jmp    1030 <unlink@plt>

LLVM IR (-O0):
define void @c_unlink_(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @unlink(i8* %5)
ret void
}

LLVM IR (-O2):
define void @c_unlink_(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @unlink(i8* %0)
ret void
}
void synch_tsc(void) {
  asm volatile("cpuid" : : : "%rax", "%rbx", "%rcx", "%rdx");
}


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

x86 assembly (clang, -O2):
<synch_tsc>:
push   %rbx
cpuid
pop    %rbx
ret

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

LLVM IR (-O2):
define void @synch_tsc() {
tail call void asm sideeffect "cpuid", "~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
scalar_t__ isprint(char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage();
void unknown_opt(char opt) {
  if (isprint(opt))
    fprintf(stderr, "Unknown option `-%c'.\n", opt);
  else
    fprintf(stderr, "Unknown option character `\\x%x'.\n", opt);
  usage();
}


x86 assembly (clang, -O0):
<unknown_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     116f <unknown_opt+0x3f>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
jmp    1188 <unknown_opt+0x58>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <usage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown_opt>:
push   %rbx
mov    %edi,%ebx
call   1050 <isprint@plt>
test   %rax,%rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rax
lea    0xeae(%rip),%rsi
cmove  %rax,%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <usage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.1 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
define void @unknown_opt(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isprint(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i8, i8* %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext %8)
br label %14
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8, i8* %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8 signext %12)
br label %14
14: ; preds = %10, %6
%15 = call i32 (...) @usage()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.1 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
define void @unknown_opt(i8 signext %0) {
%2 = tail call i64 @isprint(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @stderr
%5 = select i1 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @fprintf(i32 %4, i8* %5, i8 signext %0)
%7 = tail call i32 (...) @usage()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, ...);
void actions() {
  printf(
      "\n\n\n\n\n\nPress %s to enter SETUP  ; press %s to enter FISH utility\n",
      "DEL", "Alt-F2");
  printf("%s\n", "14/12/2009-Plytrn-PPP-2.0");
}


x86 assembly (clang, -O0):
<actions>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf1f(%rip),%rsi
lea    0xf1c(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
lea    0xf12(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<actions>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf22(%rip),%rsi
lea    0xf1f(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
lea    0xf15(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"\0A\0A\0A\0A\0A\0APress %s to enter SETUP ; press %s to enter FISH utility\0A\00"
@.str.1 = [4 x i8] c"DEL\00"
@.str.2 = [7 x i8] c"Alt-F2\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [26 x i8] c"14/12/2009-Plytrn-PPP-2.0\00"
define void @actions() {
%1 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"\0A\0A\0A\0A\0A\0APress %s to enter SETUP ; press %s to enter FISH utility\0A\00"
@.str.1 = [4 x i8] c"DEL\00"
@.str.2 = [7 x i8] c"Alt-F2\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [26 x i8] c"14/12/2009-Plytrn-PPP-2.0\00"
define void @actions() {
%1 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bswap32(uint32_t u32) {
  return (((u32 & 0xff) << 24) | ((u32 & 0xff00) << 8) |
          ((u32 & 0xff0000) >> 8) | ((u32 & 0xff000000) >> 24));
}


x86 assembly (clang, -O0):
<bswap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @bswap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ld_mem_n();
void opcode_36() { ld_mem_n(); }


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

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

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

LLVM IR (-O2):
define void @opcode_36() {
%1 = tail call i32 (...) @ld_mem_n()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endclosedline();
void endclo_() { endclosedline(); }


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

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

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

LLVM IR (-O2):
define void @endclo_() {
%1 = tail call i32 (...) @endclosedline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void version(void) {
  printf(" CMatrix version %s by Chris Allegretta (compiled %s, %s)\n",
         "0.15.2 (beta)", "22:40:40", "Mar 17 2022");
  printf(" Email: cmatrix@asty.org  Web: http://www.asty.org/cmatrix\n");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf19(%rip),%rsi
lea    0xf20(%rip),%rdx
lea    0xf22(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf0c(%rip),%rsi
lea    0xf13(%rip),%rdx
lea    0xf15(%rip),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf13(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [59 x i8] c" CMatrix version %s by Chris Allegretta (compiled %s, %s)\0A\00"
@.str.1 = [14 x i8] c"0.15.2 (beta)\00"
@.str.2 = [9 x i8] c"22:40:40\00"
@.str.3 = [12 x i8] c"Mar 17 2022\00"
@.str.4 = [60 x i8] c" Email: cmatrix@asty.org Web: http://www.asty.org/cmatrix\0A\00"
define void @version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c" CMatrix version %s by Chris Allegretta (compiled %s, %s)\0A\00"
@.str.1 = [14 x i8] c"0.15.2 (beta)\00"
@.str.2 = [9 x i8] c"22:40:40\00"
@.str.3 = [12 x i8] c"Mar 17 2022\00"
@str = [59 x i8] c" Email: cmatrix@asty.org Web: http://www.asty.org/cmatrix\00"
define void @version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}