xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_position_mask_ri(void) {
  char ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1C, &ctrl_reg2, 1) == 0) {
    ctrl_reg2 |= 0x10;
    KIONIX_ACCEL_write_byte(0x1C, ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_position_mask_ri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1c,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_position_mask_ri+0x4d>
movsbl -0x1(%rbp),%eax
or     $0x10,%eax
mov    %al,-0x1(%rbp)
mov    $0x1c,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_position_mask_ri+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_position_mask_ri>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1c,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_position_mask_ri+0x41>
movsbl 0xf(%rsp),%esi
or     $0x10,%esi
mov    %sil,0xf(%rsp)
mov    $0x1c,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_position_mask_ri() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = or i32 %7, 16
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_position_mask_ri() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = or i8 %5, 16
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
list_rules(s) char *s;
{ do_list_rules(s, 0); }


x86 assembly (clang, -O0):
<list_rules>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <do_list_rules@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_rules>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <do_list_rules@plt>

LLVM IR (-O0):
define i32 @list_rules(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_list_rules to i32 (i8*, i32, ...)*)(i8* %4, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @list_rules(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_list_rules to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
ret i32 undef
}
void arg_uint3(unsigned int x, unsigned int y, unsigned int z) {}


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

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

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

LLVM IR (-O2):
define void @arg_uint3(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(struct foo *);
scalar_t__ malloc(int);
int main() {
  struct foo {
    int bar[10];
  };
  struct foo *k = (struct foo *)malloc(2 * sizeof(int));
  k->bar[5] = 9;
  free(k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x9,0x14(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
movl   $0x9,0x14(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.foo = type { [10 x i32] }
%struct.foo.0 = type opaque
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.foo*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 8)
%4 = inttoptr i64 %3 to %struct.foo*
store %struct.foo* %4, %struct.foo** %2
%5 = load %struct.foo*, %struct.foo** %2
%6 = getelementptr inbounds %struct.foo, %struct.foo* %5, i32 0, i32 0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 5
store i32 9, i32* %7
%8 = load %struct.foo*, %struct.foo** %2
%9 = bitcast %struct.foo* %8 to %struct.foo.0*
%10 = call i32 @free(%struct.foo.0* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.foo = type { [10 x i32] }
%struct.foo.0 = type opaque
define i32 @main() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to %struct.foo*
%3 = getelementptr inbounds %struct.foo, %struct.foo* %2, i64 0, i32 0, i64 5
store i32 9, i32* %3
%4 = inttoptr i64 %1 to %struct.foo.0*
%5 = tail call i32 @free(%struct.foo.0* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *realloc(void *, size_t);
void *xrealloc(void *buf, size_t size) {
  buf = realloc(buf, size);
  if (buf == NULL)
    err(1, "realloc");
  return (buf);
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115d <xrealloc+0x3d>
mov    $0x1,%edi
lea    0xea8(%rip),%rsi
call   1030 <err@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xrealloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int opt_expmode(char *opt) {
  if (strcmp(opt, "-e") == 0)
    return 1;
  if (strcmp(opt, "--exponential") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_expmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <opt_expmode+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_expmode+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <opt_expmode+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_expmode+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_expmode>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <opt_expmode+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

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

/* Variables and functions */
int EVP_EncryptFinal_ex(int /*<<< orphan*/ *, unsigned char *, int *);
int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) {
  int ret;
  ret = EVP_EncryptFinal_ex(ctx, out, outl);
  return ret;
}


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

x86 assembly (clang, -O2):
<EVP_EncryptFinal>:
jmp    1030 <EVP_EncryptFinal_ex@plt>

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

LLVM IR (-O2):
define i32 @EVP_EncryptFinal(i32* %0, i8* %1, i32* %2) {
%4 = tail call i32 @EVP_EncryptFinal_ex(i32* %0, i8* %1, i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void TtlUnmarshal_Blob(uint8_t **to, uint8_t **cursor, int size) {
  *to = *cursor;
  *cursor += size;
}


x86 assembly (clang, -O0):
<TtlUnmarshal_Blob>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TtlUnmarshal_Blob>:
mov    (%rsi),%rax
mov    %rax,(%rdi)
movslq %edx,%rax
shl    $0x2,%rax
add    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @TtlUnmarshal_Blob(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 = load i32**, i32*** %5
%8 = load i32*, i32** %7
%9 = load i32**, i32*** %4
store i32* %8, i32** %9
%10 = load i32, i32* %6
%11 = load i32**, i32*** %5
%12 = load i32*, i32** %11
%13 = sext i32 %10 to i64
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32* %14, i32** %11
ret void
}

LLVM IR (-O2):
define void @TtlUnmarshal_Blob(i32** nocapture writeonly %0, i32** nocapture %1, i32 %2) {
%4 = load i32*, i32** %1
store i32* %4, i32** %0
%5 = load i32*, i32** %1
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
store i32* %7, i32** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closeNetHandle(int skfd) { close(skfd); }


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

x86 assembly (clang, -O2):
<closeNetHandle>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closeNetHandle(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int stack_pushfloat(float ret) {
  int (*signature)(float);
  *((int *)(&signature)) = 0x080A9ABC;
  return signature(ret);
}


x86 assembly (clang, -O0):
<stack_pushfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x80a9abc,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  -0x4(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_pushfloat>:
mov    $0x80a9abc,%eax
jmp    *%rax

LLVM IR (-O0):
define i32 @stack_pushfloat(float %0) {
%2 = alloca float
%3 = alloca i32 (float)*
store float %0, float* %2
%4 = bitcast i32 (float)** %3 to i32*
store i32 134912700, i32* %4
%5 = load i32 (float)*, i32 (float)** %3
%6 = load float, float* %2
%7 = call i32 %5(float %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @stack_pushfloat(float %0) {
%2 = tail call i32 inttoptr (i64 134912700 to i32 (float)*)(float %0)
ret i32 %2
}
/* Type definitions */
struct caca_conio_text_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_gettextinfo(struct caca_conio_text_info *r) { conio_init(); }


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

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

LLVM IR (-O0):
%struct.caca_conio_text_info = type { i32 }
define void @caca_conio_gettextinfo(%struct.caca_conio_text_info* %0) {
%2 = alloca %struct.caca_conio_text_info*
store %struct.caca_conio_text_info* %0, %struct.caca_conio_text_info** %2
%3 = call i32 (...) @conio_init()
ret void
}

LLVM IR (-O2):
%struct.caca_conio_text_info = type { i32 }
define void @caca_conio_gettextinfo(%struct.caca_conio_text_info* nocapture readnone %0) {
%2 = tail call i32 (...) @conio_init()
ret void
}
int getRoot() { return 16; }


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

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

LLVM IR (-O0):
define i32 @getRoot() {
ret i32 16
}

LLVM IR (-O2):
define i32 @getRoot() {
ret i32 16
}
/* Variables and functions */
char *av_malloc(int);
int /*<<< orphan*/ bcopy(char const *, char *, int);
int strlen(char const *);
char *av_strdup(const char *s) {
  char *ptr;
  int len;
  len = strlen(s) + 1;
  ptr = av_malloc(len);
  if (ptr)
    bcopy((s), (ptr), (len));
  return ptr;
}


x86 assembly (clang, -O0):
<av_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <av_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <av_strdup+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <bcopy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%ebx
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <av_malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     115f <av_strdup+0x2f>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <memmove@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @av_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i8* @av_malloc(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = call i32 @bcopy(i8* %13, i8* %14, i32 %15)
br label %17
17: ; preds = %12, %1
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @av_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @av_malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* align 1 %4, i8* align 1 %0, i32 %3, i1 false)
br label %7
7: ; preds = %6, %1
ret i8* %4
}
/* Type definitions */
struct PdfGeneratorDataStreamColumn {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MemoryManager_Free(struct PdfGeneratorDataStreamColumn *);
void PdfGeneratorDataStreamColumn_Destroy(
    struct PdfGeneratorDataStreamColumn *self) {
  MemoryManager_Free(self);
}


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

x86 assembly (clang, -O2):
<PdfGeneratorDataStreamColumn_Destroy>:
jmp    1030 <MemoryManager_Free@plt>

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

LLVM IR (-O2):
%struct.PdfGeneratorDataStreamColumn = type { i32 }
define void @PdfGeneratorDataStreamColumn_Destroy(%struct.PdfGeneratorDataStreamColumn* %0) {
%2 = tail call i32 @MemoryManager_Free(%struct.PdfGeneratorDataStreamColumn* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void refcnt_attach_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_refcnt@%p::attach (refcnt_attach) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<refcnt_attach_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<refcnt_attach_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_refcnt@%p::attach (refcnt_attach) is invoked after destruction\0A\00"
define void @refcnt_attach_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_refcnt@%p::attach (refcnt_attach) is invoked after destruction\0A\00"
define void @refcnt_attach_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int main() {
  ssize_t i = 17;
  (void)i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main() { fputs("asdf\n", stderr); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"asdf\0A\00"
@stderr = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"asdf\0A\00"
@stderr = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void SerialFlush(int fd) { tcflush(fd, TCIOFLUSH); }


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

x86 assembly (clang, -O2):
<SerialFlush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define void @SerialFlush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIOFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define void @SerialFlush(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 1000000;
  a += 10000;
  printf("Hello World\n");
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 1000000, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 10000
store i32 %3, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ removespace(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char const *argv[]) {
  char str[256];
  fgets(str, 256, stdin);
  removespace(str);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1050 <fgets@plt>
lea    -0x110(%rbp),%rdi
call   1040 <removespace@plt>
lea    -0x110(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1040 <removespace@plt>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %7, i32 256, i32 %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = call i32 @removespace(i8* %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 256, i32 %5)
%7 = call i32 @removespace(i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ search(char *, char *);
void main() {
  char text[] = "BACDGABCDA";
  char pat[] = "ABCD";
  search(text, pat);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xb(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0xb(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <search@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x4342414744434142,%rax
41 42 43
mov    %rax,0x8(%rsp)
movl   $0x414443,0xf(%rsp)
movb   $0x0,0x4(%rsp)
movl   $0x44434241,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <search@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.text = [11 x i8] c"BACDGABCDA\00"
@__const.main.pat = [5 x i8] c"ABCD\00"
define void @main() {
%1 = alloca [11 x i8]
%2 = alloca [5 x i8]
%3 = bitcast [11 x i8]* %1 to i8*
%4 = bitcast [5 x i8]* %2 to i8*
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @search(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@__const.main.text = [11 x i8] c"BACDGABCDA\00"
@__const.main.pat = [5 x i8] c"ABCD\00"
define void @main() {
%1 = alloca [11 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @search(i8* %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("B====\n=B===\n==B==\n===B=\n====B\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"B====\0A=B===\0A==B==\0A===B=\0A====B\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"B====\0A=B===\0A==B==\0A===B=\0A====B\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char *argv[]) {
  int val = 0;
  int i;
  for (i = 0; i < 0x1001; i++) {
    printf("%3d: %x after convert: %x\n", i, i,
           ((((i) << 12) | (((i) >> 8) & 0xfffU)) & 0x000fffffU));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x1001,-0x18(%rbp)
jge    117a <main+0x6a>
mov    -0x18(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
shl    $0xc,%ecx
mov    -0x18(%rbp),%eax
sar    $0x8,%eax
and    $0xfff,%eax
or     %eax,%ecx
and    $0xfffff,%ecx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
xor    %ebp,%ebp
nop
mov    %ebp,%eax
shr    $0x8,%eax
mov    %ebx,%ecx
and    $0xff000,%ecx
or     %eax,%ecx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x1000,%ebx
cmp    $0x1001,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%3d: %x after convert: %x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %22, %2
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 4097
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load i32, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %7
%15 = shl i32 %14, 12
%16 = load i32, i32* %7
%17 = ashr i32 %16, 8
%18 = and i32 %17, 4095
%19 = or i32 %15, %18
%20 = and i32 %19, 1048575
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %20)
br label %22
22: ; preds = %11
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %8
25: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"%3d: %x after convert: %x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %10, %3 ]
%5 = shl nuw nsw i32 %4, 12
%6 = lshr i32 %4, 8
%7 = and i32 %5, 1044480
%8 = or i32 %7, %6
%9 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %4, i32 %8)
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 4097
br i1 %11, label %12, label %3
12: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xb9() {
  Assert_real((isspace(185) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              930, ("isspace should be 0 for 0xb9"));
}


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

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

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

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

/* Variables and functions */
struct script_stack_element *make_stack_element(unsigned char *, int);
struct script_stack_element *make_bool(int r) {
  return make_stack_element(
      r != 0 ? (unsigned char *)"\x01" : (unsigned char *)"\x00", 1);
}


x86 assembly (clang, -O0):
<make_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xedd(%rip),%rdi
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x1,%esi
call   1030 <make_stack_element@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_bool>:
test   %edi,%edi
lea    0xee9(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
mov    $0x1,%esi
jmp    1030 <make_stack_element@plt>

LLVM IR (-O0):
%struct.script_stack_element = type { i32 }
@.str = [2 x i8] c"\01\00"
@.str.1 = [2 x i8] zeroinitializer
define %struct.script_stack_element* @make_bool(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%7 = call %struct.script_stack_element* @make_stack_element(i8* %6, i32 1)
ret %struct.script_stack_element* %7
}

LLVM IR (-O2):
%struct.script_stack_element = type { i32 }
@.str = [2 x i8] c"\01\00"
@.str.1 = [2 x i8] zeroinitializer
define %struct.script_stack_element* @make_bool(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%4 = tail call %struct.script_stack_element* @make_stack_element(i8* %3, i32 1)
ret %struct.script_stack_element* %4
}
/* Variables and functions */
int /*<<< orphan*/ print_uart0(char *);
void c_entry() { print_uart0("Hello world!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @c_entry() {
%1 = call i32 @print_uart0(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @c_entry() {
%1 = tail call i32 @print_uart0(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bckH_totalNB();
int gen_totalNB();
int part_totalNB();
void sim_nbEntities(int elementnb[3]) {
  elementnb[0] = part_totalNB();
  elementnb[1] = gen_totalNB();
  elementnb[2] = bckH_totalNB();
}


x86 assembly (clang, -O0):
<sim_nbEntities>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <part_totalNB@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <gen_totalNB@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0x0,%al
call   1030 <bckH_totalNB@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_nbEntities>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <part_totalNB@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1040 <gen_totalNB@plt>
mov    %eax,0x4(%rbx)
xor    %eax,%eax
call   1030 <bckH_totalNB@plt>
mov    %eax,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sim_nbEntities(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @part_totalNB()
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 %3, i32* %5
%6 = call i32 (...) @gen_totalNB()
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %6, i32* %8
%9 = call i32 (...) @bckH_totalNB()
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 2
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @sim_nbEntities(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @part_totalNB()
store i32 %2, i32* %0
%3 = tail call i32 (...) @gen_totalNB()
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = tail call i32 (...) @bckH_totalNB()
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
ret void
}
void av_log_set_flags() {}


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

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

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

LLVM IR (-O2):
define void @av_log_set_flags() {
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long millis(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return (ts.tv_sec * 1000 + ts.tv_nsec / 1000000L);
}


x86 assembly (clang, -O0):
<millis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x10(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millis>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
movslq 0x8(%rsp),%rax
imul   $0x3e8,%rax,%rcx
movabs $0x431bde82d7b634db,%rax
de 1b 43
imulq  0x10(%rsp)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x12,%rdx
add    %rdx,%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @millis() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sdiv i64 %9, 1000000
%11 = add nsw i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @millis() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = sdiv i64 %10, 1000000
%12 = add nsw i64 %11, %8
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
char *strip_quotes(char *input) {
  if (input != NULL) {
    char *ptr = strrchr(input, '\"');
    if (ptr != NULL)
      *ptr = '\0';
    if (input[0] == '\"')
      strcpy(input, input + 1);
  }
  return input;
}


x86 assembly (clang, -O0):
<strip_quotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1181 <strip_quotes+0x61>
mov    -0x8(%rbp),%rdi
mov    $0x22,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <strip_quotes+0x3b>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    117c <strip_quotes+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
jmp    1181 <strip_quotes+0x61>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_quotes>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     114f <strip_quotes+0x2f>
mov    %rbx,%rdi
mov    $0x22,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     113e <strip_quotes+0x1e>
movb   $0x0,(%rax)
cmpb   $0x22,(%rbx)
jne    114f <strip_quotes+0x2f>
lea    0x1(%rbx),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strip_quotes(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 34)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
store i8 0, i8* %4
br label %7
7: ; preds = %6, %3
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 34
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = tail call i32 @strcpy(i8* %0, i8* %11)
br label %13
13: ; preds = %7, %10, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ __NR_gettid;
long syscall(int /*<<< orphan*/);
long gettid() { return syscall(__NR_gettid); }


x86 assembly (clang, -O0):
<gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_gettid = global i32 0
define i64 @gettid() {
%1 = load i32, i32* @__NR_gettid
%2 = call i64 @syscall(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@__NR_gettid = global i32 0
define i64 @gettid() {
%1 = load i32, i32* @__NR_gettid
%2 = tail call i64 @syscall(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ tokenise(char *);
int main() {
  char *foo = NULL;
  foo = "select col1, col2, colC from test where city = \"Auckland\" ;";
  tokenise(foo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xed2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <tokenise@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [60 x i8] c"select col1, col2, colC from test where city = \22Auckland\22 ;\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
store i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @tokenise(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [60 x i8] c"select col1, col2, colC from test where city = \22Auckland\22 ;\00"
define i32 @main() {
%1 = tail call i32 @tokenise(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, int);
int /*<<< orphan*/ exit(int);
void *malloc(int);
void *xmalloc(int size) {
  void *mem = malloc(size);
  if (mem == NULL) {
    error("xmalloc %d\n", size);
    exit(69);
  }
  return mem;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <xmalloc+0x3b>
mov    -0x4(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1040 <error@plt>
mov    $0x45,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %edi,%ebx
call   1030 <malloc@plt>
test   %rax,%rax
je     113f <xmalloc+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1040 <error@plt>
mov    $0x45,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"xmalloc %d\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 69)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"xmalloc %d\0A\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 69)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void weekDayName() { printf("Sun\tMon\tTue\tWed\tThru\tFri\tSat\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Sun\09Mon\09Tue\09Wed\09Thru\09Fri\09Sat\0A\00"
define void @weekDayName() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Sun\09Mon\09Tue\09Wed\09Thru\09Fri\09Sat\00"
define void @weekDayName() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}