xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ INT8_MAX;
int /*<<< orphan*/ INT8_MIN;
int8_t abs_i8(int8_t i) {
  if (i == INT8_MIN) {
    return INT8_MAX;
  } else {
    return i >= 0 ? i : -i;
  }
}


x86 assembly (clang, -O0):
<abs_i8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
jne    112a <abs_i8+0x2a>
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <abs_i8+0x4d>
cmpl   $0x0,-0x8(%rbp)
jl     113f <abs_i8+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <abs_i8+0x47>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_i8>:
mov    0x2ee1(%rip),%rcx
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
cmp    %edi,(%rcx)
jne    111b <abs_i8+0x1b>
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@INT8_MIN = global i32 0
@INT8_MAX = global i32 0
define i32 @abs_i8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @INT8_MIN
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* @INT8_MAX
store i32 %8, i32* %2
br label %19
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i32, i32* %3
br label %17
14: ; preds = %9
%15 = load i32, i32* %3
%16 = sub nsw i32 0, %15
br label %17
17: ; preds = %14, %12
%18 = phi i32 [ %13, %12 ], [ %16, %14 ]
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@INT8_MIN = global i32 0
@INT8_MAX = global i32 0
define i32 @abs_i8(i32 %0) {
%2 = load i32, i32* @INT8_MIN
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @INT8_MAX
%5 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ strcmp(char *, char const *);
char *xfrd_read_token(int /*<<< orphan*/ *);
int xfrd_read_check_str(FILE *in, const char *str) {
  char *p = xfrd_read_token(in);
  if (!p)
    return 0;
  if (strcmp(p, str) != 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<xfrd_read_check_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <xfrd_read_token@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <xfrd_read_check_str+0x34>
movl   $0x0,-0x4(%rbp)
jmp    117e <xfrd_read_check_str+0x5e>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1177 <xfrd_read_check_str+0x57>
movl   $0x0,-0x4(%rbp)
jmp    117e <xfrd_read_check_str+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfrd_read_check_str>:
push   %rbx
mov    %rsi,%rbx
call   1030 <xfrd_read_token@plt>
test   %rax,%rax
je     1146 <xfrd_read_check_str+0x26>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @xfrd_read_check_str(i32* %0, i8* %1) {
%3 = tail call i8* @xfrd_read_token(i32* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %3, i8* %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void QueueUnderflow() {
  printf("\n\nERR: Queue Underflow\nCannot Pop From Empty Queue\n\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"\0A\0AERR: Queue Underflow\0ACannot Pop From Empty Queue\0A\0A\00"
define void @QueueUnderflow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"\0A\0AERR: Queue Underflow\0ACannot Pop From Empty Queue\0A\00"
define void @QueueUnderflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
void child_code(int delay) {
  printf("child %d here. will sleep for %d seconds\n", getpid(), delay);
  sleep(delay);
  printf("child done. about to exit\n");
  exit(17);
}


x86 assembly (clang, -O0):
<child_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1060 <sleep@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x11,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<child_code>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   1070 <sleep@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x11,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"child %d here. will sleep for %d seconds\0A\00"
@.str.1 = [27 x i8] c"child done. about to exit\0A\00"
define void @child_code(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @sleep(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 17)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"child %d here. will sleep for %d seconds\0A\00"
@str = [26 x i8] c"child done. about to exit\00"
define void @child_code(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
%4 = tail call i32 @sleep(i32 %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 17)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *do_b2i_bio(int /*<<< orphan*/ *, int /*<<< orphan*/);
EVP_PKEY *b2i_PrivateKey_bio(BIO *in) { return do_b2i_bio(in, 0); }


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

x86 assembly (clang, -O2):
<b2i_PrivateKey_bio>:
xor    %esi,%esi
jmp    1030 <do_b2i_bio@plt>

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

LLVM IR (-O2):
define i32* @b2i_PrivateKey_bio(i32* %0) {
%2 = tail call i32* @do_b2i_bio(i32* %0, i32 0)
ret i32* %2
}
void bar3(void) {}


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

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

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

LLVM IR (-O2):
define void @bar3() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int equal_cstrings(char *s1, char *s2) { return strcmp(s1, s2) == 0; }


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

x86 assembly (clang, -O2):
<equal_cstrings>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equal_cstrings(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @equal_cstrings(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int DRV_FILE_GET_DISKSPACE(const char *path, unsigned int *DskSpc,
                           unsigned int *UsdSpc, unsigned int *VldSpc) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @DRV_FILE_GET_DISKSPACE(i8* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @DRV_FILE_GET_DISKSPACE(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
void vdiqes(int *escape_code, int *support) { *support = 0; }


x86 assembly (clang, -O0):
<vdiqes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdiqes>:
movl   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @vdiqes(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 0, i32* %5
ret void
}

LLVM IR (-O2):
define void @vdiqes(i32* nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
ret void
}
void mm_cache_shrink() {}


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

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

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

LLVM IR (-O2):
define void @mm_cache_shrink() {
ret void
}
/* Variables and functions */
int calulcafatorial(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  scanf("%d", &num);
  printf("%d", calulcafatorial(num));
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @calulcafatorial(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_space(char *p, char *e) {
  while (p < e && isspace(*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
jae    1149 <skip_space+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1159 <skip_space+0x49>
jmp    116a <skip_space+0x5a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <skip_space+0x10>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
cmp    %rsi,%rdi
jae    114b <skip_space+0x3b>
mov    %rsi,%r14
mov    %rsi,%rbx
sub    %r15,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15),%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     114b <skip_space+0x3b>
add    $0x1,%r15
add    $0xffffffffffffffff,%rbx
jne    1130 <skip_space+0x20>
mov    %r14,%r15
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @skip_space(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr i8, i8* %0, i64 %7
br label %9
9: ; preds = %4, %14
%10 = phi i8* [ %15, %14 ], [ %0, %4 ]
%11 = load i8, i8* %10
%12 = tail call i64 @isspace(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = icmp eq i8* %15, %8
br i1 %16, label %17, label %9
17: ; preds = %9, %14, %2
%18 = phi i8* [ %0, %2 ], [ %8, %14 ], [ %10, %9 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int, int);
int /*<<< orphan*/ write_tty(char *, char *, int);
void set_speed(int servo, int speed) {
  char cmd[6];
  sprintf(cmd, "%c%c%c%c%c", 0x80, 0x01, 0x01, servo, speed);
  write_tty("/dev/ttyO1", cmd, 5);
}


x86 assembly (clang, -O0):
<set_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%r9d
mov    -0x8(%rbp),%eax
lea    0xec0(%rip),%rsi
mov    $0x80,%edx
mov    $0x1,%r8d
mov    %r8d,%ecx
mov    %eax,(%rsp)
call   1030 <sprintf@plt>
lea    -0xe(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x5,%edx
call   1040 <write_tty@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_speed>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r9d
mov    %esi,(%rsp)
lea    0xece(%rip),%rsi
lea    0xa(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x80,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <sprintf@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1040 <write_tty@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%c%c%c%c%c\00"
@.str.1 = [11 x i8] c"/dev/ttyO1\00"
define void @set_speed(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [6 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 128, i32 1, i32 1, i32 %7, i32 %8)
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 0
%11 = call i32 @write_tty(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32 5)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%c%c%c%c%c\00"
@.str.1 = [11 x i8] c"/dev/ttyO1\00"
define void @set_speed(i32 %0, i32 %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 128, i32 1, i32 1, i32 %0, i32 %1)
%6 = call i32 @write_tty(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 5)
ret void
}
/* Variables and functions */
unsigned long BITMAP_MASK(unsigned long);
size_t BITMAP_OFFSET(unsigned long);
int bitmap_is_bit_set(unsigned long *bitmap, unsigned long bit) {
  return ((bitmap[BITMAP_OFFSET(bit)] & BITMAP_MASK(bit)) == BITMAP_MASK(bit));
}


x86 assembly (clang, -O0):
<bitmap_is_bit_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <BITMAP_OFFSET@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <BITMAP_MASK@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <BITMAP_MASK@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_is_bit_set>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <BITMAP_OFFSET@plt>
mov    (%r14,%rax,8),%r14
mov    %r15,%rdi
call   1040 <BITMAP_MASK@plt>
mov    %rax,%rbx
and    %r14,%rbx
mov    %r15,%rdi
call   1040 <BITMAP_MASK@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @bitmap_is_bit_set(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = call i64 @BITMAP_OFFSET(i64 %6)
%8 = getelementptr inbounds i64, i64* %5, i64 %7
%9 = load i64, i64* %8
%10 = load i64, i64* %4
%11 = call i64 @BITMAP_MASK(i64 %10)
%12 = and i64 %9, %11
%13 = load i64, i64* %4
%14 = call i64 @BITMAP_MASK(i64 %13)
%15 = icmp eq i64 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @bitmap_is_bit_set(i64* nocapture %0, i64 %1) {
%3 = tail call i64 @BITMAP_OFFSET(i64 %1)
%4 = getelementptr inbounds i64, i64* %0, i64 %3
%5 = load i64, i64* %4
%6 = tail call i64 @BITMAP_MASK(i64 %1)
%7 = and i64 %6, %5
%8 = tail call i64 @BITMAP_MASK(i64 %1)
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_112() {
  Assert_real((isqrt(112) == 10),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              565, ("Integer square root of 112 should be 10"));
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 112 should be 10\00"
define void @t_sqrt_112() {
%1 = call i32 @isqrt(i32 112)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 565, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 112 should be 10\00"
define void @t_sqrt_112() {
%1 = tail call i32 @isqrt(i32 112)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 565, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double atan2(double y, double x) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @atan2(double %0, double %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
rab(char *pt, int *pti) {
  pt[2] = 0;
  pti[3] = 0;
}


x86 assembly (clang, -O0):
<rab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rab>:
movb   $0x0,0x2(%rdi)
movl   $0x0,0xc(%rsi)
ret

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

LLVM IR (-O2):
define i32 @rab(i8* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %3
%4 = getelementptr inbounds i32, i32* %1, i64 3
store i32 0, i32* %4
ret i32 undef
}
void handler(int signal) {}


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
void sig_handler() {
  printf("main: interrupted by SIGALARM\n");
  printf("Test PASSED: *Note: Did not return EDEADLK when re-locking a "
         "spinlock already in  use, but standard says 'may' fail\n");
  pthread_exit((void *)0);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"main: interrupted by SIGALARM\0A\00"
@.str.1 = [117 x i8] c"Test PASSED: *Note: Did not return EDEADLK when re-locking a spinlock already in use, but standard says 'may' fail\0A\00"
define void @sig_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @pthread_exit(i8* null)
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"main: interrupted by SIGALARM\00"
@str.2 = [116 x i8] c"Test PASSED: *Note: Did not return EDEADLK when re-locking a spinlock already in use, but standard says 'may' fail\00"
define void @sig_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([116 x i8], [116 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* null)
ret void
}
int sum(int k, int blockSize, int distance) {
  if ((k + distance + 1) % blockSize == 0)
    return distance;
  else
    return 0;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    112e <sum+0x2e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <sum+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    %edx,%ecx
lea    (%rdi,%rcx,1),%eax
add    $0x1,%eax
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %7
%10 = add nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = load i32, i32* %6
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i32, i32* %7
store i32 %16, i32* %4
br label %18
17: ; preds = %3
store i32 0, i32* %4
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, 1
%5 = add i32 %4, %2
%6 = srem i32 %5, %1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 %2, i32 0
ret i32 %8
}
/* Variables and functions */
void test_hello2() {
  int *s = NULL;
  *s = 42;
}


x86 assembly (clang, -O0):
<test_hello2>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @test_hello2() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

LLVM IR (-O2):
void f() {
  float x$1 = ((float)({
    double t$1 = 0x0p+0;
    (((int)t$1) ? t$1 : 0x1.b333333333333p+2);
  }));
  printf("%f\n", x$1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
cmp    $0x0,%eax
je     113d <f+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    114f <f+0x3f>
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    114f <f+0x3f>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe91(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
mov    $0x1,%al
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define void @f() {
%1 = alloca float
%2 = alloca double
%3 = alloca double
store double 0.000000e+00, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load double, double* %2
br label %10
9: ; preds = %0
br label %10
10: ; preds = %9, %7
%11 = phi double [ %8, %7 ], [ 6.800000e+00, %9 ]
store double %11, double* %3
%12 = load double, double* %3
%13 = fptrunc double %12 to float
store float %13, float* %1
%14 = load float, float* %1
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %15)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @f() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x401B333340000000)
ret void
}
const char *vedis_lib_version(void) { return "1.2.6"; }


x86 assembly (clang, -O0):
<vedis_lib_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vedis_lib_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.2.6\00"
define i8* @vedis_lib_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.6\00"
define i8* @vedis_lib_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void __DELETE_org_xmlvm_runtime_RedTypeMarker(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_org_xmlvm_runtime_RedTypeMarker(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_org_xmlvm_runtime_RedTypeMarker(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationDesiredHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void StabilizationDesiredLogging() {
  UAVObjLogging(StabilizationDesiredHandle());
}


x86 assembly (clang, -O0):
<StabilizationDesiredLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <StabilizationDesiredHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationDesiredLogging>:
push   %rax
xor    %eax,%eax
call   1040 <StabilizationDesiredHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @StabilizationDesiredLogging() {
%1 = call i32 (...) @StabilizationDesiredHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationDesiredLogging() {
%1 = tail call i32 (...) @StabilizationDesiredHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
int max3(int a, int b, int c) {
  int m;
  if (a >= b)
    m = a;
  else
    m = b;
  if (m >= c)
    return m;
  else
    return c;
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1124 <max3+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <max3+0x2a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1141 <max3+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <max3+0x47>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp sge i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %5
store i32 %13, i32* %8
br label %16
14: ; preds = %3
%15 = load i32, i32* %6
store i32 %15, i32* %8
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = icmp sge i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i32, i32* %8
store i32 %21, i32* %4
br label %24
22: ; preds = %16
%23 = load i32, i32* %7
store i32 %23, i32* %4
br label %24
24: ; preds = %22, %20
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, double *);
void input_PD_N(double *p) { scanf("%lf", p); }


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

x86 assembly (clang, -O2):
<input_PD_N>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <scanf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define void @input_PD_N(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define void @input_PD_N(double* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %0)
ret void
}
int twist_f_on_sliceedge(sliceedge)
int sliceedge;
{
  int temp_arr[12];
  sliceedge_unpack(sliceedge, temp_arr);
  four_cycle(temp_arr, 9, 4, 8, 0);
  return sliceedge_pack(temp_arr);
}


x86 assembly (clang, -O0):
<twist_f_on_sliceedge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1050 <sliceedge_unpack@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1040 <four_cycle@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <sliceedge_pack@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twist_f_on_sliceedge>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <sliceedge_unpack@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sliceedge_pack@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @twist_f_on_sliceedge(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @sliceedge_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 9, i32 4, i32 8, i32 0)
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @sliceedge_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @twist_f_on_sliceedge(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @sliceedge_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 9, i32 4, i32 8, i32 0)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @sliceedge_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char, char);
int main(void) {
  char c;
  while (-1) {
    c = getchar();
    printf("Código de %c: %d\n", c, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
lea    0xebd(%rip),%rdi
movsbl %al,%esi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edx
mov    %rbx,%rdi
mov    %edx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [19 x i8] c"C\C3\B3digo de %c: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = load i8, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6)
br label %3
}

LLVM IR (-O2):
@.str = [19 x i8] c"C\C3\B3digo de %c: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %2, i8 signext %2)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "usage: bin2c [-cz] [-p prefix] [-s sufix] <input_file> <output_file>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"usage: bin2c [-cz] [-p prefix] [-s sufix] <input_file> <output_file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"usage: bin2c [-cz] [-p prefix] [-s sufix] <input_file> <output_file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int fchmodat(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int chmodat(int fd, char const *file, mode_t mode) {
  return fchmodat(fd, file, mode, 0);
}


x86 assembly (clang, -O0):
<chmodat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <fchmodat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmodat>:
xor    %ecx,%ecx
jmp    1030 <fchmodat@plt>

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

LLVM IR (-O2):
define i32 @chmodat(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @fchmodat(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_event_source_unref(void *s) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_event_source_unref(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void test() {
  void *b = malloc(1);
  if (b != 0) {
    free(b);
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114a <test+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1139 <test+0x19>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @test() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @free(i8* %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
int /*<<< orphan*/ Send_Byte(unsigned char);
void Chip_Erase(unsigned char cmd) {
  CE_Low();
  Send_Byte(cmd);
  CE_High();
}


x86 assembly (clang, -O0):
<Chip_Erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1050 <CE_Low@plt>
movzbl -0x1(%rbp),%edi
call   1030 <Send_Byte@plt>
mov    $0x0,%al
call   1040 <CE_High@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Chip_Erase>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <CE_Low@plt>
mov    %ebx,%edi
call   1030 <Send_Byte@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <CE_High@plt>

LLVM IR (-O0):
define void @Chip_Erase(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @CE_Low()
%4 = load i8, i8* %2
%5 = call i32 @Send_Byte(i8 zeroext %4)
%6 = call i32 (...) @CE_High()
ret void
}

LLVM IR (-O2):
define void @Chip_Erase(i8 zeroext %0) {
%2 = tail call i32 (...) @CE_Low()
%3 = tail call i32 @Send_Byte(i8 zeroext %0)
%4 = tail call i32 (...) @CE_High()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copy_tab(int *, int *, unsigned int, unsigned int);
int *create_tab(int *, unsigned int);
int *concat_tab(int tab1[], unsigned tab_size1, int tab2[],
                unsigned tab_size2) {
  int *tab_dest = NULL;
  tab_dest = create_tab(tab_dest, tab_size1 + tab_size2);
  copy_tab(tab1, tab_dest, tab_size1, 0);
  copy_tab(tab2, tab_dest, tab_size2, tab_size1);
  return tab_dest;
}


x86 assembly (clang, -O0):
<concat_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    -0x1c(%rbp),%esi
call   1040 <create_tab@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
call   1030 <copy_tab@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <copy_tab@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_tab>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %esi,%r13d
mov    %rdi,%r12
lea    (%r15,%r13,1),%esi
xor    %edi,%edi
call   1040 <create_tab@plt>
mov    %rax,%rbx
mov    %r12,%rdi
mov    %rax,%rsi
mov    %r13d,%edx
xor    %ecx,%ecx
call   1030 <copy_tab@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r13d,%ecx
call   1030 <copy_tab@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @concat_tab(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
store i32* null, i32** %9
%10 = load i32*, i32** %9
%11 = load i32, i32* %6
%12 = load i32, i32* %8
%13 = add i32 %11, %12
%14 = call i32* @create_tab(i32* %10, i32 %13)
store i32* %14, i32** %9
%15 = load i32*, i32** %5
%16 = load i32*, i32** %9
%17 = load i32, i32* %6
%18 = call i32 @copy_tab(i32* %15, i32* %16, i32 %17, i32 0)
%19 = load i32*, i32** %7
%20 = load i32*, i32** %9
%21 = load i32, i32* %8
%22 = load i32, i32* %6
%23 = call i32 @copy_tab(i32* %19, i32* %20, i32 %21, i32 %22)
%24 = load i32*, i32** %9
ret i32* %24
}

LLVM IR (-O2):
define i32* @concat_tab(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = add i32 %3, %1
%6 = tail call i32* @create_tab(i32* null, i32 %5)
%7 = tail call i32 @copy_tab(i32* %0, i32* %6, i32 %1, i32 0)
%8 = tail call i32 @copy_tab(i32* %2, i32* %6, i32 %3, i32 %1)
ret i32* %6
}
int test_imm_BAint32_mem(int *val) {
  return ((*val) & (0xBA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BAint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 186
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long int f7(unsigned char *x) { return ~(1ULL << (x[0] & 0x3f)); }


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x3f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
xor    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    (%rdi),%cl
mov    $0xfffffffffffffffe,%rax
rol    %cl,%rax
ret

LLVM IR (-O0):
define i64 @f7(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 63
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
%10 = xor i64 %9, -1
ret i64 %10
}

LLVM IR (-O2):
define i64 @f7(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 63
%4 = zext i8 %3 to i64
%5 = shl nuw i64 1, %4
%6 = xor i64 %5, -1
ret i64 %6
}