xunge/DecIR huggingface dataset:
/* Type definitions */
struct mem_block {
  int dummy;
};

/* Variables and functions */
scalar_t__ mem_block_inside(struct mem_block *, struct mem_block *);
bool mem_block_overlap(struct mem_block *block1, struct mem_block *block2) {
  return mem_block_inside(block1, block2) || mem_block_inside(block2, block1);
}


x86 assembly (clang, -O0):
<mem_block_overlap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mem_block_inside@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1156 <mem_block_overlap+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <mem_block_inside@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_block_overlap>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <mem_block_inside@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1142 <mem_block_overlap+0x32>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <mem_block_inside@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.mem_block = type { i32 }
define i32 @mem_block_overlap(%struct.mem_block* %0, %struct.mem_block* %1) {
%3 = alloca %struct.mem_block*
%4 = alloca %struct.mem_block*
store %struct.mem_block* %0, %struct.mem_block** %3
store %struct.mem_block* %1, %struct.mem_block** %4
%5 = load %struct.mem_block*, %struct.mem_block** %3
%6 = load %struct.mem_block*, %struct.mem_block** %4
%7 = call i64 @mem_block_inside(%struct.mem_block* %5, %struct.mem_block* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load %struct.mem_block*, %struct.mem_block** %4
%11 = load %struct.mem_block*, %struct.mem_block** %3
%12 = call i64 @mem_block_inside(%struct.mem_block* %10, %struct.mem_block* %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
%struct.mem_block = type { i32 }
define i32 @mem_block_overlap(%struct.mem_block* %0, %struct.mem_block* %1) {
%3 = tail call i64 @mem_block_inside(%struct.mem_block* %0, %struct.mem_block* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @mem_block_inside(%struct.mem_block* %1, %struct.mem_block* %0)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void printchar(char **str, int c) {
  if (str) {
    **str = c;
    ++(*str);
  } else
    (void)putchar(c);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @putchar(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
__attribute__((no)) void bar(int x) { asm volatile("" : : "r"(x) : "memory"); }


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

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

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

LLVM IR (-O2):
define void @bar(i32 %0) {
tail call void asm sideeffect "", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void f3(char *s) {
  s[0] = 'C';
  printf("f3: %s %lu\n", s, strlen(s));
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x43,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %rdi,%rbx
movb   $0x43,(%rdi)
call   1030 <strlen@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"f3: %s %lu\0A\00"
define void @f3(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 67, i8* %4
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"f3: %s %lu\0A\00"
define void @f3(i8* %0) {
store i8 67, i8* %0
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ border(char, char, char, char, char, char, char, char);
int tty_border() {
  border('|', '|', '-', '-', '+', '+', '+', '+');
  return 0;
}


x86 assembly (clang, -O0):
<tty_border>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7c,%esi
mov    $0x2d,%ecx
mov    $0x2b,%r9d
mov    %esi,%edi
mov    %ecx,%edx
mov    %r9d,%r8d
movl   $0x2b,(%rsp)
movl   $0x2b,0x8(%rsp)
call   1030 <border@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_border>:
push   %rax
mov    $0x7c,%edi
mov    $0x7c,%esi
mov    $0x2d,%edx
mov    $0x2d,%ecx
mov    $0x2b,%r8d
mov    $0x2b,%r9d
push   $0x2b
push   $0x2b
call   1030 <border@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tty_border() {
%1 = call i32 @border(i8 signext 124, i8 signext 124, i8 signext 45, i8 signext 45, i8 signext 43, i8 signext 43, i8 signext 43, i8 signext 43)
ret i32 0
}

LLVM IR (-O2):
define i32 @tty_border() {
%1 = tail call i32 @border(i8 signext 124, i8 signext 124, i8 signext 45, i8 signext 45, i8 signext 43, i8 signext 43, i8 signext 43, i8 signext 43)
ret i32 0
}
void __attribute__((no)) gps_norm(float dst, long f) { dst = f / 10000000.0f; }


x86 assembly (clang, -O0):
<gps_norm>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cvtsi2ssq -0x10(%rbp),%xmm0
movss  0xee5(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gps_norm(float %0, i64 %1) {
%3 = alloca float
%4 = alloca i64
store float %0, float* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to float
%7 = fdiv float %6, 1.000000e+07
store float %7, float* %3
ret void
}

LLVM IR (-O2):
define void @gps_norm(float %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _sha2_str(unsigned char *, unsigned char const *,
                             unsigned long long);
int expand_sha2(unsigned char *, unsigned int, unsigned char *);
int sha2_chain_msg(unsigned char *digest, unsigned n_digest,
                   const unsigned char *m, unsigned long long mlen) {
  unsigned char hash[(32)];
  _sha2_str(hash, m, mlen);
  return expand_sha2(digest, n_digest, hash);
}


x86 assembly (clang, -O0):
<sha2_chain_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <_sha2_str@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1040 <expand_sha2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha2_chain_msg>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <_sha2_str@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <expand_sha2@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sha2_chain_msg(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca [32 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @_sha2_str(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%17 = call i32 @expand_sha2(i8* %14, i32 %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @sha2_chain_msg(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = call i32 @_sha2_str(i8* %6, i8* %2, i64 %3)
%8 = call i32 @expand_sha2(i8* %0, i32 %1, i8* %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ log(char const);
void an(const char *str) {
  const char sorry = 'Develop in progress...';
  log(sorry);
}


x86 assembly (clang, -O0):
<an>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x2e,-0x9(%rbp)
mov    $0x2e,%edi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<an>:
mov    $0x2e,%edi
jmp    1030 <log@plt>

LLVM IR (-O0):
define void @an(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 46, i8* %3
%4 = call i32 @log(i8 signext 46)
ret void
}

LLVM IR (-O2):
define void @an(i8* nocapture readnone %0) {
%2 = tail call i32 @log(i8 signext 46)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t copy_64bit(char *ptr) { return *(uint64_t *)ptr; }


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

x86 assembly (clang, -O2):
<copy_64bit>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @copy_64bit(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep_ms(int);
int main(int argc, char *argv[]) {
  sleep_ms(100);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sleep_ms(i32 100)
ret i32 0
}
int cmpfuncD(const void *a, const void *b) {
  if (*(float *)a - *(float *)b < 0)
    return -1;
  if (*(float *)a - *(float *)b > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmpfuncD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
jbe    1134 <cmpfuncD+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <cmpfuncD+0x63>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    115c <cmpfuncD+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <cmpfuncD+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpfuncD>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpfuncD(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to float*
%8 = load float, float* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
%12 = fsub float %8, %11
%13 = fcmp olt float %12, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %26
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to float*
%18 = load float, float* %17
%19 = load i8*, i8** %5
%20 = bitcast i8* %19 to float*
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = fcmp ogt float %22, 0.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %15
store i32 1, i32* %3
br label %26
25: ; preds = %15
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %14
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @cmpfuncD(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fsub float %4, %6
%8 = fcmp olt float %7, 0.000000e+00
%9 = fcmp ogt float %7, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
void RTAssertAreQuiet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAssertAreQuiet() {
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int errno;
int getsockname(int, struct sockaddr *, int /*<<< orphan*/ *);
int __sulong_posix_getsockname(int sockfd, struct sockaddr *addr,
                               socklen_t *addrlen) {
  {
    int native_errno = errno;
    int result = getsockname(sockfd, addr, addrlen);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_getsockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <getsockname@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    115c <__sulong_posix_getsockname+0x4c>
xor    %eax,%eax
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    0x2e7a(%rip),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_getsockname>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <getsockname@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @__sulong_posix_getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%9 = load i32, i32* @errno
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load %struct.sockaddr*, %struct.sockaddr** %5
%12 = load i32*, i32** %6
%13 = call i32 @getsockname(i32 %10, %struct.sockaddr* %11, i32* %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %21
16: ; preds = %3
%17 = load i32, i32* @errno
%18 = sub nsw i32 0, %17
%19 = sext i32 %18 to i64
%20 = trunc i64 %19 to i32
store i32 %20, i32* %8
br label %21
21: ; preds = %16, %3
%22 = load i32, i32* %7
store i32 %22, i32* @errno
%23 = load i32, i32* %8
ret i32 %23
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @__sulong_posix_getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = load i32, i32* @errno
%5 = tail call i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %2)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %8, i32 %5
store i32 %4, i32* @errno
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ X_OK;
int /*<<< orphan*/ access(char const *, int /*<<< orphan*/);
int can_exec(const char *file) { return !access(file, X_OK); }


x86 assembly (clang, -O0):
<can_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_exec>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@X_OK = global i32 0
define i32 @can_exec(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @X_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@X_OK = global i32 0
define i32 @can_exec(i8* nocapture %0) {
%2 = load i32, i32* @X_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @usb_enable_intel_xhci_ports(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int fib(int);
int fibindex(int n) {
  int temp;
  temp = 1;
  while (fib(temp) <= n + 1) {
    temp++;
  }
  return temp - 1;
}


x86 assembly (clang, -O0):
<fibindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fib@plt>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1146 <fibindex+0x36>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <fibindex+0x12>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibindex>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
add    $0x1,%ebp
mov    $0xffffffff,%ebx
nopl   (%rax)
lea    0x2(%rbx),%edi
call   1030 <fib@plt>
add    $0x1,%ebx
cmp    %ebp,%eax
jle    1120 <fibindex+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibindex(i32 %0) {
%2 = add nsw i32 %0, 1
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 1, %1 ], [ %7, %3 ]
%5 = tail call i32 @fib(i32 %4)
%6 = icmp sgt i32 %5, %2
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = add nsw i32 %4, -1
ret i32 %9
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t from_bcd16(uint16_t bcd) {
  return (bcd & 0x000f) + ((bcd & 0x00f0) >> 4) * 10 +
         ((bcd & 0x0f00) >> 8) * 100 + ((bcd & 0xf000) >> 12) * 1000;
}


x86 assembly (clang, -O0):
<from_bcd16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0,%ecx
sar    $0x4,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xf00,%ecx
sar    $0x8,%ecx
imul   $0x64,%ecx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xf000,%ecx
sar    $0xc,%ecx
imul   $0x3e8,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_bcd16>:
mov    %edi,%eax
and    $0xf,%eax
mov    %edi,%ecx
shr    $0x4,%ecx
and    $0xf,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rax,%rcx,2),%eax
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xf,%ecx
imul   $0x64,%ecx,%ecx
add    %eax,%ecx
shr    $0xc,%edi
and    $0xf,%edi
imul   $0x3e8,%edi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @from_bcd16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = load i32, i32* %2
%6 = and i32 %5, 240
%7 = ashr i32 %6, 4
%8 = mul nsw i32 %7, 10
%9 = add nsw i32 %4, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 3840
%12 = ashr i32 %11, 8
%13 = mul nsw i32 %12, 100
%14 = add nsw i32 %9, %13
%15 = load i32, i32* %2
%16 = and i32 %15, 61440
%17 = ashr i32 %16, 12
%18 = mul nsw i32 %17, 1000
%19 = add nsw i32 %14, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @from_bcd16(i32 %0) {
%2 = and i32 %0, 15
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = mul nuw nsw i32 %4, 10
%6 = add nuw nsw i32 %5, %2
%7 = lshr i32 %0, 8
%8 = and i32 %7, 15
%9 = mul nuw nsw i32 %8, 100
%10 = add nuw nsw i32 %6, %9
%11 = lshr i32 %0, 12
%12 = and i32 %11, 15
%13 = mul nuw nsw i32 %12, 1000
%14 = add nuw nsw i32 %10, %13
ret i32 %14
}
void mpi_init() {}


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

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

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

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

/* Variables and functions */
unsigned int xatoull_range_sfx(char const *, unsigned int, unsigned int,
                               struct suffix_mult const *);
__attribute__((always_)) unsigned int
xatou_range_sfx(const char *str, unsigned int l, unsigned int u,
                const struct suffix_mult *sfx) {
  return xatoull_range_sfx(str, l, u, sfx);
}


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

x86 assembly (clang, -O2):
<xatou_range_sfx>:
jmp    1030 <xatoull_range_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i32 @xatou_range_sfx(i8* %0, i32 %1, i32 %2, %struct.suffix_mult* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.suffix_mult*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.suffix_mult* %3, %struct.suffix_mult** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load %struct.suffix_mult*, %struct.suffix_mult** %8
%13 = call i32 @xatoull_range_sfx(i8* %9, i32 %10, i32 %11, %struct.suffix_mult* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i32 @xatou_range_sfx(i8* %0, i32 %1, i32 %2, %struct.suffix_mult* %3) {
%5 = tail call i32 @xatoull_range_sfx(i8* %0, i32 %1, i32 %2, %struct.suffix_mult* %3)
ret i32 %5
}
/* Variables and functions */
void Default_BusFault_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_BusFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_BusFault_Handler+0x9>
jmp    1109 <Default_BusFault_Handler+0x9>

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

LLVM IR (-O0):
define void @Default_BusFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_BusFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ afree(char *);
char *alloc(int);
int /*<<< orphan*/ printf(char *, char);
main() {
  char *p;
  p = alloc(10);
  p[0] = 1;
  printf("%d\n", p[0]);
  afree(p);
  printf("%d\n", p[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1050 <alloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x8(%rbp),%rax
lea    0xea8(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <afree@plt>
mov    -0x8(%rbp),%rax
lea    0xe8c(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xa,%edi
call   1050 <alloc@plt>
mov    %rax,%rbx
movb   $0x1,(%rax)
lea    0xeb5(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <afree@plt>
movsbl (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i8* @alloc(i32 10)
store i8 1, i8* %1
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 1)
%3 = tail call i32 @afree(i8* %1)
%4 = load i8, i8* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
void foreground_() {}


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

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

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

LLVM IR (-O2):
define void @foreground_() {
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_event_exit(void *e, int code) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_exit>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_exit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_exit(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int create_server(int);
int /*<<< orphan*/ start(int);
int main(void) {
  int server = create_server(8080);
  start(server);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @create_server(i32 8080)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @start(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @create_server(i32 8080)
%2 = tail call i32 @start(i32 %1)
ret i32 0
}
int rtl839x_mac_port_ctrl(int p) { return (0x8004) + (p << 7); }


x86 assembly (clang, -O0):
<rtl839x_mac_port_ctrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x7,%eax
add    $0x8004,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl839x_mac_port_ctrl>:
shl    $0x7,%edi
lea    0x8004(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rtl839x_mac_port_ctrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 7
%5 = add nsw i32 32772, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rtl839x_mac_port_ctrl(i32 %0) {
%2 = shl i32 %0, 7
%3 = add nsw i32 %2, 32772
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  char a;
  short b;
  printf("%d %d\n", sizeof(char), sizeof(a));
  printf("%d %d\n", sizeof(short), sizeof(b));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
ret i32 0
}
/* Variables and functions */
int __ispunct_impl(int);
int ispunct(int c) { return __ispunct_impl(c); }


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

x86 assembly (clang, -O2):
<ispunct>:
jmp    1030 <__ispunct_impl@plt>

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

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i32 @__ispunct_impl(i32 %0)
ret i32 %2
}
void rop3_228_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ S;
  stk2 = *D & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_228_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_228_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_228_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %6
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_228_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x90() {
  Assert_real((isupper(144) == 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_isupper.c",
              725, ("isupper should be 0 for 0x90"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x90>:
push   %rax
mov    $0x90,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d5,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x90\00"
define void @t_isupper_0x90() {
%1 = call i64 @isupper(i32 144)
%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 725, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x90\00"
define void @t_isupper_0x90() {
%1 = tail call i64 @isupper(i32 144)
%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 725, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XESetFreeFont() {
  printf("XESetFreeFont called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"XESetFreeFont called\00"
define i32 @XESetFreeFont() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
AX0AR1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (((char *)10000000)[x0]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<AX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x43d11(%rax),%dl
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AR1>:
mov    0x43d11(%r9),%al
movslq %edx,%rcx
mov    %al,0x989680(%rcx)
ret

LLVM IR (-O0):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %13
%17 = getelementptr inbounds i8, i8* %16, i64 277777
%18 = load i8, i8* %17
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %20
store i8 %18, i8* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = getelementptr inbounds i8, i8* %5, i64 277777
%8 = load i8, i8* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %9
store i8 %8, i8* %10
ret i32 undef
}
int fun_in_debug_so(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<fun_in_debug_so>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @fun_in_debug_so(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fun_in_debug_so(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void write_nchar(int fd, char *s, int n) { write(fd, s, n); }


x86 assembly (clang, -O0):
<write_nchar>:
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
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_nchar>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @write_nchar(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 @write(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @write_nchar(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret void
}
void fa75(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    p01C:
      goto p01C;
      goto a;
    a:
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa75>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa75+0x4>

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

LLVM IR (-O0):
define void @fa75() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa75() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int test(const char *string) {
  printf("Hello ");
  printf("%s", string);
  printf("!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hello \00"
@.str.1 = [3 x i8] c"%s\00"
@str = [2 x i8] c"!\00"
define i32 @test(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int Cyc_Core_charcmp(char a, char b) { return (int)a - (int)b; }


x86 assembly (clang, -O0):
<Cyc_Core_charcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Cyc_Core_charcmp(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @Cyc_Core_charcmp(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void AllocError(const char *str) {
  fflush(stdout);
  fprintf(stderr, "%s failed: ", str);
  perror("");
  exit(4);
}


x86 assembly (clang, -O0):
<AllocError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xe91(%rip),%rdi
call   1050 <perror@plt>
mov    $0x4,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<AllocError>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
lea    0xe9a(%rip),%rdi
call   1050 <perror@plt>
mov    $0x4,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [12 x i8] c"%s failed: \00"
@.str.1 = [1 x i8] zeroinitializer
define void @AllocError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 4)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [12 x i8] c"%s failed: \00"
@.str.1 = [1 x i8] zeroinitializer
define void @AllocError(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 4)
unreachable
}