xunge/DecIR huggingface dataset:
void gensllv() {}


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

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

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

LLVM IR (-O2):
define void @gensllv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int);
void printregs(int edi, int esi, int ebp, int esp, int b, int d, int c, int a) {
  printf("regs: %x %x %x %x %x %x %x (%x)\n", a, b, c, d, ebp, esi, edi,
         (&edi)[-1]);
}


x86 assembly (clang, -O0):
<printregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x8(%rbp),%r11d
mov    -0x4(%rbp),%r10d
mov    -0x8(%rbp),%eax
lea    0xeab(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printregs>:
push   %rax
mov    %edx,%eax
mov    %esi,%r10d
mov    %edi,%r11d
mov    0x18(%rsp),%esi
mov    0x10(%rsp),%ecx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
mov    %r8d,%edx
mov    %r9d,%r8d
mov    %eax,%r9d
push   %r11
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"regs: %x %x %x %x %x %x %x (%x)\0A\00"
define void @printregs(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %16
%18 = load i32, i32* %13
%19 = load i32, i32* %15
%20 = load i32, i32* %14
%21 = load i32, i32* %11
%22 = load i32, i32* %10
%23 = load i32, i32* %9
%24 = getelementptr inbounds i32, i32* %9, i64 -1
%25 = load i32, i32* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 %25)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"regs: %x %x %x %x %x %x %x (%x)\0A\00"
define void @printregs(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %4, i32 %6, i32 %5, i32 %2, i32 %1, i32 %0, i32 poison)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
char *tgetstr(int /*<<< orphan*/, char **);
char *vl_tgetstr(const char *name, char **area) {
  char temp[10];
  return tgetstr(strcpy(temp, name), area);
}


x86 assembly (clang, -O0):
<vl_tgetstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <tgetstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vl_tgetstr>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x6(%rsp),%rdi
call   1030 <strcpy@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <tgetstr@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @vl_tgetstr(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca [10 x i8]
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8**, i8*** %4
%10 = call i8* @tgetstr(i32 %8, i8** %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @vl_tgetstr(i8* %0, i8** %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i8* @tgetstr(i32 %5, i8** %1)
ret i8* %6
}
/* Variables and functions */
int request_sockd_fd(char *, int, char *);
int get_raw_broadcast_socket(void) {
  return request_sockd_fd("s", 1, (char *)0);
}


x86 assembly (clang, -O0):
<get_raw_broadcast_socket>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <request_sockd_fd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_raw_broadcast_socket>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <request_sockd_fd@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"s\00"
define i32 @get_raw_broadcast_socket() {
%1 = call i32 @request_sockd_fd(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* null)
ret i32 %1
}

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
define i32 @get_raw_broadcast_socket() {
%1 = tail call i32 @request_sockd_fd(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* null)
ret i32 %1
}
/* Variables and functions */
int duplicate_func();
int func() { return duplicate_func(); }


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

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

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

LLVM IR (-O2):
define i32 @func() {
%1 = tail call i32 (...) @duplicate_func()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int add_abbrev(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
               int /*<<< orphan*/);
int vle_abbr_add(const wchar_t lhs[], const wchar_t rhs[]) {
  return add_abbrev(lhs, rhs, 0);
}


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

x86 assembly (clang, -O2):
<vle_abbr_add>:
xor    %edx,%edx
jmp    1030 <add_abbrev@plt>

LLVM IR (-O0):
define i32 @vle_abbr_add(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 = call i32 @add_abbrev(i32* %5, i32* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @vle_abbr_add(i32* %0, i32* %1) {
%3 = tail call i32 @add_abbrev(i32* %0, i32* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Expander_Write_Byte(char, int, int);
int /*<<< orphan*/ TWIE_Init(int);
void Expander_Init(char ModuleAddress) {
  TWIE_Init(100000);
  Expander_Write_Byte(ModuleAddress, 0x02, 0x00);
}


x86 assembly (clang, -O0):
<Expander_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x186a0,%edi
call   1040 <TWIE_Init@plt>
mov    $0x2,%esi
xor    %edx,%edx
movsbl -0x1(%rbp),%edi
call   1030 <Expander_Write_Byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Expander_Init>:
push   %rbx
mov    %edi,%ebx
mov    $0x186a0,%edi
call   1040 <TWIE_Init@plt>
mov    %ebx,%edi
mov    $0x2,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <Expander_Write_Byte@plt>

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

LLVM IR (-O2):
define void @Expander_Init(i8 signext %0) {
%2 = tail call i32 @TWIE_Init(i32 100000)
%3 = tail call i32 @Expander_Write_Byte(i8 signext %0, i32 2, i32 0)
ret void
}
int _lseek(int f, int p, int d) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
void gendsrav() {}


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

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

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

LLVM IR (-O2):
define void @gendsrav() {
ret void
}
void updateCoders(void) {}


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

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

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

LLVM IR (-O2):
define void @updateCoders() {
ret void
}
/* Type definitions */
struct section_hash {
  int dummy;
};
struct genhash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genhash_destroy(struct genhash *);
void section_hash_destroy(struct section_hash *tthis) {
  genhash_destroy((struct genhash *)tthis);
}


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

x86 assembly (clang, -O2):
<section_hash_destroy>:
jmp    1030 <genhash_destroy@plt>

LLVM IR (-O0):
%struct.section_hash = type { i32 }
%struct.genhash = type { i32 }
define void @section_hash_destroy(%struct.section_hash* %0) {
%2 = alloca %struct.section_hash*
store %struct.section_hash* %0, %struct.section_hash** %2
%3 = load %struct.section_hash*, %struct.section_hash** %2
%4 = bitcast %struct.section_hash* %3 to %struct.genhash*
%5 = call i32 @genhash_destroy(%struct.genhash* %4)
ret void
}

LLVM IR (-O2):
%struct.section_hash = type { i32 }
%struct.genhash = type { i32 }
define void @section_hash_destroy(%struct.section_hash* %0) {
%2 = bitcast %struct.section_hash* %0 to %struct.genhash*
%3 = tail call i32 @genhash_destroy(%struct.genhash* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show(double ar[]) {
  int i;
  for (i = 0; i < 3; i++) {
    printf("%f\t", ar[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1156 <show+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xebf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <show+0x13>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
lea    0xece(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @show(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load double*, double** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %8, i64 %10
%12 = load double, double* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\09\00"
define void @show(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %8)
%10 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int hash(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int answer;
  char word[200];
  scanf("%s", word);
  answer = hash(word);
  printf("%d\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [200 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%7 = call i32 @hash(i8* %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void gtk_tree_store_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_store_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(int /*<<< orphan*/);
void write(unsigned char *src, unsigned short len) {
  while (len--) {
    putc(*src++);
  }
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0xa(%rbp)
cmp    $0x0,%ax
je     1158 <write+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <putc@plt>
jmp    1123 <write+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1144 <write+0x34>
mov    %rdi,%r14
movzwl %si,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1030 <putc@plt>
add    $0x1,%rbx
cmp    %bx,%r15w
jne    1130 <write+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @write(i8* nocapture %0, i16 zeroext %1) {
%3 = icmp eq i16 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i16 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add i16 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 @putc(i32 %10)
%12 = icmp eq i16 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t ilog2(const uint32_t x) {
  uint32_t y;
  asm("\tbsr %1, %0\n" : "=r"(y) : "r"(x));
  return y;
}


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

x86 assembly (clang, -O2):
<ilog2>:
bsr    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @ilog2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm "\09bsr $1, $0\0A", "=r,r,~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @ilog2(i8* readnone %0) {
%2 = tail call i8* asm "\09bsr $1, $0\0A", "=r,r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ alloc_chr_seq_buffer();
char load_chr_sequence();
int load_chr() {
  char eof = 0;
  alloc_chr_seq_buffer();
  eof = load_chr_sequence();
  return (eof);
}


x86 assembly (clang, -O0):
<load_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1040 <alloc_chr_seq_buffer@plt>
mov    $0x0,%al
call   1030 <load_chr_sequence@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_chr>:
push   %rax
xor    %eax,%eax
call   1040 <alloc_chr_seq_buffer@plt>
xor    %eax,%eax
call   1030 <load_chr_sequence@plt>
movsbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @load_chr() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 (...) @alloc_chr_seq_buffer()
%3 = call signext i8 (...) @load_chr_sequence()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @load_chr() {
%1 = tail call i32 (...) @alloc_chr_seq_buffer()
%2 = tail call signext i8 (...) @load_chr_sequence()
%3 = sext i8 %2 to i32
ret i32 %3
}
int __attribute__((regparm(2))) f(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
void md_free(struct kobject *ko) { return; }


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
define void @md_free(%struct.kobject* nocapture %0) {
ret void
}
int test_imm_52int64_lowword_reg(long long val) {
  return ((val) & (0x52 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_52int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 82
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int neiin1(int a) { return -(a != 1); }


x86 assembly (clang, -O0):
<neiin1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neiin1>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @neiin1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 1
%5 = zext i1 %4 to i32
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @neiin1(i32 %0) {
%2 = icmp ne i32 %0, 1
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *malloc(size_t);
int mkstemp(char *);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *);
size_t strlen(char const *);
int tmpdst(const char *dstpath, char **tmppath) {
  size_t dstlen = strlen(dstpath);
  *tmppath = malloc(dstlen + 8);
  snprintf(*tmppath, dstlen + 8, "%s.XXXXXX", dstpath);
  return mkstemp(*tmppath);
}


x86 assembly (clang, -O0):
<tmpdst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x8(%rbp),%rcx
lea    0xe72(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <mkstemp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpdst>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
lea    0x8(%rax),%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,(%r14)
lea    0xe9a(%rip),%rdx
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rcx
call   1040 <snprintf@plt>
mov    (%r14),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <mkstemp@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s.XXXXXX\00"
define i32 @tmpdst(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i64
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = add i64 %8, 8
%10 = call i8* @malloc(i64 %9)
%11 = load i8**, i8*** %4
store i8* %10, i8** %11
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = load i64, i64* %5
%15 = add i64 %14, 8
%16 = load i8*, i8** %3
%17 = call i32 @snprintf(i8* %13, i64 %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i8**, i8*** %4
%19 = load i8*, i8** %18
%20 = call i32 @mkstemp(i8* %19)
ret i32 %20
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s.XXXXXX\00"
define i32 @tmpdst(i8* %0, i8** nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add i64 %3, 8
%5 = tail call i8* @malloc(i64 %4)
store i8* %5, i8** %1
%6 = tail call i32 @snprintf(i8* %5, i64 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = load i8*, i8** %1
%8 = tail call i32 @mkstemp(i8* %7)
ret i32 %8
}
int fast_multiply(x, y) { return x * y; }


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

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

LLVM IR (-O0):
define i32 @fast_multiply(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fast_multiply(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ rem;
  int /*<<< orphan*/ quot;
};
typedef TYPE_1__ ldiv_t;

/* Variables and functions */
TYPE_1__ ldiv(long, long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  ldiv_t output;
  output = ldiv(100000L, 30000L);
  printf("Quotient = %ld\n", output.quot);
  printf("Remainder = %ld\n", output.rem);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x186a0,%edi
mov    $0x7530,%esi
call   1040 <ldiv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x186a0,%edi
mov    $0x7530,%esi
call   1040 <ldiv@plt>
mov    %rax,%rbx
mov    %rax,%rsi
shr    $0x20,%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@.str = [16 x i8] c"Quotient = %ld\0A\00"
@.str.1 = [17 x i8] c"Remainder = %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.TYPE_3__
%3 = alloca %struct.TYPE_3__
store i32 0, i32* %1
%4 = call i64 @ldiv(i64 100000, i64 30000)
%5 = bitcast %struct.TYPE_3__* %3 to i64*
store i64 %4, i64* %5
%6 = bitcast %struct.TYPE_3__* %2 to i8*
%7 = bitcast %struct.TYPE_3__* %3 to i8*
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Quotient = %ld\0A\00"
@.str.1 = [17 x i8] c"Remainder = %ld\0A\00"
define i32 @main() {
%1 = tail call i64 @ldiv(i64 100000, i64 30000)
%2 = trunc i64 %1 to i32
%3 = lshr i64 %1, 32
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
int test_imm_61int64_midword_reg(long long val) {
  return ((val >> 16) & (0x61 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_61int64_midword_reg>:
test   $0x610000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_61int64_midword_reg(i64 %0) {
%2 = and i64 %0, 6356992
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
regx0indreg1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((p0[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jg     1145 <regx0indreg1+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <regx0indreg1+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0indreg1>:
movslq %edx,%rax
mov    (%r8,%rax,1),%cl
xor    %eax,%eax
cmp    (%r9),%cl
setle  %al
ret

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

LLVM IR (-O2):
define i32 @regx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = load i8, i8* %8
%10 = load i8, i8* %5
%11 = icmp sle i8 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
long char_a2l(string, number)
char string[];
long *number;
{
  long status;
  long a2l();
  *number = a2l(string, &status);
  return (status);
}


x86 assembly (clang, -O0):
<char_a2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <a2l@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_a2l>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <a2l@plt>
mov    %rax,(%rbx)
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @char_a2l(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i64
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i8*, i8** %3
%7 = call i64 (i8*, i64*, ...) bitcast (i64 (...)* @a2l to i64 (i8*, i64*, ...)*)(i8* %6, i64* %5)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @char_a2l(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 (i8*, i64*, ...) bitcast (i64 (...)* @a2l to i64 (i8*, i64*, ...)*)(i8* %0, i64* %3)
store i64 %5, i64* %1
%6 = load i64, i64* %3
ret i64 %6
}
int test_imm_3Duint16_reg(unsigned short val) {
  return ((val) & (0x3D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Duint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x3d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_3Duint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 61
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x94() {
  Assert_real((isalpha(148) == 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_isalpha.c",
              745, ("isalpha should be 0 for 0x94"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x94>:
push   %rax
mov    $0x94,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e9,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x94\00"
define void @t_isalpha_0x94() {
%1 = call i64 @isalpha(i32 148)
%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 745, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x94\00"
define void @t_isalpha_0x94() {
%1 = tail call i64 @isalpha(i32 148)
%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 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ cgload();
int /*<<< orphan*/ cgshl();
int /*<<< orphan*/ cgswap();
int /*<<< orphan*/ gentext();
void genshl(int swapped) {
  gentext();
  if (cgload() || !swapped)
    cgswap();
  cgshl();
}


x86 assembly (clang, -O0):
<genshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <gentext@plt>
mov    $0x0,%al
call   1040 <cgload@plt>
cmp    $0x0,%rax
jne    116d <genshl+0x2d>
cmpl   $0x0,-0x4(%rbp)
jne    1174 <genshl+0x34>
mov    $0x0,%al
call   1030 <cgswap@plt>
mov    $0x0,%al
call   1060 <cgshl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genshl>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <gentext@plt>
xor    %eax,%eax
call   1040 <cgload@plt>
test   %ebx,%ebx
je     115a <genshl+0x1a>
test   %rax,%rax
je     1161 <genshl+0x21>
xor    %eax,%eax
call   1030 <cgswap@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <cgshl@plt>

LLVM IR (-O0):
define void @genshl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gentext()
%4 = call i64 (...) @cgload()
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6, %1
%10 = call i32 (...) @cgswap()
br label %11
11: ; preds = %9, %6
%12 = call i32 (...) @cgshl()
ret void
}

LLVM IR (-O2):
define void @genshl(i32 %0) {
%2 = tail call i32 (...) @gentext()
%3 = tail call i64 (...) @cgload()
%4 = icmp eq i64 %3, 0
%5 = icmp ne i32 %0, 0
%6 = and i1 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 (...) @cgswap()
br label %9
9: ; preds = %1, %7
%10 = tail call i32 (...) @cgshl()
ret void
}
/* Variables and functions */
int RAND_MAX;
scalar_t__ rand();
double rand_double(double min, double max) {
  return ((double)rand() / (double)(RAND_MAX - 1)) * (max - min) + min;
}


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm2
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define double @rand_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load i32, i32* @RAND_MAX
%8 = sub nsw i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = fdiv double %6, %9
%11 = load double, double* %4
%12 = load double, double* %3
%13 = fsub double %11, %12
%14 = load double, double* %3
%15 = call double @llvm.fmuladd.f64(double %10, double %13, double %14)
ret double %15
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define double @rand_double(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i32, i32* @RAND_MAX
%6 = add nsw i32 %5, -1
%7 = sitofp i32 %6 to double
%8 = fdiv double %4, %7
%9 = fsub double %1, %0
%10 = tail call double @llvm.fmuladd.f64(double %8, double %9, double %0)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ clean_up(char *);
int /*<<< orphan*/ md_lock(int /*<<< orphan*/);
int /*<<< orphan*/ message(char *, int);
void sf_error() {
  md_lock(0);
  message("", 1);
  clean_up("sorry, score file is out of order");
}


x86 assembly (clang, -O0):
<sf_error>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <md_lock@plt>
lea    0xedf(%rip),%rdi
mov    $0x1,%esi
call   1030 <message@plt>
lea    0xead(%rip),%rdi
call   1040 <clean_up@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sf_error>:
push   %rax
xor    %edi,%edi
call   1050 <md_lock@plt>
lea    0xee2(%rip),%rdi
mov    $0x1,%esi
call   1030 <message@plt>
lea    0xeb0(%rip),%rdi
pop    %rax
jmp    1040 <clean_up@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [34 x i8] c"sorry, score file is out of order\00"
define void @sf_error() {
%1 = call i32 @md_lock(i32 0)
%2 = call i32 @message(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @clean_up(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [34 x i8] c"sorry, score file is out of order\00"
define void @sf_error() {
%1 = tail call i32 @md_lock(i32 0)
%2 = tail call i32 @message(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @clean_up(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void spy_sigterm_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @spy_sigterm_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ benchmark(int);
int main(void) {
  benchmark((int)2048 * 2 * 2 * 2 * 2 * 2 * 2 * 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @benchmark(i32 262144)
ret i32 0
}
int length(char *t) {
  int taille = 0;
  do {
    taille++;
  } while (t[taille] != '\0');
  return taille + 1;
}


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

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

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw nsw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nuw nsw i32 %9, 2
ret i32 %10
}
unsigned long ffzl(unsigned long word) {
  asm("rep; bsf %1,%0" : "=r"(word) : "r"(~word));
  return word;
}


x86 assembly (clang, -O0):
<ffzl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
tzcnt  %rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffzl>:
not    %rdi
tzcnt  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ffzl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 asm "rep; bsf $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i64 %5, i64* %2
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
define i64 @ffzl(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 asm "rep; bsf $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %2)
ret i64 %3
}
int hb_energy_finish_dummy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hb_energy_finish_dummy() {
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t gt_int64_t(int64_t a, int64_t b) { return a > b; }


x86 assembly (clang, -O0):
<gt_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_int64_t>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

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

LLVM IR (-O2):
define i32 @gt_int64_t(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RB_HALT_SYSTEM;
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int /*<<< orphan*/ sync();
void sync_and_halt(void) {
  sync();
  reboot(RB_HALT_SYSTEM);
}


x86 assembly (clang, -O0):
<sync_and_halt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sync@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <reboot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_and_halt>:
push   %rax
xor    %eax,%eax
call   1030 <sync@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <reboot@plt>

LLVM IR (-O0):
@RB_HALT_SYSTEM = global i32 0
define void @sync_and_halt() {
%1 = call i32 (...) @sync()
%2 = load i32, i32* @RB_HALT_SYSTEM
%3 = call i32 @reboot(i32 %2)
ret void
}

LLVM IR (-O2):
@RB_HALT_SYSTEM = global i32 0
define void @sync_and_halt() {
%1 = tail call i32 (...) @sync()
%2 = load i32, i32* @RB_HALT_SYSTEM
%3 = tail call i32 @reboot(i32 %2)
ret void
}
/* Variables and functions */
int NSIG;
scalar_t__ *sys_siglist;
char *strsignal(int sig) {
  if (sig < 0 || sig >= NSIG) {
    return (char *)"Unknown signal";
  }
  return (char *)sys_siglist[sig];
}


x86 assembly (clang, -O0):
<strsignal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1123 <strsignal+0x23>
mov    -0xc(%rbp),%eax
mov    0x2ebd(%rip),%rcx
cmp    (%rcx),%eax
jl     1133 <strsignal+0x33>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <strsignal+0x49>
mov    0x2eae(%rip),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsignal>:
lea    0xef9(%rip),%rax
test   %edi,%edi
js     1126 <strsignal+0x26>
mov    0x2ec6(%rip),%rcx
cmp    %edi,(%rcx)
jle    1126 <strsignal+0x26>
mov    0x2ecb(%rip),%rax
mov    (%rax),%rax
mov    %edi,%ecx
mov    (%rax,%rcx,8),%rax
ret

LLVM IR (-O0):
@NSIG = global i32 0
@.str = [15 x i8] c"Unknown signal\00"
@sys_siglist = global i64* null
define i8* @strsignal(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @NSIG
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %18
11: ; preds = %6
%12 = load i64*, i64** @sys_siglist
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %12, i64 %14
%16 = load i64, i64* %15
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %2
br label %18
18: ; preds = %11, %10
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@NSIG = global i32 0
@.str = [15 x i8] c"Unknown signal\00"
@sys_siglist = global i64* null
define i8* @strsignal(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = load i32, i32* @NSIG
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i64*, i64** @sys_siglist
%8 = zext i32 %0 to i64
%9 = getelementptr inbounds i64, i64* %7, i64 %8
%10 = load i64, i64* %9
%11 = inttoptr i64 %10 to i8*
br label %12
12: ; preds = %1, %6
%13 = phi i8* [ %11, %6 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void cleanup_module(void) { printk("cleanup_module called\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"cleanup_module called\0A\00"
define void @cleanup_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"cleanup_module called\0A\00"
define void @cleanup_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}