xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
signed char strcaseeq(const char *x, const char *y) {
  return strcasecmp(x, y) == 0;
}


x86 assembly (clang, -O0):
<strcaseeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcaseeq>:
push   %rax
call   1030 <strcasecmp@plt>
test   %rax,%rax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @strcaseeq(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 i64 @strcasecmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @strcaseeq(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int file_size(FILE *fp) {
  fseek(fp, 0L, SEEK_END);
  int sz = ftell(fp);
  if (sz > 0)
    fseek(fp, 0L, SEEK_SET);
  return sz;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    116e <file_size+0x4e>
mov    -0x8(%rbp),%rdi
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
test   %eax,%eax
jle    1157 <file_size+0x37>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @file_size(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
%4 = tail call i32 @ftell(i32* %0)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @SEEK_SET
%8 = tail call i32 @fseek(i32* %0, i64 0, i32 %7)
br label %9
9: ; preds = %6, %1
ret i32 %4
}
void RTSemRWReleaseWrite(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWReleaseWrite() {
ret void
}
int test_imm_78int8_mem(signed char *val) {
  return ((*val) & (0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x78,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_78int8_mem>:
testb  $0x78,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_78int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 120
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
unsigned int _bzhi_u32(unsigned int, int);
unsigned int f10(unsigned int x) { return _bzhi_u32(x, 37); }


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

x86 assembly (clang, -O2):
<f10>:
mov    $0x25,%esi
jmp    1030 <_bzhi_u32@plt>

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

LLVM IR (-O2):
define i32 @f10(i32 %0) {
%2 = tail call i32 @_bzhi_u32(i32 %0, i32 37)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned int buggy(unsigned int *);
int main(void) {
  unsigned int param = 1;
  unsigned int borrow = buggy(&param);
  if (param != 0)
    abort();
  if (borrow + 1 != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <buggy@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1153 <main+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
je     1169 <main+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <buggy@plt>
cmpl   $0x0,0x4(%rsp)
jne    1143 <main+0x23>
cmp    $0xffffffff,%eax
jne    1143 <main+0x23>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%4 = call i32 @buggy(i32* %2)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = load i32, i32* %3
%11 = add i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @buggy(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = icmp eq i32 %3, -1
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %8
ret i32 0
}
int main() {
  int a = 1u;
  if (a = 2) {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1128 <main+0x28>
jmp    112f <main+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %2
br i1 true, label %3, label %4
3: ; preds = %0
store i32 0, i32* %1
br label %4
4: ; preds = %3, %0
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int foo(int a) {
  unsigned int b = a > 0;
  char c = b;
  _Bool d = c == 0;
  int e = !d;
  return e;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i8
store i8 %11, i8* %4
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i8
store i8 %15, i8* %5
%16 = load i8, i8* %5
%17 = trunc i8 %16 to i1
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
store i32 %19, i32* %6
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int print_usage(char *name) {
  printf("USAGE: %s [-i PID | -p PROGRAM ARGUMENTS | -h ]\n", name);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"USAGE: %s [-i PID | -p PROGRAM ARGUMENTS | -h ]\0A\00"
define i32 @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"USAGE: %s [-i PID | -p PROGRAM ARGUMENTS | -h ]\0A\00"
define i32 @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void indent(FILE *fp, int level) {
  int i;
  for (i = 0; i < level * 4; i++) {
    fputc(' ', fp);
  }
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
cmp    %ecx,%eax
jge    1153 <indent+0x43>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <indent+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1142 <indent+0x32>
mov    %rdi,%rbx
shl    $0x2,%esi
cmp    $0x2,%esi
mov    $0x1,%ebp
cmovge %esi,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1130 <indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @indent(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
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 4
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = load i32*, i32** %3
%13 = call i32 @fputc(i8 signext 32, i32* %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @indent(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = shl i32 %1, 2
%6 = call i32 @llvm.smax.i32(i32 %5, i32 1)
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ 0, %4 ]
%9 = tail call i32 @fputc(i8 signext 32, i32* %0)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %6
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void character_to_c(char c) { printf("'%c'\n", c); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"'%c'\0A\00"
define void @character_to_c(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_framebuffer();
int kernal_init(void) {
  setup_framebuffer();
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<kernal_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <setup_framebuffer@plt>
jmp    111b <kernal_init+0xb>

x86 assembly (clang, -O2):
<kernal_init>:
push   %rax
xor    %eax,%eax
call   1030 <setup_framebuffer@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <kernal_init+0x10>

LLVM IR (-O0):
define i32 @kernal_init() {
%1 = call i32 (...) @setup_framebuffer()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define i32 @kernal_init() {
%1 = tail call i32 (...) @setup_framebuffer()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int cpuid_scan(char *);
bool hyperv_check(void) { return cpuid_scan("Microsoft Hv"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Microsoft Hv\00"
define i32 @hyperv_check() {
%1 = call i32 @cpuid_scan(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [13 x i8] c"Microsoft Hv\00"
define i32 @hyperv_check() {
%1 = tail call i32 @cpuid_scan(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ foobar();
main() { foobar(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @foobar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foobar()
ret i32 0
}
void timelib_eat_spaces(char **ptr) {
  while (**ptr == ' ' || **ptr == '\t') {
    ++*ptr;
  }
}


x86 assembly (clang, -O0):
<timelib_eat_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1133 <timelib_eat_spaces+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <timelib_eat_spaces+0x43>
jmp    1156 <timelib_eat_spaces+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <timelib_eat_spaces+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timelib_eat_spaces>:
mov    (%rdi),%rax
jmp    1113 <timelib_eat_spaces+0x13>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,(%rdi)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
cmp    $0x20,%cl
je     1110 <timelib_eat_spaces+0x10>
cmp    $0x9,%cl
je     1110 <timelib_eat_spaces+0x10>
ret

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

LLVM IR (-O2):
define void @timelib_eat_spaces(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ protect(int /*<<< orphan*/);
int /*<<< orphan*/ set_led(int /*<<< orphan*/);
void ignore_me(int signum) {
  protect(0);
  set_led(0);
}


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

x86 assembly (clang, -O2):
<ignore_me>:
push   %rax
xor    %edi,%edi
call   1030 <protect@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <set_led@plt>

LLVM IR (-O0):
define void @ignore_me(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @protect(i32 0)
%4 = call i32 @set_led(i32 0)
ret void
}

LLVM IR (-O2):
define void @ignore_me(i32 %0) {
%2 = tail call i32 @protect(i32 0)
%3 = tail call i32 @set_led(i32 0)
ret void
}
double mode_Exp(double la) { return 0; }


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

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

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

LLVM IR (-O2):
define double @mode_Exp(double %0) {
ret double 0.000000e+00
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int asuint(float);
uint32_t abstop12(float x) { return (asuint(x) >> 20) & 0x7ff; }


x86 assembly (clang, -O0):
<abstop12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asuint@plt>
sar    $0x14,%eax
and    $0x7ff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abstop12>:
push   %rax
call   1030 <asuint@plt>
shr    $0x14,%eax
and    $0x7ff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @abstop12(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @asuint(float %3)
%5 = ashr i32 %4, 20
%6 = and i32 %5, 2047
ret i32 %6
}

LLVM IR (-O2):
define i32 @abstop12(float %0) {
%2 = tail call i32 @asuint(float %0)
%3 = lshr i32 %2, 20
%4 = and i32 %3, 2047
ret i32 %4
}
unsigned int leon3_getbase(register unsigned int *mbar,
                           register unsigned int iobase, int *irq) {
  register unsigned int conf = mbar[1];
  return (unsigned int)(((iobase & 0xfff00000) | ((conf & 0xfff00000) >> 12)) &
                        (((conf & 0x0000fff0) << 4) | 0xfff00000));
}


x86 assembly (clang, -O0):
<leon3_getbase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfff00000,%eax
mov    -0x1c(%rbp),%ecx
and    $0xfff00000,%ecx
shr    $0xc,%ecx
or     %ecx,%eax
mov    -0x1c(%rbp),%ecx
and    $0xfff0,%ecx
shl    $0x4,%ecx
or     $0xfff00000,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leon3_getbase>:
mov    0x4(%rdi),%eax
and    $0xfff00000,%esi
mov    %eax,%ecx
shr    $0xc,%ecx
or     %esi,%ecx
shl    $0x4,%eax
and    $0xfff00,%eax
or     $0xfff00000,%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @leon3_getbase(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
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %5
%12 = and i32 %11, -1048576
%13 = load i32, i32* %7
%14 = and i32 %13, -1048576
%15 = lshr i32 %14, 12
%16 = or i32 %12, %15
%17 = load i32, i32* %7
%18 = and i32 %17, 65520
%19 = shl i32 %18, 4
%20 = or i32 %19, -1048576
%21 = and i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @leon3_getbase(i32* nocapture %0, i32 %1, i32* nocapture readnone %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = and i32 %1, -1048576
%7 = lshr i32 %5, 12
%8 = or i32 %7, %6
%9 = shl i32 %5, 4
%10 = and i32 %9, 1048320
%11 = or i32 %10, -1048576
%12 = and i32 %11, %8
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x72() {
  Assert_real((isspace(114) == 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",
              575, ("isspace should be 0 for r"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x72>:
push   %rax
mov    $0x72,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x23f,%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 = [26 x i8] c"isspace should be 0 for r\00"
define void @t_isspace_0x72() {
%1 = call i64 @isspace(i32 114)
%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 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for r\00"
define void @t_isspace_0x72() {
%1 = tail call i64 @isspace(i32 114)
%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 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skipwspace(char *str) {
  while (str && *str && isspace(*str))
    str++;
  return (str);
}


x86 assembly (clang, -O0):
<skipwspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1157 <skipwspace+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1157 <skipwspace+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <skipwspace+0x57>
jmp    1178 <skipwspace+0x68>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipwspace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwspace>:
push   %rbx
test   %rdi,%rdi
je     113b <skipwspace+0x2b>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113d <skipwspace+0x2d>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     113d <skipwspace+0x2d>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skipwspace+0x10>
jmp    113d <skipwspace+0x2d>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipwspace(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = tail call i64 @isspace(i8 signext %7)
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %6, %3, %1
%16 = phi i8* [ null, %1 ], [ %0, %3 ], [ %8, %6 ], [ %12, %11 ]
ret i8* %16
}
void free_shared_posix(void *ptr, char *handle, int len) {}


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

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

LLVM IR (-O0):
define void @free_shared_posix(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @free_shared_posix(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Type definitions */
struct pollfd {
  int dummy;
};
typedef int /*<<< orphan*/ nfds_t;

/* Variables and functions */
int poll(struct pollfd *, int /*<<< orphan*/, int);
int __poll(struct pollfd fds[], nfds_t nfds, int timeout) {
  return poll(fds, nfds, timeout);
}


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

x86 assembly (clang, -O2):
<__poll>:
jmp    1030 <poll@plt>

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

LLVM IR (-O2):
%struct.pollfd = type { i32 }
define i32 @__poll(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = tail call i32 @poll(%struct.pollfd* %0, i32 %1, i32 %2)
ret i32 %4
}
oscheck(void) {}


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

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

LLVM IR (-O0):
define i32 @oscheck() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @oscheck() {
ret i32 undef
}
int my_rbracket(struct jslex *lexer) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.jslex = type opaque
define i32 @my_rbracket(%struct.jslex* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ev_rtnl_mgrp(uint32_t group) { return group ? (1 << (group - 1)) : 0; }


x86 assembly (clang, -O0):
<ev_rtnl_mgrp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1126 <ev_rtnl_mgrp+0x26>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <ev_rtnl_mgrp+0x30>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <ev_rtnl_mgrp+0x30>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_rtnl_mgrp>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
cmp    $0x1,%edi
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ev_rtnl_mgrp(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned char *);
void get_passphrase(unsigned char *pass) {
  printf("What is your passphrase?\n");
  scanf("%s", pass);
  printf("Done.\n");
}


x86 assembly (clang, -O0):
<get_passphrase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1040 <scanf@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_passphrase>:
push   %rbx
mov    %rdi,%rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xed6(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"What is your passphrase?\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
define void @get_passphrase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [25 x i8] c"What is your passphrase?\00"
@str.3 = [6 x i8] c"Done.\00"
define void @get_passphrase(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *jas_malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *jas_strdup(const char *s) {
  int n;
  char *p;
  n = strlen(s) + 1;
  if (!(p = jas_malloc(n * sizeof(char)))) {
    return 0;
  }
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<jas_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <jas_malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1175 <jas_strdup+0x45>
movq   $0x0,-0x8(%rbp)
jmp    118a <jas_strdup+0x5a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jas_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
call   1040 <jas_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <jas_strdup+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @jas_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @jas_malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
__attribute__((always_)) void outl(unsigned int value, int port) {
  asm volatile("out"
               "l"
               " %"
               ""
               "0, %w1"
               :
               : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
out    %eax,(%dx)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @outl(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
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i32 %1) {
tail call void asm sideeffect "outl $0, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int tcgetattr(int fd, struct termios *termios_p) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<tcgetattr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
void gtk_file_chooser_select_uri() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_select_uri() {
ret void
}
void RTDbgModSymbolByName(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModSymbolByName() {
ret void
}
void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h,
                    unsigned c) {
  asm("nop" ::"a"(0), "b"(x * 65536 + w), "c"(y * 65536 + h), "d"(c));
  asm("movl $0xffffff, %esi \n int $0x40");
}


x86 assembly (clang, -O0):
<kol_wnd_define>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0xc(%rbp),%ebx
shl    $0x10,%ebx
add    -0x14(%rbp),%ebx
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
add    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%edx
xor    %eax,%eax
nop
mov    $0xffffff,%esi
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_wnd_define>:
push   %rbx
shl    $0x10,%edi
lea    (%rdi,%rdx,1),%ebx
shl    $0x10,%esi
add    %esi,%ecx
xor    %eax,%eax
mov    %r8d,%edx
nop
mov    $0xffffff,%esi
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kol_wnd_define(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = shl i32 %0, 16
%7 = add i32 %6, %2
%8 = shl i32 %1, 16
%9 = add i32 %8, %3
tail call void asm sideeffect "nop", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 0, i32 %7, i32 %9, i32 %4)
tail call void asm sideeffect "movl $$0xffffff, %esi \0A int $$0x40", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int _mm_cvttsd_si32(int /*<<< orphan*/);
int test_mm_cvttsd_si32(__m128d A) { return _mm_cvttsd_si32(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvttsd_si32>:
jmp    1030 <_mm_cvttsd_si32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvttsd_si32(i32 %0) {
%2 = tail call i32 @_mm_cvttsd_si32(i32 %0)
ret i32 %2
}
int test_imm_B6int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xB6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B6int64_highword_mem>:
testb  $0xb6,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B6int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 781684047872
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct can_frame {
  int /*<<< orphan*/ *data;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void sdo_copy_multiplexer(struct can_frame *dst, struct can_frame *src) {
  memcpy(&dst->data[1], &src->data[1], 3);
}


x86 assembly (clang, -O0):
<sdo_copy_multiplexer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
add    $0x4,%rsi
mov    $0x3,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdo_copy_multiplexer>:
mov    (%rdi),%rdi
add    $0x4,%rdi
mov    (%rsi),%rsi
add    $0x4,%rsi
mov    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define void @sdo_copy_multiplexer(%struct.can_frame* %0, %struct.can_frame* %1) {
%3 = alloca %struct.can_frame*
%4 = alloca %struct.can_frame*
store %struct.can_frame* %0, %struct.can_frame** %3
store %struct.can_frame* %1, %struct.can_frame** %4
%5 = load %struct.can_frame*, %struct.can_frame** %3
%6 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load %struct.can_frame*, %struct.can_frame** %4
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %9, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = call i32 @memcpy(i32* %8, i32* %12, i32 3)
ret void
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define void @sdo_copy_multiplexer(%struct.can_frame* nocapture %0, %struct.can_frame* nocapture %1) {
%3 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %1, i64 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = tail call i32 @memcpy(i32* %5, i32* %8, i32 3)
ret void
}
void freeNull(unsigned char *value) {}


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

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

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

LLVM IR (-O2):
define void @freeNull(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ config_set_nick_colors();
int /*<<< orphan*/ gui_color_buffer_display();
void config_change_nick_colors(const void *pointer, void *data,
                               struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  config_set_nick_colors();
  gui_color_buffer_display();
}


x86 assembly (clang, -O0):
<config_change_nick_colors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <config_set_nick_colors@plt>
mov    $0x0,%al
call   1030 <gui_color_buffer_display@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @config_change_nick_colors(i8* %0, i8* %1, %struct.t_config_option* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_config_option*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.t_config_option* %2, %struct.t_config_option** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.t_config_option*, %struct.t_config_option** %6
%10 = call i32 (...) @config_set_nick_colors()
%11 = call i32 (...) @gui_color_buffer_display()
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_change_nick_colors(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 (...) @config_set_nick_colors()
%5 = tail call i32 (...) @gui_color_buffer_display()
ret void
}
void mdp4_lcdc_wait4vsync(int cndx) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_lcdc_wait4vsync(i32 %0) {
ret void
}
int main(int argc, char *argv[]) {
  int A = 10;
  typeof(A) *a;
  a = &A;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_138() {
  Assert_real((isqrt(138) == 11),
              "/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/stdlib/isqrt.c",
              695, ("Integer square root of 138 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_138>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8a,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x2b7,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_138>:
push   %rax
mov    $0x8a,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2b7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 138 should be 11\00"
define void @t_sqrt_138() {
%1 = call i32 @isqrt(i32 138)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 695, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 138 should be 11\00"
define void @t_sqrt_138() {
%1 = tail call i32 @isqrt(i32 138)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 695, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int vic_in_interrupt();
int in_interrupt(void) { return vic_in_interrupt(); }


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

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

LLVM IR (-O0):
define i32 @in_interrupt() {
%1 = call i32 (...) @vic_in_interrupt()
ret i32 %1
}

LLVM IR (-O2):
define i32 @in_interrupt() {
%1 = tail call i32 (...) @vic_in_interrupt()
ret i32 %1
}