xunge/DecIR huggingface dataset:
/* Variables and functions */
char *notImplemented();
char *serverNumDocuments(char *unused1, char *unused2, char *unused3) {
  (void)(unused1);
  (void)(unused2);
  (void)(unused3);
  return notImplemented();
}


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

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

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

LLVM IR (-O2):
define i8* @serverNumDocuments(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* (...) @notImplemented()
ret i8* %4
}
/* Variables and functions */
int _regex(char *);
int main(int argc, char *argv[]) {
  (void)argc;
  return _regex(argv[0]);
}


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

x86 assembly (clang, -O2):
<main>:
mov    (%rsi),%rdi
jmp    1030 <_regex@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @_regex(i8* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("usage:\n\tbf -[option] <filename>\n");
  printf("The option :\n\t-p\tprint full info\n");
  printf("\t-n size\tthe sheet size(default 30)\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"usage:\0A\09bf -[option] <filename>\0A\00"
@.str.1 = [34 x i8] c"The option :\0A\09-p\09print full info\0A\00"
@.str.2 = [37 x i8] c"\09-n size\09the sheet size(default 30)\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"usage:\0A\09bf -[option] <filename>\00"
@str.3 = [33 x i8] c"The option :\0A\09-p\09print full info\00"
@str.4 = [36 x i8] c"\09-n size\09the sheet size(default 30)\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
ret void
}
int GetHash(const char *s) {
  int hash = 0;
  while (*s) {
    hash = 31 * hash + (*s++);
  }
  return hash;
}


x86 assembly (clang, -O0):
<GetHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <GetHash+0x3c>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <GetHash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <GetHash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <GetHash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @GetHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 31
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add nsw i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
__attribute__((no, noclone)) void f9(struct A *x) {
  asm volatile("" : : "g"(x) : "memory");
}


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

x86 assembly (clang, -O2):
<f9>:
mov    %rdi,-0x8(%rsp)
ret

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

LLVM IR (-O2):
%struct.A = type opaque
define void @f9(%struct.A* %0) {
tail call void asm sideeffect "", "imr,~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.A* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_NOUSER;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void polonius_polka(int sig) { errx(EX_NOUSER, "oh I am slain"); }


x86 assembly (clang, -O0):
<polonius_polka>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polonius_polka>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@EX_NOUSER = global i32 0
@.str = [14 x i8] c"oh I am slain\00"
define void @polonius_polka(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EX_NOUSER
%4 = call i32 @errx(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@EX_NOUSER = global i32 0
@.str = [14 x i8] c"oh I am slain\00"
define void @polonius_polka(i32 %0) {
%2 = load i32, i32* @EX_NOUSER
%3 = tail call i32 @errx(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main() { printf("%d", strlen("Michael")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <strlen@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Michael\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int osd_antiflicker_task_start(void) {
  printk("++ osd_antiflicker depends on GE2D module!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<osd_antiflicker_task_start>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"++ osd_antiflicker depends on GE2D module!\0A\00"
define i32 @osd_antiflicker_task_start() {
%1 = call i32 @printk(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"++ osd_antiflicker depends on GE2D module!\0A\00"
define i32 @osd_antiflicker_task_start() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct _citrus_db {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _citrus_db *);
void _citrus_db_close(struct _citrus_db *db) { free(db); }


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

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

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

LLVM IR (-O2):
%struct._citrus_db = type { i32 }
define void @_citrus_db_close(%struct._citrus_db* nocapture %0) {
%2 = tail call i32 @free(%struct._citrus_db* %0)
ret void
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_bus_slot_unref(void *slot) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_slot_unref(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sha256_double();
int /*<<< orphan*/ sha256_final(int /*<<< orphan*/ *);
int /*<<< orphan*/ sha256_init();
int /*<<< orphan*/ sha256_padding(int /*<<< orphan*/ const *, unsigned int);
int /*<<< orphan*/ sha256_update(int /*<<< orphan*/ const *, unsigned int);
void dsha256(const uint8_t *input, unsigned int count, uint8_t *state) {
  sha256_init();
  sha256_update(input, count);
  sha256_padding(input + (count / (512 / 8)) * (512 / 8), count);
  sha256_double();
  sha256_final(state);
}


x86 assembly (clang, -O0):
<dsha256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <sha256_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <sha256_update@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shr    $0x6,%eax
shl    $0x6,%eax
mov    %eax,%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
call   1060 <sha256_padding@plt>
mov    $0x0,%al
call   1030 <sha256_double@plt>
mov    -0x18(%rbp),%rdi
call   1070 <sha256_final@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsha256>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <sha256_init@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <sha256_update@plt>
mov    %ebp,%eax
and    $0xffffffc0,%eax
lea    (%rbx,%rax,4),%rdi
mov    %ebp,%esi
call   1060 <sha256_padding@plt>
xor    %eax,%eax
call   1030 <sha256_double@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1070 <sha256_final@plt>

LLVM IR (-O0):
define void @dsha256(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
%7 = call i32 (...) @sha256_init()
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = call i32 @sha256_update(i32* %8, i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = udiv i32 %12, 64
%14 = mul i32 %13, 64
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %11, i64 %15
%17 = load i32, i32* %5
%18 = call i32 @sha256_padding(i32* %16, i32 %17)
%19 = call i32 (...) @sha256_double()
%20 = load i32*, i32** %6
%21 = call i32 @sha256_final(i32* %20)
ret void
}

LLVM IR (-O2):
define void @dsha256(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 (...) @sha256_init()
%5 = tail call i32 @sha256_update(i32* %0, i32 %1)
%6 = and i32 %1, -64
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @sha256_padding(i32* %8, i32 %1)
%10 = tail call i32 (...) @sha256_double()
%11 = tail call i32 @sha256_final(i32* %2)
ret void
}
/* Variables and functions */
scalar_t__ _get_sysfs_numeric(char *, char *, long long *);
long long get_sysfs_llong(char *sysfs_attr) {
  long long number;
  if (_get_sysfs_numeric(sysfs_attr, "%ld", &number) == 0)
    return number;
  else
    return ((long long)-1);
}


x86 assembly (clang, -O0):
<get_sysfs_llong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <_get_sysfs_numeric@plt>
cmp    $0x0,%rax
jne    1147 <get_sysfs_llong+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <get_sysfs_llong+0x3f>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sysfs_llong>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdx
call   1030 <_get_sysfs_numeric@plt>
neg    %rax
sbb    %rax,%rax
or     (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i64 @get_sysfs_llong(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @_get_sysfs_numeric(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i64, i64* %4
store i64 %9, i64* %2
br label %11
10: ; preds = %1
store i64 -1, i64* %2
br label %11
11: ; preds = %10, %8
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i64 @get_sysfs_llong(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i64 @_get_sysfs_numeric(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = icmp eq i64 %4, 0
%6 = load i64, i64* %2
%7 = select i1 %5, i64 %6, i64 -1
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ FIONBIO;
int ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ printf(char *);
int setNonBlocking(int fd) {
  int flags;
  flags = 1;
  printf("using ioctl\n");
  return ioctl(fd, FIONBIO, &flags);
}


x86 assembly (clang, -O0):
<setNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setNonBlocking>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x1,0xc(%rsp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"using ioctl\0A\00"
@FIONBIO = global i32 0
define i32 @setNonBlocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = load i32, i32* @FIONBIO
%7 = call i32 @ioctl(i32 %5, i32 %6, i32* %3)
ret i32 %7
}

LLVM IR (-O2):
@FIONBIO = global i32 0
@str = [12 x i8] c"using ioctl\00"
define i32 @setNonBlocking(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @FIONBIO
%6 = call i32 @ioctl(i32 %0, i32 %5, i32* %2)
ret i32 %6
}
void deflateCopy(void) {}


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

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

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

LLVM IR (-O2):
define void @deflateCopy() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBModeConfig(uint32_t ui32Base, uint32_t ui32Mode) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000041C))) = ui32Mode;
}


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

x86 assembly (clang, -O2):
<USBModeConfig>:
mov    %rsi,0x41c(%rdi)
ret

LLVM IR (-O0):
define void @USBModeConfig(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 1052
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @USBModeConfig(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 1052
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int test_all(int, char **);
int main(int argc, char **argv) { return test_all(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <test_all@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_all(i32 %0, i8** %1)
ret i32 %3
}
double height_projectile(double time, double initial_velocity,
                         double initial_height) {
  double projectile_height = 0.0;
  projectile_height =
      -16 * time * time + initial_velocity * time + initial_height;
  return projectile_height;
}


x86 assembly (clang, -O0):
<height_projectile>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xedd(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @height_projectile(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
%8 = load double, double* %4
%9 = fmul double -1.600000e+01, %8
%10 = load double, double* %4
%11 = load double, double* %5
%12 = load double, double* %4
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
%15 = load double, double* %6
%16 = fadd double %14, %15
store double %16, double* %7
%17 = load double, double* %7
ret double %17
}

LLVM IR (-O2):
define double @height_projectile(double %0, double %1, double %2) {
%4 = fmul double %0, -1.600000e+01
%5 = fmul double %0, %1
%6 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %5)
%7 = fadd double %6, %2
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x8d() {
  Assert_real((isascii(141) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              710, ("isascii should be 0 for 0x8d"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x8d>:
push   %rax
mov    $0x8d,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2c6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x8d\00"
define void @t_isascii_0x8d() {
%1 = call i64 @isascii(i32 141)
%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 710, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x8d\00"
define void @t_isascii_0x8d() {
%1 = tail call i64 @isascii(i32 141)
%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 710, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsscanf(char const *, char const *, int /*<<< orphan*/);
int c_vsscanf(const char *str, const char *format, va_list ap) {
  return vsscanf(str, format, ap);
}


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

x86 assembly (clang, -O2):
<c_vsscanf>:
jmp    1030 <vsscanf@plt>

LLVM IR (-O0):
define i32 @c_vsscanf(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @vsscanf(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @c_vsscanf(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @vsscanf(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
void *j3(size_t);
void *m(size_t n) { return j3(n); }


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

x86 assembly (clang, -O2):
<m>:
jmp    1030 <j3@plt>

LLVM IR (-O0):
define i8* @m(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @j3(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @m(i64 %0) {
%2 = tail call i8* @j3(i64 %0)
ret i8* %2
}
int test_imm_23uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x23 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_23uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 35
%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_23uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2293760
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int g(int i) { return g(i); }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ flushInput();
char getchar();
char getCharacter() {
  char c = getchar();
  flushInput();
  return c;
}


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

x86 assembly (clang, -O2):
<getCharacter>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <flushInput@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getCharacter() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = call i32 (...) @flushInput()
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @getCharacter() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call i32 (...) @flushInput()
ret i8 %1
}
/* Variables and functions */
int truncate(char *, int);
int sysapi_truncate_file(char *filename, int filesize) {
  return truncate(filename, filesize);
}


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

x86 assembly (clang, -O2):
<sysapi_truncate_file>:
jmp    1030 <truncate@plt>

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

LLVM IR (-O2):
define i32 @sysapi_truncate_file(i8* %0, i32 %1) {
%3 = tail call i32 @truncate(i8* %0, i32 %1)
ret i32 %3
}
void RTBldCfgRevision(void) {}


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

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

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

LLVM IR (-O2):
define void @RTBldCfgRevision() {
ret void
}
/* Variables and functions */
char *cheap_sprintf(char *, char const *, char const *, char const *);
char *strapp3(const char *s1, const char *s2, const char *s3) {
  return cheap_sprintf("%s%s%s", s1, s2, s3);
}


x86 assembly (clang, -O0):
<strapp3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdi
call   1030 <cheap_sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strapp3>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <cheap_sprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s%s%s\00"
define i8* @strapp3(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @cheap_sprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
define i8* @strapp3(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @cheap_sprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Variables and functions */
int owTouchByte(int, int);
int owWriteByte(int portnum, int sendbyte) {
  return (owTouchByte(portnum, sendbyte) == (0xff & sendbyte)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<owWriteByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <owTouchByte@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%esi
and    $0xff,%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<owWriteByte>:
push   %rbx
mov    %esi,%ebx
call   1030 <owTouchByte@plt>
movzbl %bl,%edx
xor    %ecx,%ecx
cmp    %edx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @owWriteByte(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 @owTouchByte(i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 255, %8
%10 = icmp eq i32 %7, %9
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @owWriteByte(i32 %0, i32 %1) {
%3 = tail call i32 @owTouchByte(i32 %0, i32 %1)
%4 = and i32 %1, 255
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int do_815() { return 815; }


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

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

LLVM IR (-O0):
define i32 @do_815() {
ret i32 815
}

LLVM IR (-O2):
define i32 @do_815() {
ret i32 815
}
int f1() {}


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

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

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

LLVM IR (-O2):
define i32 @f1() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned int);
int vprintf_bochs(unsigned c, void **ptr) {
  (void)ptr;
  outb(0xe9, c);
  return 0;
}


x86 assembly (clang, -O0):
<vprintf_bochs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xe9,%edi
call   1030 <outb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf_bochs>:
push   %rax
mov    %edi,%esi
mov    $0xe9,%edi
call   1030 <outb@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @vprintf_bochs(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @outb(i32 233, i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Putl(int, int);
extern void SetErrAndLen(int deltaY, int deltaX) {
  Putl(0x40, ((2 * deltaY - deltaX) & 0xFFFF) | (deltaX << 16));
}


x86 assembly (clang, -O0):
<SetErrAndLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
shl    $0x1,%esi
sub    -0x8(%rbp),%esi
and    $0xffff,%esi
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
or     %eax,%esi
mov    $0x40,%edi
call   1030 <Putl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetErrAndLen>:
add    %edi,%edi
sub    %esi,%edi
movzwl %di,%eax
shl    $0x10,%esi
or     %eax,%esi
mov    $0x40,%edi
jmp    1030 <Putl@plt>

LLVM IR (-O0):
define void @SetErrAndLen(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 = mul nsw i32 2, %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = and i32 %8, 65535
%10 = load i32, i32* %4
%11 = shl i32 %10, 16
%12 = or i32 %9, %11
%13 = call i32 @Putl(i32 64, i32 %12)
ret void
}

LLVM IR (-O2):
define void @SetErrAndLen(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = sub nsw i32 %3, %1
%5 = and i32 %4, 65535
%6 = shl i32 %1, 16
%7 = or i32 %5, %6
%8 = tail call i32 @Putl(i32 64, i32 %7)
ret void
}
int counter1() {
  static int i;
  return i++;
}


x86 assembly (clang, -O0):
<counter1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<counter1>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@counter1.i = internal global i32 0
define i32 @counter1() {
%1 = load i32, i32* @counter1.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @counter1.i
ret i32 %1
}

LLVM IR (-O2):
@counter1.i = internal unnamed_addr global i32 0
define i32 @counter1() {
%1 = load i32, i32* @counter1.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @counter1.i
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ constant_var_and_pointers();
int /*<<< orphan*/ normal_var_and_pointers();
int main() {
  normal_var_and_pointers();
  constant_var_and_pointers();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @normal_var_and_pointers()
%2 = tail call i32 (...) @constant_var_and_pointers()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, unsigned char *, int);
unsigned int zipmapDecodeLength(unsigned char *p) {
  unsigned int len = *p;
  if (len < 254)
    return len;
  memcpy(&len, p + 1, sizeof(unsigned int));
  return len;
}


x86 assembly (clang, -O0):
<zipmapDecodeLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xfe,-0x14(%rbp)
jae    113e <zipmapDecodeLength+0x2e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <zipmapDecodeLength+0x4a>
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipmapDecodeLength>:
push   %rax
movzbl (%rdi),%eax
mov    %eax,0x4(%rsp)
cmp    $0xfe,%eax
jb     1139 <zipmapDecodeLength+0x29>
mov    %rdi,%rsi
add    $0x1,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @zipmapDecodeLength(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i8, i8* %0
%5 = zext i8 %4 to i32
store i32 %5, i32* %2
%6 = icmp ult i8 %4, -2
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = call i32 @memcpy(i32* %2, i8* %8, i32 4)
%10 = load i32, i32* %2
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ %5, %1 ]
ret i32 %12
}
unsigned long k2_next_power_of_2(unsigned long val) {
  unsigned count = 0;
  if (val & !(val & (val - 1)))
    return val;
  while (val != 0) {
    val >>= 1;
    count += 1;
  }
  return 1 << count;
}


x86 assembly (clang, -O0):
<k2_next_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
and    %rdx,%rcx
cmp    $0x0,%rcx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     114f <k2_next_power_of_2+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1189 <k2_next_power_of_2+0x89>
jmp    1154 <k2_next_power_of_2+0x54>
cmpq   $0x0,-0x10(%rbp)
je     1179 <k2_next_power_of_2+0x79>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <k2_next_power_of_2+0x54>
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<k2_next_power_of_2>:
mov    %rdi,%rax
lea    -0x1(%rdi),%rcx
test   %rcx,%rdi
sete   %cl
test   %al,%cl
je     1112 <k2_next_power_of_2+0x12>
ret
xor    %ecx,%ecx
test   %rax,%rax
je     112f <k2_next_power_of_2+0x2f>
mov    %rax,%rdx
nopl   0x0(%rax)
shr    %rdx
add    $0x1,%ecx
cmp    $0x1,%rax
mov    %rdx,%rax
ja     1120 <k2_next_power_of_2+0x20>
mov    $0x1,%eax
shl    %cl,%eax
cltq
ret

LLVM IR (-O0):
define i64 @k2_next_power_of_2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 0, i32* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = sub i64 %7, 1
%9 = and i64 %6, %8
%10 = icmp ne i64 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = sext i32 %12 to i64
%14 = and i64 %5, %13
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %1
%17 = load i64, i64* %3
store i64 %17, i64* %2
br label %31
18: ; preds = %1
br label %19
19: ; preds = %22, %18
%20 = load i64, i64* %3
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i64, i64* %3
%24 = lshr i64 %23, 1
store i64 %24, i64* %3
%25 = load i32, i32* %4
%26 = add i32 %25, 1
store i32 %26, i32* %4
br label %19
27: ; preds = %19
%28 = load i32, i32* %4
%29 = shl i32 1, %28
%30 = sext i32 %29 to i64
store i64 %30, i64* %2
br label %31
31: ; preds = %27, %16
%32 = load i64, i64* %2
ret i64 %32
}

LLVM IR (-O2):
define i64 @k2_next_power_of_2(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = icmp ult i64 %2, 2
%4 = zext i1 %3 to i64
%5 = and i64 %4, %0
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %1
%8 = icmp eq i64 %0, 0
br i1 %8, label %15, label %9
9: ; preds = %7, %9
%10 = phi i32 [ %13, %9 ], [ 0, %7 ]
%11 = phi i64 [ %12, %9 ], [ %0, %7 ]
%12 = lshr i64 %11, 1
%13 = add nuw nsw i32 %10, 1
%14 = icmp ult i64 %11, 2
br i1 %14, label %15, label %9
15: ; preds = %9, %7
%16 = phi i32 [ 0, %7 ], [ %13, %9 ]
%17 = shl nuw i32 1, %16
%18 = sext i32 %17 to i64
br label %19
19: ; preds = %1, %15
%20 = phi i64 [ %18, %15 ], [ %0, %1 ]
ret i64 %20
}
/* Variables and functions */
int /*<<< orphan*/ parse_raw_message(char *, char *, char **);
void parse_header(char *header, char head[4][100]) {
  char *token = " ";
  parse_raw_message(header, token, head);
}


x86 assembly (clang, -O0):
<parse_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <parse_raw_message@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_header>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <parse_raw_message@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @parse_header(i8* %0, [100 x i8]* %1) {
%3 = alloca i8*
%4 = alloca [100 x i8]*
%5 = alloca i8*
store i8* %0, i8** %3
store [100 x i8]* %1, [100 x i8]** %4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %5
%8 = load [100 x i8]*, [100 x i8]** %4
%9 = bitcast [100 x i8]* %8 to i8**
%10 = call i32 @parse_raw_message(i8* %6, i8* %7, i8** %9)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @parse_header(i8* %0, [100 x i8]* %1) {
%3 = bitcast [100 x i8]* %1 to i8**
%4 = tail call i32 @parse_raw_message(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3)
ret void
}
void gensrlv() {}


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

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

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

LLVM IR (-O2):
define void @gensrlv() {
ret void
}
strintab(str, tab, ntab) char *str, **tab;
{
  int i;
  for (i = 0; i < ntab; ++i)
    if (!strcmp(str, tab[i]))
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<strintab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1173 <strintab+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1160 <strintab+0x50>
movl   $0x1,-0x4(%rbp)
jmp    117a <strintab+0x6a>
jmp    1165 <strintab+0x55>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112a <strintab+0x1a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strintab>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1149 <strintab+0x39>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     114d <strintab+0x3d>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <strintab+0x20>
xor    %eax,%eax
jmp    1152 <strintab+0x42>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @strintab(i8* nocapture %0, i8** nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %15, %6
br i1 %8, label %16, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %15, %7 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %12)
%14 = icmp eq i32 %13, 0
%15 = add nuw nsw i64 %10, 1
br i1 %14, label %16, label %7
16: ; preds = %9, %7, %3
%17 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %17
}
void INT_Excep_RIIC0_ICEEI0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC0_ICEEI0() {
ret void
}
__attribute__((no)) void func_3(void) {}


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

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

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

LLVM IR (-O2):
define void @func_3() {
ret void
}
/* Variables and functions */
int pagesize();
size_t page_aligned_addr(size_t addr) { return (addr & ~(pagesize() - 1)); }


x86 assembly (clang, -O0):
<page_aligned_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <pagesize@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_aligned_addr>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <pagesize@plt>
neg    %eax
cltq
and    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @page_aligned_addr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 (...) @pagesize()
%5 = sub nsw i32 %4, 1
%6 = xor i32 %5, -1
%7 = sext i32 %6 to i64
%8 = and i64 %3, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @page_aligned_addr(i64 %0) {
%2 = tail call i32 (...) @pagesize()
%3 = sub i32 0, %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, %0
ret i64 %5
}
/* Type definitions */
struct student {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct student *);
void deallocate(struct student *stud) {
  if (stud != 0) {
    free(stud);
  }
}


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

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

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

LLVM IR (-O2):
%struct.student = type { i32 }
define void @deallocate(%struct.student* %0) {
%2 = icmp eq %struct.student* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.student* %0)
br label %5
5: ; preds = %3, %1
ret void
}