xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ perror(char *);
FILE *safe_fopen(const char *path, const char *mode) {
  FILE *fp = fopen(path, mode);
  if (fp == NULL) {
    perror("safe_fopen - Failed to open file.");
    exit(EXIT_FAILURE);
  }
  return fp;
}


x86 assembly (clang, -O0):
<safe_fopen>:
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 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <safe_fopen+0x46>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fopen>:
push   %rax
call   1030 <fopen@plt>
test   %rax,%rax
je     113d <safe_fopen+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"safe_fopen - Failed to open file.\00"
@EXIT_FAILURE = global i32 0
define i32* @safe_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@.str = [34 x i8] c"safe_fopen - Failed to open file.\00"
@EXIT_FAILURE = global i32 0
define noalias i32* @safe_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i32* %3
}
int convert_to_int(unsigned char instr[]) {
  int i = 0;
  int res = 0;
  while (instr[i] != '\0') {
    res = res * 10;
    res += instr[i] - 48;
    i++;
  }
  return res;
}


x86 assembly (clang, -O0):
<convert_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1155 <convert_to_int+0x55>
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <convert_to_int+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @convert_to_int(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 = zext i8 %6 to i32
%9 = mul nsw i32 %7, 10
%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
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned long);
void *threadmain(void *dummy) {
  sleep((unsigned long)dummy);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @threadmain(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 @sleep(i64 %4)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @threadmain(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @sleep(i64 %2)
ret i8* null
}
int add(int a, int b) {
  int c = 0;
  c = a + b;
  return c;
}


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, unsigned char, int);
void put_pixel(int x, int y, unsigned char Col, unsigned char *Where) {
  memset(Where + (x + (y * 320)), Col, 1);
}


x86 assembly (clang, -O0):
<put_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%eax
imul   $0x140,-0x8(%rbp),%ecx
add    %ecx,%eax
cltq
add    %rax,%rdi
mov    -0x9(%rbp),%al
movzbl %al,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_pixel>:
lea    (%rsi,%rsi,4),%eax
shl    $0x6,%eax
add    %edi,%eax
movslq %eax,%rdi
add    %rcx,%rdi
mov    %edx,%esi
mov    $0x1,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @put_pixel(i32 %0, i32 %1, i8 zeroext %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = mul nsw i32 %11, 320
%13 = add nsw i32 %10, %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %9, i64 %14
%16 = load i8, i8* %7
%17 = call i32 @memset(i8* %15, i8 zeroext %16, i32 1)
ret void
}

LLVM IR (-O2):
define void @put_pixel(i32 %0, i32 %1, i8 zeroext %2, i8* %3) {
%5 = mul nsw i32 %1, 320
%6 = add nsw i32 %5, %0
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = tail call i32 @memset(i8* %8, i8 zeroext %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void comdFree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<comdFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @comdFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_storel_pd(void *, int /*<<< orphan*/);
void test_storel_pd(__m128d x, void *y) { _mm_storel_pd(y, x); }


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

x86 assembly (clang, -O2):
<test_storel_pd>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <_mm_storel_pd@plt>

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

LLVM IR (-O2):
define void @test_storel_pd(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_storel_pd(i8* %1, i32 %0)
ret void
}
void outb(short port, char value) {
  __asm__ volatile("outb %1, %0" : : "dN"(port), "a"((unsigned char)value));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i16 signext %0, i8 signext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @outb(i16 signext %0, i8 signext %1) {
tail call void asm sideeffect "outb $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("\nHello from 390.\nSee you, bye..."); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"\0AHello from 390.\0ASee you, bye...\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0AHello from 390.\0ASee you, bye...\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const, char const);
void hex(char c) {
  static const char hexchars[] = "0123456789abcdef";
  printf("%c%c", hexchars[(c >> 4) & 0xf], hexchars[c & 0xf]);
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xece(%rip),%rax
mov    (%rax,%rcx,1),%dl
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xecb(%rip),%rdi
lea    0xeb3(%rip),%rax
movsbl %dl,%esi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
movzbl %dil,%eax
shr    $0x4,%rax
lea    0xee1(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
and    $0xf,%edi
movsbl (%rdi,%rcx,1),%edx
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@hex.hexchars = internal constant [17 x i8] c"0123456789abcdef\00"
@.str = [5 x i8] c"%c%c\00"
define void @hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @hex.hexchars, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = and i32 %11, 15
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [17 x i8], [17 x i8]* @hex.hexchars, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %9, i8 signext %15)
ret void
}

LLVM IR (-O2):
@hex.hexchars = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
@.str = [5 x i8] c"%c%c\00"
define void @hex(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 4
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @hex.hexchars, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = and i32 %2, 15
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [17 x i8], [17 x i8]* @hex.hexchars, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %10)
ret void
}
void ASN1_NULL_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_NULL_new() {
ret void
}
unsigned char baddu3(unsigned char a, unsigned char b) {
  unsigned char c = a + b;
  return c + 1;
}


x86 assembly (clang, -O0):
<baddu3>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
add    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baddu3>:
lea    (%rdi,%rsi,1),%eax
add    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @baddu3(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, 1
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @baddu3(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %0, 1
%4 = add i8 %3, %1
ret i8 %4
}
/* Variables and functions */
int clashnumber(int *, int);
void fillcourses(int **conflictmatrix, int *sortedmatrix, int courses) {
  int i;
  for (i = 0; i < courses; i++) {
    sortedmatrix[i] = clashnumber(conflictmatrix[i], courses);
  }
}


x86 assembly (clang, -O0):
<fillcourses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1165 <fillcourses+0x55>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x14(%rbp),%esi
call   1030 <clashnumber@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <fillcourses+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillcourses>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edx,%edx
jle    1149 <fillcourses+0x39>
mov    %edx,%r12d
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    (%r15,%rbp,8),%rdi
mov    %r12d,%esi
call   1030 <clashnumber@plt>
mov    %eax,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <fillcourses+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fillcourses(i32** nocapture %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i32*, i32** %0, i64 %8
%10 = load i32*, i32** %9
%11 = tail call i32 @clashnumber(i32* %10, i32 %2)
%12 = getelementptr inbounds i32, i32* %1, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
int test_03(int a, int b, int c, int d) { return a - (c == d); }


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
cmp    -0x10(%rbp),%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
mov    %edi,%eax
xor    %esi,%esi
cmp    %ecx,%edx
sete   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @test_03(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
%14 = sub nsw i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_03(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
%6 = sext i1 %5 to i32
%7 = add i32 %6, %0
ret i32 %7
}
/* Variables and functions */
long posrelat(long pos, size_t len) {
  return (pos >= 0) ? pos : (long)len + pos + 1;
}


x86 assembly (clang, -O0):
<posrelat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1124 <posrelat+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <posrelat+0x34>
mov    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posrelat>:
test   %rdi,%rdi
lea    0x1(%rdi,%rsi,1),%rax
cmovns %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @posrelat(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, -1
%4 = add i64 %0, 1
%5 = add i64 %4, %1
%6 = select i1 %3, i64 %0, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ memmove(int *, int *, int);
void memmove_bad2() {
  int arr1[10];
  int arr2[20];
  memmove(arr2, arr1, 44);
}


x86 assembly (clang, -O0):
<memmove_bad2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2c,%edx
call   1030 <memmove@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove_bad2>:
sub    $0x88,%rsp
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x2c,%edx
call   1030 <memmove@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @memmove_bad2() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @memmove(i32* %3, i32* %4, i32 44)
ret void
}

LLVM IR (-O2):
define void @memmove_bad2() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @memmove(i32* %5, i32* %6, i32 44)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: test_stddir [<path> ...]\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 = [33 x i8] c"Usage: test_stddir [<path> ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: test_stddir [<path> ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ customSerial_Read(int, unsigned char *, int *, int);
void Serial_Read_Arduino(int port, unsigned char outData[], int *outStatus,
                         int receiveBufferLength) {
  customSerial_Read(port, outData, outStatus, receiveBufferLength);
}


x86 assembly (clang, -O0):
<Serial_Read_Arduino>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <customSerial_Read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Serial_Read_Arduino>:
jmp    1030 <customSerial_Read@plt>

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

LLVM IR (-O2):
define void @Serial_Read_Arduino(i32 %0, i8* %1, i32* %2, i32 %3) {
%5 = tail call i32 @customSerial_Read(i32 %0, i8* %1, i32* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __test_print_failed(char const *, int const, char const *,
                                       char const *);
int /*<<< orphan*/ __test_print_passed(char const *);
void test_scalar_equal(const char *file, const int line, const char *func,
                       const char *name, float s, float t) {
  if (s != t) {
    __test_print_failed(file, line, func, name);
  } else {
    __test_print_passed(name);
  }
}


x86 assembly (clang, -O0):
<test_scalar_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
movss  %xmm1,-0x28(%rbp)
movss  -0x24(%rbp),%xmm0
ucomiss -0x28(%rbp),%xmm0
jne    115b <test_scalar_equal+0x3b>
jp     115b <test_scalar_equal+0x3b>
jmp    1174 <test_scalar_equal+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <__test_print_failed@plt>
jmp    117d <test_scalar_equal+0x5d>
mov    -0x20(%rbp),%rdi
call   1030 <__test_print_passed@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scalar_equal>:
ucomiss %xmm1,%xmm0
jne    1127 <test_scalar_equal+0x7>
jnp    112c <test_scalar_equal+0xc>
jmp    1040 <__test_print_failed@plt>
mov    %rcx,%rdi
jmp    1030 <__test_print_passed@plt>

LLVM IR (-O0):
define void @test_scalar_equal(i8* %0, i32 %1, i8* %2, i8* %3, float %4, float %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca float
%12 = alloca float
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %11
%14 = load float, float* %12
%15 = fcmp une float %13, %14
br i1 %15, label %16, label %22
16: ; preds = %6
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = load i8*, i8** %9
%20 = load i8*, i8** %10
%21 = call i32 @__test_print_failed(i8* %17, i32 %18, i8* %19, i8* %20)
br label %25
22: ; preds = %6
%23 = load i8*, i8** %10
%24 = call i32 @__test_print_passed(i8* %23)
br label %25
25: ; preds = %22, %16
ret void
}

LLVM IR (-O2):
define void @test_scalar_equal(i8* %0, i32 %1, i8* %2, i8* %3, float %4, float %5) {
%7 = fcmp une float %4, %5
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @__test_print_failed(i8* %0, i32 %1, i8* %2, i8* %3)
br label %12
10: ; preds = %6
%11 = tail call i32 @__test_print_passed(i8* %3)
br label %12
12: ; preds = %10, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func();
int main(int argc, char **argv) {
  func();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @func()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
ret i32 0
}
int Ten90CprMod(int a, int b) {
  int res = a % b;
  if (res < 0) {
    res += b;
  }
  return res;
}


x86 assembly (clang, -O0):
<Ten90CprMod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1127 <Ten90CprMod+0x27>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ten90CprMod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Ten90CprMod(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
%8 = srem i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = add nsw i32 %13, %12
store i32 %14, i32* %5
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @Ten90CprMod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
int foo(int u[10]) { return u[8]; }


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

x86 assembly (clang, -O2):
<foo>:
mov    0x20(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vprintf(char const *const, int /*<<< orphan*/);
__attribute__((__unused__)) int(cheat_unwrapped_vprintf)(
    char const *const format, va_list list) {
  return vprintf(format, list);
}


x86 assembly (clang, -O0):
<cheat_unwrapped_vprintf>:
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 <vprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheat_unwrapped_vprintf>:
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define i32 @cheat_unwrapped_vprintf(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 @vprintf(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cheat_unwrapped_vprintf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_sink_mute_by_index() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_sink_mute_by_index"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [50 x i8] c"NOT IMPLEMENTED:pa_context_set_sink_mute_by_index\00"
define i32 @pa_context_set_sink_mute_by_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int strlen(char *);
char *append(char *dst, const char *src) {
  (void)strcat(dst, src);
  return (dst + strlen(dst));
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @append(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcat(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
ret i8* %12
}

LLVM IR (-O2):
define i8* @append(i8* %0, i8* %1) {
%3 = tail call i32 @strcat(i8* %0, i8* %1)
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
int hwlist_lcd_size(const char *value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hwlist_lcd_size(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xa0() {
  Assert_real((isgraph(160) == 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_isgraph.c",
              805, ("isgraph should be 0 for 0xa0"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xa0>:
push   %rax
mov    $0xa0,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x325,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xa0\00"
define void @t_isgraph_0xa0() {
%1 = call i64 @isgraph(i32 160)
%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 805, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xa0\00"
define void @t_isgraph_0xa0() {
%1 = tail call i64 @isgraph(i32 160)
%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 805, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x9c() {
  Assert_real((isascii(156) == 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_isascii.c",
              785, ("isascii should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x311,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x9c\00"
define void @t_isascii_0x9c() {
%1 = call i64 @isascii(i32 156)
%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 785, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x9c\00"
define void @t_isascii_0x9c() {
%1 = tail call i64 @isascii(i32 156)
%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 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo(const int a) {}


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
void epdc_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @epdc_iomux_config() {
ret void
}
/* Variables and functions */
int getLimit();
int init();
void main(void) {
  int cnt = init();
  while (cnt < getLimit()) {
    cnt++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <init@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getLimit@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jge    115a <main+0x3a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <main+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <init@plt>
mov    %eax,%ebx
add    $0xffffffff,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1030 <getLimit@plt>
add    $0x1,%ebx
cmp    %eax,%ebx
jl     1130 <main+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @init()
store i32 %2, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = call i32 (...) @getLimit()
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init()
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ %1, %0 ], [ %6, %2 ]
%4 = tail call i32 (...) @getLimit()
%5 = icmp slt i32 %3, %4
%6 = add nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret void
}
_Noreturn void exit(int code) {
  __funcs_on_exit();
  __libc_exit_fini();
  __stdio_exit();
  _Exit(code);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <__funcs_on_exit@plt>
mov    $0x0,%al
call   1030 <__libc_exit_fini@plt>
mov    $0x0,%al
call   1040 <__stdio_exit@plt>
mov    -0x4(%rbp),%edi
call   1050 <_Exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <__funcs_on_exit@plt>
xor    %eax,%eax
call   1030 <__libc_exit_fini@plt>
xor    %eax,%eax
call   1040 <__stdio_exit@plt>
mov    %ebx,%edi
call   1050 <_Exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__funcs_on_exit()
%4 = call i32 (...) @__libc_exit_fini()
%5 = call i32 (...) @__stdio_exit()
%6 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @__funcs_on_exit()
%3 = tail call i32 (...) @__libc_exit_fini()
%4 = tail call i32 (...) @__stdio_exit()
tail call void @_Exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __wasm_call_ctors();
__attribute__((export_name("_initialize"))) void _initialize(void) {
  __wasm_call_ctors();
}


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

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

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

LLVM IR (-O2):
define void @_initialize() {
%1 = tail call i32 (...) @__wasm_call_ctors()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_port(int, int);
void irq_remap(void) {
  write_port(0x20, 0x11);
  write_port(0xA0, 0x11);
  write_port(0x21, 0x20);
  write_port(0xA1, 0x28);
  write_port(0x21, 0x04);
  write_port(0xA1, 0x02);
  write_port(0x21, 0x01);
  write_port(0xA1, 0x01);
  write_port(0x21, 0x0);
  write_port(0xA1, 0x0);
}


x86 assembly (clang, -O0):
<irq_remap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <write_port@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <write_port@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <write_port@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <write_port@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <write_port@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <write_port@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <write_port@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <write_port@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <write_port@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <write_port@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_remap>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <write_port@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <write_port@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <write_port@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <write_port@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <write_port@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <write_port@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <write_port@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <write_port@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <write_port@plt>
mov    $0xa1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <write_port@plt>

LLVM IR (-O0):
define void @irq_remap() {
%1 = call i32 @write_port(i32 32, i32 17)
%2 = call i32 @write_port(i32 160, i32 17)
%3 = call i32 @write_port(i32 33, i32 32)
%4 = call i32 @write_port(i32 161, i32 40)
%5 = call i32 @write_port(i32 33, i32 4)
%6 = call i32 @write_port(i32 161, i32 2)
%7 = call i32 @write_port(i32 33, i32 1)
%8 = call i32 @write_port(i32 161, i32 1)
%9 = call i32 @write_port(i32 33, i32 0)
%10 = call i32 @write_port(i32 161, i32 0)
ret void
}

LLVM IR (-O2):
define void @irq_remap() {
%1 = tail call i32 @write_port(i32 32, i32 17)
%2 = tail call i32 @write_port(i32 160, i32 17)
%3 = tail call i32 @write_port(i32 33, i32 32)
%4 = tail call i32 @write_port(i32 161, i32 40)
%5 = tail call i32 @write_port(i32 33, i32 4)
%6 = tail call i32 @write_port(i32 161, i32 2)
%7 = tail call i32 @write_port(i32 33, i32 1)
%8 = tail call i32 @write_port(i32 161, i32 1)
%9 = tail call i32 @write_port(i32 33, i32 0)
%10 = tail call i32 @write_port(i32 161, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G130_f(char *s) {
  debug("G130_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G130_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G130_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"G130_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G130_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"G130_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G130_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int bit_OERR(unsigned char reg_value) { return (reg_value & 0x04) == 0x04; }


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

x86 assembly (clang, -O2):
<bit_OERR>:
shr    $0x2,%dil
and    $0x1,%dil
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @bit_OERR(i8 zeroext %0) {
%2 = lshr i8 %0, 2
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
int test_imm_51int64_lowword_reg(long long val) {
  return ((val) & (0x51 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_51int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 81
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int format_stacktrace(char *buffer, int bufsize) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @format_stacktrace(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer_name;

/* Variables and functions */
int /*<<< orphan*/ TRACE__register_buffer(char *);
int /*<<< orphan*/ get_exec_name(char *, int);
void TRACE__init(void) {
  char buffer_name[512];
  get_exec_name(buffer_name, sizeof(buffer_name));
  TRACE__register_buffer(buffer_name);
}


x86 assembly (clang, -O0):
<TRACE__init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x200(%rbp),%rdi
mov    $0x200,%esi
call   1030 <get_exec_name@plt>
lea    -0x200(%rbp),%rdi
call   1040 <TRACE__register_buffer@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TRACE__init>:
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1030 <get_exec_name@plt>
mov    %rbx,%rdi
call   1040 <TRACE__register_buffer@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @TRACE__init() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_exec_name(i8* %2, i32 512)
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = call i32 @TRACE__register_buffer(i8* %4)
ret void
}

LLVM IR (-O2):
define void @TRACE__init() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_exec_name(i8* %2, i32 512)
%4 = call i32 @TRACE__register_buffer(i8* %2)
ret void
}