xunge/DecIR huggingface dataset:
char *Strcpy1(char *t, char *s) {
  int i = 0;
  while (*(t + i) = *(s + i))
    i++;
  return t;
}


x86 assembly (clang, -O0):
<Strcpy1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
cmp    $0x0,%al
je     113f <Strcpy1+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <Strcpy1+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strcpy1>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <Strcpy1+0x10>
ret

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

LLVM IR (-O2):
define i8* @Strcpy1(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void rangechars2INT(int i) {}


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

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

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

LLVM IR (-O2):
define void @rangechars2INT(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void check_free(void *ptr) {
  if (ptr != NULL) {
    free(ptr);
  }
  return;
}


x86 assembly (clang, -O0):
<check_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <check_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @check_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DriveReg2_RestoreConfig();
void DriveReg2_Wakeup(void) { DriveReg2_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @DriveReg2_Wakeup() {
%1 = tail call i32 (...) @DriveReg2_RestoreConfig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int fibo1(int);
int main() {
  int x = 5;
  int result = fibo1(x);
  if (result != 5) {
    __VERIFIER_error();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fibo1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
je     1152 <main+0x32>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <fibo1@plt>
cmp    $0x5,%eax
je     1137 <main+0x17>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fibo1(i32 5)
%2 = icmp eq i32 %1, 5
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
zddsmartopen(unit) int unit;
{ return (zddopen_func(unit, 1)); }


x86 assembly (clang, -O0):
<zddsmartopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <zddopen_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zddsmartopen>:
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <zddopen_func@plt>

LLVM IR (-O0):
define i32 @zddsmartopen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @zddopen_func to i32 (i32, i32, ...)*)(i32 %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @zddsmartopen(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @zddopen_func to i32 (i32, i32, ...)*)(i32 %0, i32 1)
ret i32 %2
}
char f(int a, int b) { return a - b % b; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    %edx,%eax
movsbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @f(i32 %0, i32 %1) {
%3 = trunc i32 %0 to i8
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ srand(double);
void srand48(double seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<srand48>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @srand48(double %0) {
%2 = tail call i32 @srand(double %0)
ret void
}
/* Variables and functions */
unsigned char SPIReceive();
int /*<<< orphan*/ SPITransmit(unsigned char);
unsigned char SPITransceive(unsigned char data) {
  SPITransmit(data);
  return SPIReceive();
}


x86 assembly (clang, -O0):
<SPITransceive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <SPITransmit@plt>
mov    $0x0,%al
call   1030 <SPIReceive@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPITransceive>:
push   %rax
call   1040 <SPITransmit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SPIReceive@plt>

LLVM IR (-O0):
define zeroext i8 @SPITransceive(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @SPITransmit(i8 zeroext %3)
%5 = call zeroext i8 (...) @SPIReceive()
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @SPITransceive(i8 zeroext %0) {
%2 = tail call i32 @SPITransmit(i8 zeroext %0)
%3 = tail call zeroext i8 (...) @SPIReceive()
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fs_close(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fs_open(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
size_t fs_size(char *path) {
  size_t size;
  FILE *file = fs_open(path, "r");
  fseek(file, 0, SEEK_END);
  size = ftell(file);
  fs_close(file);
  return size;
}


x86 assembly (clang, -O0):
<fs_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <fs_open@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1050 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fs_close@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_size>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rsi
call   1030 <fs_open@plt>
mov    %rax,%rbx
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <fseek@plt>
mov    %rbx,%rdi
call   1050 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <fs_close@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i64 @fs_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fs_open(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %4
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %3
%12 = load i32*, i32** %4
%13 = call i32 @fs_close(i32* %12)
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i64 @fs_size(i8* %0) {
%2 = tail call i32* @fs_open(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %2, i32 0, i32 %3)
%5 = tail call i64 @ftell(i32* %2)
%6 = tail call i32 @fs_close(i32* %2)
ret i64 %5
}
int call(int (*fn)(int, char *), int i, char *str) { return fn(i, str); }


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rdx,%rsi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @call(i32 (i32, i8*)* nocapture %0, i32 %1, i8* %2) {
%4 = tail call i32 %0(i32 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void printErrorWithMessage(int errnum, char *message) {
  do {
    errno = errnum;
    perror(message);
    exit(EXIT_FAILURE);
  } while (0);
}


x86 assembly (clang, -O0):
<printErrorWithMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ea7(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printErrorWithMessage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    %edi,(%rax)
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @printErrorWithMessage(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
br label %5
5: ; preds = %2
%6 = load i32, i32* %3
store i32 %6, i32* @errno
%7 = load i8*, i8** %4
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; No predecessors!
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @printErrorWithMessage(i32 %0, i8* nocapture %1) {
store i32 %0, i32* @errno
%3 = tail call i32 @perror(i8* %1)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int ab8500_fg_inst_curr_done(struct ab8500_fg *di) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ab8500_fg = type opaque
define i32 @ab8500_fg_inst_curr_done(%struct.ab8500_fg* nocapture readnone %0) {
ret i32 0
}
int setlogin(const char *name) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @setlogin(i8* nocapture readnone %0) {
ret i32 -1
}
char *strcpy(char *dst, char *src) {
  char *p = dst;
  while ((*p++ = *src++) != 0)
    ;
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %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
store i8* %6, i8** %5
br label %7
7: ; preds = %15, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %5
store i8 %10, i8* %11
%13 = sext i8 %10 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %7
br label %7
16: ; preds = %7
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x83() {
  Assert_real((isspace(131) == 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_isspace.c",
              660, ("isspace should be 0 for 0x83"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x83>:
push   %rax
mov    $0x83,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x294,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x83\00"
define void @t_isspace_0x83() {
%1 = call i64 @isspace(i32 131)
%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 660, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x83\00"
define void @t_isspace_0x83() {
%1 = tail call i64 @isspace(i32 131)
%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 660, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void printUsage(void) {
  fprintf(stdout, "Usage: seq -m <rows> -n <cols> -o <output-file>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<printUsage>:
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):
<printUsage>:
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):
@stdout = global i32 0
@.str = [49 x i8] c"Usage: seq -m <rows> -n <cols> -o <output-file>\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [49 x i8] c"Usage: seq -m <rows> -n <cols> -o <output-file>\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
double __arctan_sub(double x) {
  return x * (1.0 - 0.33333333 * x * x *
                        (1.0 - 0.60 * x * x * (1.0 - 2.1428571 * x * x)));
}


x86 assembly (clang, -O0):
<__arctan_sub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf02(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xee8(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mulsd  -0x8(%rbp),%xmm2
movsd  0xece(%rip),%xmm3
mulsd  -0x8(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm4
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm3
movsd  0xe99(%rip),%xmm4
addsd  %xmm4,%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xe72(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe4b(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__arctan_sub>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  0xeec(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  0xedc(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__arctan_sub(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double 0x3FD5555551C112DA, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = fmul double 6.000000e-01, %8
%10 = load double, double* %2
%11 = fmul double %9, %10
%12 = load double, double* %2
%13 = fmul double 0x40012492436402DF, %12
%14 = load double, double* %2
%15 = fneg double %13
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double 1.000000e+00)
%17 = fneg double %11
%18 = call double @llvm.fmuladd.f64(double %17, double %16, double 1.000000e+00)
%19 = fneg double %7
%20 = call double @llvm.fmuladd.f64(double %19, double %18, double 1.000000e+00)
%21 = fmul double %3, %20
ret double %21
}

LLVM IR (-O2):
define double @__arctan_sub(double %0) {
%2 = fmul double %0, 0xC0012492436402DF
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fmul double %0, -6.000000e-01
%5 = fmul double %4, %0
%6 = tail call double @llvm.fmuladd.f64(double %5, double %3, double 1.000000e+00)
%7 = fmul double %0, 0xBFD5555551C112DA
%8 = fmul double %7, %0
%9 = tail call double @llvm.fmuladd.f64(double %8, double %6, double 1.000000e+00)
%10 = fmul double %9, %0
ret double %10
}
int testtask(unsigned int set, int task) { return set & (1 << task); }


x86 assembly (clang, -O0):
<testtask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testtask>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @testtask(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
long long swap_reg(long long a) { return __builtin_bswap64(a); }


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

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

LLVM IR (-O0):
define i64 @swap_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.bswap.i64(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @swap_reg(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
int NOPCloneFunction(void **destination, const void *source) {
  *destination = (void **)source;
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ stdout;
int vfprintf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
signed int vprintf(const char *pFormat, va_list ap) {
  return vfprintf(stdout, pFormat, ap);
}


x86 assembly (clang, -O0):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @vprintf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ HeartRateMonitor_HR_unregisterListener();
void Tracking_HR_unregisterListener() {
  HeartRateMonitor_HR_unregisterListener();
}


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

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

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

LLVM IR (-O2):
define void @Tracking_HR_unregisterListener() {
%1 = tail call i32 (...) @HeartRateMonitor_HR_unregisterListener()
ret void
}
/* Variables and functions */
double pmod(double, int);
double prutenic_first_anomaly_sol(double days_since_epoch) {
  static double first_anomaly_radix =
      ((6) + (((40) + (((27) + (((28) + (6) / 60.)) / 60.)) / 60.)) / 60.);
  static double first_anomaly_daily =
      ((0) +
       (((6) + (((17) + (((24) + (((8) + (((48) + (22) / 60.)) / 60.)) / 60.)) /
                            60.)) /
                   60.)) /
           60.) /
      365;
  double first_anomaly =
      pmod(first_anomaly_radix + days_since_epoch * first_anomaly_daily, 360);
  return first_anomaly;
}


x86 assembly (clang, -O0):
<prutenic_first_anomaly_sol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0x2f03(%rip),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0x2efe(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x168,%edi
call   1030 <pmod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prutenic_first_anomaly_sol>:
mulsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
mov    $0x168,%edi
jmp    1030 <pmod@plt>

LLVM IR (-O0):
@prutenic_first_anomaly_sol.first_anomaly_radix = internal global double 0x401AB27AD98344EB
@prutenic_first_anomaly_sol.first_anomaly_daily = internal global double 0x3F32D2B15C4565EA
define double @prutenic_first_anomaly_sol(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* @prutenic_first_anomaly_sol.first_anomaly_radix
%5 = load double, double* %2
%6 = load double, double* @prutenic_first_anomaly_sol.first_anomaly_daily
%7 = call double @llvm.fmuladd.f64(double %5, double %6, double %4)
%8 = call double @pmod(double %7, i32 360)
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @prutenic_first_anomaly_sol(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x3F32D2B15C4565EA, double 0x401AB27AD98344EB)
%3 = tail call double @pmod(double %2, i32 360)
ret double %3
}
int __isdigit(int c) { return '0' <= c && c <= '9'; }


x86 assembly (clang, -O0):
<__isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <__isdigit+0x24>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @__isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_greetings2();
int /*<<< orphan*/ sleep(int);
void do_thread2_work() {
  while (1) {
    print_greetings2();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<do_thread2_work>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <do_thread2_work+0x9>
mov    $0x0,%al
call   1030 <print_greetings2@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1129 <do_thread2_work+0x9>

x86 assembly (clang, -O2):
<do_thread2_work>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <print_greetings2@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <do_thread2_work+0x10>

LLVM IR (-O0):
define void @do_thread2_work() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @print_greetings2()
%3 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @do_thread2_work() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @print_greetings2()
%3 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
scalar_t__ raptor_strncasecmp(char const *, char *, int);
int raptor_uri_uri_string_is_file_uri(const unsigned char *uri_string) {
  if (!uri_string || !*uri_string)
    return 1;
  return raptor_strncasecmp((const char *)uri_string, "file:", 5) == 0;
}


x86 assembly (clang, -O0):
<raptor_uri_uri_string_is_file_uri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <raptor_uri_uri_string_is_file_uri+0x24>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1140 <raptor_uri_uri_string_is_file_uri+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1164 <raptor_uri_uri_string_is_file_uri+0x54>
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x5,%edx
call   1030 <raptor_strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raptor_uri_uri_string_is_file_uri>:
push   %rax
mov    $0x1,%eax
test   %rdi,%rdi
je     113c <raptor_uri_uri_string_is_file_uri+0x2c>
cmpb   $0x0,(%rdi)
je     113c <raptor_uri_uri_string_is_file_uri+0x2c>
lea    0xed9(%rip),%rsi
mov    $0x5,%edx
call   1030 <raptor_strncasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"file:\00"
define i32 @raptor_uri_uri_string_is_file_uri(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @raptor_strncasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %3, %6
%11 = phi i32 [ %9, %6 ], [ 1, %3 ], [ 1, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int __mingw_vfscanf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int __mingw_vscanf(const char *format, va_list argp) {
  return __mingw_vfscanf(stdin, format, argp);
}


x86 assembly (clang, -O0):
<__mingw_vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <__mingw_vfscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mingw_vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__mingw_vfscanf@plt>

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @__mingw_vscanf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @__mingw_vfscanf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  fprintf(stderr, "%s launched with number of args: %d\n", argv[0], argc);
  fprintf(stderr, "\t'MY_INTERNAL_VAR': %u \n", 22);
  return EXIT_SUCCESS;
}


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    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x8(%rbp),%ecx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
mov    $0x16,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ecx
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%edi
mov    (%rsi),%rdx
lea    0xeda(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeef(%rip),%rsi
mov    $0x16,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"%s launched with number of args: %d\0A\00"
@.str.1 = [25 x i8] c"\09'MY_INTERNAL_VAR': %u \0A\00"
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* @stderr
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = load i32, i32* %4
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 22)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"%s launched with number of args: %d\0A\00"
@.str.1 = [25 x i8] c"\09'MY_INTERNAL_VAR': %u \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 22)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
void copyString(char *to, char *from) {
  while (*from) {
    *to++ = *from++;
  }
  *to = '\0';
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <copyString+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <copyString+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
mov    (%rsi),%al
test   %al,%al
je     1121 <copyString+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <copyString+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @copyString(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
void panic(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @panic() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_data_credit_event(int /*<<< orphan*/);
int /*<<< orphan*/ fd_nrf8001_error();
void fd_nrf8001_decode_data_credit_event(uint8_t *buffer, uint32_t length) {
  if (length != 2) {
    fd_nrf8001_error();
    return;
  }
  uint8_t data_credits = buffer[1];
  fd_nrf8001_data_credit_event(data_credits);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
je     1145 <fd_nrf8001_decode_data_credit_event+0x25>
mov    $0x0,%al
call   1030 <fd_nrf8001_error@plt>
jmp    1157 <fd_nrf8001_decode_data_credit_event+0x37>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <fd_nrf8001_data_credit_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    $0x2,%esi
jne    112d <fd_nrf8001_decode_data_credit_event+0xd>
mov    0x4(%rdi),%edi
jmp    1040 <fd_nrf8001_data_credit_event@plt>
xor    %eax,%eax
jmp    1030 <fd_nrf8001_error@plt>

LLVM IR (-O0):
define void @fd_nrf8001_decode_data_credit_event(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* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @fd_nrf8001_error()
br label %16
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 @fd_nrf8001_data_credit_event(i32 %14)
br label %16
16: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
define void @fd_nrf8001_decode_data_credit_event(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @fd_nrf8001_error()
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @fd_nrf8001_data_credit_event(i32 %8)
br label %10
10: ; preds = %6, %4
ret void
}
/* Variables and functions */
int ERR;
int getch();
int /*<<< orphan*/ ungetch(int);
int readInput(void) {
  int ch = getch();
  if (ch != ERR) {
    ungetch(ch);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<readInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
je     1158 <readInput+0x38>
mov    -0x8(%rbp),%edi
call   1030 <ungetch@plt>
movl   $0x1,-0x4(%rbp)
jmp    115f <readInput+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInput>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getch@plt>
mov    0x2eb7(%rip),%rcx
cmp    (%rcx),%eax
je     1141 <readInput+0x21>
mov    %eax,%edi
call   1030 <ungetch@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@ERR = global i32 0
define i32 @readInput() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getch()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @ERR
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @ungetch(i32 %8)
store i32 1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@ERR = global i32 0
define i32 @readInput() {
%1 = tail call i32 (...) @getch()
%2 = load i32, i32* @ERR
%3 = icmp eq i32 %1, %2
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @ungetch(i32 %1)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ 1, %4 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int fib(int);
int countWays(int s) { return fib(s + 1); }


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

x86 assembly (clang, -O2):
<countWays>:
add    $0x1,%edi
jmp    1030 <fib@plt>

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

LLVM IR (-O2):
define i32 @countWays(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @fib(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sighndl(int sig) { printf("Caught signal #%d\n", sig); }


x86 assembly (clang, -O0):
<sighndl>:
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):
<sighndl>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Caught signal #%d\0A\00"
define void @sighndl(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_move_current_dobldobl_to_next(int *cursor) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(455, cursor, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_move_current_dobldobl_to_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1c7,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_move_current_dobldobl_to_next>:
mov    %rdi,%rsi
mov    $0x1c7,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_move_current_dobldobl_to_next(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 455, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_move_current_dobldobl_to_next(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 455, i32* %0, i32* undef, double* undef)
ret i32 %2
}
int getStringLength(char *string) {
  int i = 0;
  while (string[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<getStringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <getStringLength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getStringLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStringLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <getStringLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @getStringLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_inc_l(void) { op_write1(0x2c); }


x86 assembly (clang, -O0):
<op_enc_inc_l>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_inc_l>:
mov    $0x2c,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_inc_l() {
%1 = call i32 @op_write1(i32 44)
ret void
}

LLVM IR (-O2):
define void @op_enc_inc_l() {
%1 = tail call i32 @op_write1(i32 44)
ret void
}