xunge/DecIR huggingface dataset:
void rop3_34_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~S;
  stk1 = *D & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_34_0_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 -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_34_0_1>:
mov    %esi,%eax
not    %eax
movzbl (%rdi),%r8d
mov    %r8d,%ecx
and    %eax,%ecx
and    %ecx,%esi
and    %edx,%eax
not    %edx
and    %ecx,%edx
and    %r8d,%eax
or     %esi,%eax
or     %edx,%eax
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_34_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %1 to i32
%5 = xor i32 %4, -1
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = trunc i32 %5 to i8
%9 = and i8 %6, %8
%10 = zext i8 %9 to i32
%11 = and i8 %9, %1
%12 = zext i8 %11 to i32
%13 = zext i8 %2 to i32
%14 = xor i32 %13, -1
%15 = and i32 %10, %14
%16 = and i32 %13, %5
%17 = and i32 %16, %7
%18 = or i32 %17, %12
%19 = or i32 %18, %15
%20 = trunc i32 %19 to i8
store i8 %20, i8* %0
ret void
}
/* Variables and functions */
int WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
scalar_t__ WIFSIGNALED(int);
int WTERMSIG(int);
int /*<<< orphan*/ abort();
int child_status_to_exit_code(int status) {
  if (WIFEXITED(status))
    return WEXITSTATUS(status);
  if (WIFSIGNALED(status))
    return 128 + WTERMSIG(status);
  abort();
}


x86 assembly (clang, -O0):
<child_status_to_exit_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1070 <WIFEXITED@plt>
cmp    $0x0,%rax
je     117d <child_status_to_exit_code+0x2d>
mov    -0x8(%rbp),%edi
call   1060 <WEXITSTATUS@plt>
mov    %eax,-0x4(%rbp)
jmp    11ab <child_status_to_exit_code+0x5b>
mov    -0x8(%rbp),%edi
call   1040 <WIFSIGNALED@plt>
cmp    $0x0,%rax
je     11a4 <child_status_to_exit_code+0x54>
mov    -0x8(%rbp),%edi
call   1050 <WTERMSIG@plt>
add    $0x80,%eax
mov    %eax,-0x4(%rbp)
jmp    11ab <child_status_to_exit_code+0x5b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_status_to_exit_code>:
push   %rbx
mov    %edi,%ebx
call   1070 <WIFEXITED@plt>
test   %rax,%rax
je     1165 <child_status_to_exit_code+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <WEXITSTATUS@plt>
mov    %ebx,%edi
call   1040 <WIFSIGNALED@plt>
test   %rax,%rax
je     117d <child_status_to_exit_code+0x2d>
mov    %ebx,%edi
call   1050 <WTERMSIG@plt>
sub    $0xffffff80,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @child_status_to_exit_code(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @WIFEXITED(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @WEXITSTATUS(i32 %8)
store i32 %9, i32* %2
br label %20
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i64 @WIFSIGNALED(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %3
%16 = call i32 @WTERMSIG(i32 %15)
%17 = add nsw i32 128, %16
store i32 %17, i32* %2
br label %20
18: ; preds = %10
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %14, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @child_status_to_exit_code(i32 %0) {
%2 = tail call i64 @WIFEXITED(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @WEXITSTATUS(i32 %0)
br label %14
6: ; preds = %1
%7 = tail call i64 @WIFSIGNALED(i32 %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 @WTERMSIG(i32 %0)
%11 = add nsw i32 %10, 128
br label %14
12: ; preds = %6
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %9, %4
%15 = phi i32 [ %5, %4 ], [ %11, %9 ]
ret i32 %15
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t QEIDirectionGet(uint32_t ui32Base) {
  ;
  return (((*((volatile unsigned long *)(ui32Base + 0x00000004))) & 0x00000002)
              ? -1
              : 1);
}


x86 assembly (clang, -O0):
<QEIDirectionGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rdx
and    $0x2,%rdx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIDirectionGet>:
mov    0x4(%rdi),%rax
and    $0x2,%eax
neg    %rax
sbb    %eax,%eax
or     $0x1,%eax
ret

LLVM IR (-O0):
define i32 @QEIDirectionGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 2
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @QEIDirectionGet(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 2
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 1, i32 -1
ret i32 %7
}
/* Type definitions */
struct iax_session {
  int dummy;
};

/* Variables and functions */
int send_command(struct iax_session *, int, int, int /*<<< orphan*/,
                 unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char *);
int iax_sendurl(struct iax_session *session, char *url) {
  return send_command(session, 9, 1, 0, (unsigned char *)url, strlen(url), -1);
}


x86 assembly (clang, -O0):
<iax_sendurl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%r8
mov    %eax,%r9d
mov    $0x9,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
movl   $0xffffffff,(%rsp)
call   1040 <send_command@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iax_sendurl>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
movl   $0xffffffff,(%rsp)
mov    %r14,%rdi
mov    $0x9,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %eax,%r9d
call   1040 <send_command@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.iax_session = type { i32 }
define i32 @iax_sendurl(%struct.iax_session* %0, i8* %1) {
%3 = alloca %struct.iax_session*
%4 = alloca i8*
store %struct.iax_session* %0, %struct.iax_session** %3
store i8* %1, i8** %4
%5 = load %struct.iax_session*, %struct.iax_session** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @send_command(%struct.iax_session* %5, i32 9, i32 1, i32 0, i8* %6, i32 %8, i32 -1)
ret i32 %9
}

LLVM IR (-O2):
%struct.iax_session = type { i32 }
define i32 @iax_sendurl(%struct.iax_session* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send_command(%struct.iax_session* %0, i32 9, i32 1, i32 0, i8* %1, i32 %3, i32 -1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
main() {
  system("perl -e "
         "'<>;%h=();$c=$s=\"\";while(<>){chop($_);@h{$_}=@h{$_}?@h{$_}+1:1;}"
         "for(sort(keys%h)){$r=reverse$_;if($r eq$_){$c.=$_ "
         "x@h{$_};}if(@h{$r}&&$_ lt$r){$s.=$_;}}print$s.$c.reverse($s);'");
}


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

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

LLVM IR (-O0):
@.str = [185 x i8] c"perl -e '<>;%h=();$c=$s=\22\22;while(<>){chop($_);@h{$_}=@h{$_}?@h{$_}+1:1;}for(sort(keys%h)){$r=reverse$_;if($r eq$_){$c.=$_ x@h{$_};}if(@h{$r}&&$_ lt$r){$s.=$_;}}print$s.$c.reverse($s);'\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [185 x i8] c"perl -e '<>;%h=();$c=$s=\22\22;while(<>){chop($_);@h{$_}=@h{$_}?@h{$_}+1:1;}for(sort(keys%h)){$r=reverse$_;if($r eq$_){$c.=$_ x@h{$_};}if(@h{$r}&&$_ lt$r){$s.=$_;}}print$s.$c.reverse($s);'\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test(int);
int main(void) {
  test(0);
  test(1);
  printf("OK\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <test@plt>
mov    $0x1,%edi
call   1040 <test@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 @test(i32 0)
%2 = tail call i32 @test(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
char *_intoa(unsigned int, char *, int);
char *intoa(unsigned int addr) {
  static char buf[sizeof "ff:ff:ff:ff:ff:ff:255.255.255.255"];
  return (_intoa(addr, buf, sizeof(buf)));
}


x86 assembly (clang, -O0):
<intoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x22,%edx
call   1030 <_intoa@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intoa>:
lea    0x2f29(%rip),%rsi
mov    $0x22,%edx
jmp    1030 <_intoa@plt>

LLVM IR (-O0):
@intoa.buf = internal global [34 x i8] zeroinitializer
define i8* @intoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @_intoa(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @intoa.buf, i64 0, i64 0), i32 34)
ret i8* %4
}

LLVM IR (-O2):
@intoa.buf = internal global [34 x i8] zeroinitializer
define i8* @intoa(i32 %0) {
%2 = tail call i8* @_intoa(i32 %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @intoa.buf, i64 0, i64 0), i32 34)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
f(int *p) { exit(*p); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    (%rdi),%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @f(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void set_sock_block(int sockfd) {
  int arg = fcntl(sockfd, F_GETFL, NULL);
  arg &= (~O_NONBLOCK);
  fcntl(sockfd, F_SETFL, arg);
}


x86 assembly (clang, -O0):
<set_sock_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sock_block>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
mov    (%rcx),%edx
not    %edx
and    %eax,%edx
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @set_sock_block(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* @O_NONBLOCK
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = and i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %3
%14 = call i32 @fcntl(i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @set_sock_block(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @O_NONBLOCK
%5 = xor i32 %4, -1
%6 = and i32 %3, %5
%7 = load i32, i32* @F_SETFL
%8 = tail call i32 @fcntl(i32 %0, i32 %7, i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strdup(const char *s) {
  char *result;
  int len = strlen(s);
  result = (char *)malloc(len + 1);
  memcpy(result, s, len + 1);
  return result;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = call i32 @memcpy(i8* %11, i8* %12, i32 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %3)
ret i8* %5
}
/* Variables and functions */
int sv_open_slot(int);
int vox_open_slot(int slot) { return sv_open_slot(slot); }


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

x86 assembly (clang, -O2):
<vox_open_slot>:
jmp    1030 <sv_open_slot@plt>

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

LLVM IR (-O2):
define i32 @vox_open_slot(i32 %0) {
%2 = tail call i32 @sv_open_slot(i32 %0)
ret i32 %2
}
void nx_gui_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @nx_gui_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int *arr, int size) {
  for (int i = 0; i < size; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t LEFT_ROTATE(uint32_t x, uint32_t n) {
  return (x << n) | (x >> (32 - n));
}


x86 assembly (clang, -O0):
<LEFT_ROTATE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEFT_ROTATE>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @LEFT_ROTATE(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @LEFT_ROTATE(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_getn_wstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_getn_wstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_getn_wstr+0x2a>
jmp    1170 <cmd_getn_wstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_getn_wstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_getn_wstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_getn_wstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
void X509_PURPOSE_get_by_sname(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_PURPOSE_get_by_sname() {
ret void
}
void RTStrPutCpInternal(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrPutCpInternal() {
ret void
}
int read_sign(char **ptr) {
  int bias = 1;
  if (**ptr == '+') {
    (*ptr)++;
  } else if (**ptr == '-') {
    bias = -1;
    (*ptr)++;
  }
  return bias;
}


x86 assembly (clang, -O0):
<read_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1135 <read_sign+0x35>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1162 <read_sign+0x62>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    115d <read_sign+0x5d>
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1162 <read_sign+0x62>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_sign>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
mov    $0x1,%eax
cmp    $0x2b,%dl
je     1119 <read_sign+0x19>
cmp    $0x2d,%dl
jne    1120 <read_sign+0x20>
mov    $0xffffffff,%eax
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @read_sign(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
switch i8 %3, label %8 [
i8 43, label %5
i8 45, label %4
]
4: ; preds = %1
br label %5
5: ; preds = %1, %4
%6 = phi i32 [ -1, %4 ], [ 1, %1 ]
%7 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %7, i8** %0
br label %8
8: ; preds = %5, %1
%9 = phi i32 [ 1, %1 ], [ %6, %5 ]
ret i32 %9
}
void debug_printf(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug_printf(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int imd_type_valid(uint32_t type) { return (type & 0xffff0000) == 0x640c0000; }


x86 assembly (clang, -O0):
<imd_type_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
cmp    $0x640c0000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imd_type_valid>:
and    $0xffff0000,%edi
xor    %eax,%eax
cmp    $0x640c0000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @imd_type_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -65536
%5 = icmp eq i32 %4, 1678508032
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @imd_type_valid(i32 %0) {
%2 = and i32 %0, -65536
%3 = icmp eq i32 %2, 1678508032
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fen_board(char *);
char *play(int, int);
char *playFen(char *fen, int depth, int time) {
  fen_board(fen);
  return play(depth, time);
}


x86 assembly (clang, -O0):
<playFen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fen_board@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <play@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playFen>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <fen_board@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <play@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
FILE *appaserver_user_update_open(void) {
  char sys_string[2048];
  sprintf(sys_string,
          "update_statement table=%s key=%s carrot=y	|"
          "tee_appaserver_error.sh 			|"
          "sql						 ",
          "appaserver_user", "login_name");
  return popen(sys_string, "w");
}


x86 assembly (clang, -O0):
<appaserver_user_update_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
lea    -0x800(%rbp),%rdi
lea    0xec7(%rip),%rsi
lea    0xf12(%rip),%rdx
lea    0xf1b(%rip),%rcx
call   1040 <sprintf@plt>
lea    -0x800(%rbp),%rdi
lea    0xf13(%rip),%rsi
call   1030 <popen@plt>
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_user_update_open>:
push   %rbx
sub    $0x800,%rsp
lea    0xed1(%rip),%rsi
lea    0xf1c(%rip),%rdx
lea    0xf25(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xf1e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <popen@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [82 x i8] c"update_statement table=%s key=%s carrot=y\09|tee_appaserver_error.sh \09\09\09|sql\09\09\09\09\09\09 \00"
@.str.1 = [16 x i8] c"appaserver_user\00"
@.str.2 = [11 x i8] c"login_name\00"
@.str.3 = [2 x i8] c"w\00"
define i32* @appaserver_user_update_open() {
%1 = alloca [2048 x i8]
%2 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%5 = call i32* @popen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32* %5
}

LLVM IR (-O2):
@.str = [82 x i8] c"update_statement table=%s key=%s carrot=y\09|tee_appaserver_error.sh \09\09\09|sql\09\09\09\09\09\09 \00"
@.str.1 = [16 x i8] c"appaserver_user\00"
@.str.2 = [11 x i8] c"login_name\00"
@.str.3 = [2 x i8] c"w\00"
define noalias i32* @appaserver_user_update_open() {
%1 = alloca [2048 x i8]
%2 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32* @popen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ print_gap(int, int /*<<< orphan*/ *);
void print_other(FILE *fp) {
  print_gap(2, fp);
  fprintf(fp, "OTHER\n=====");
  print_gap(7, fp);
}


x86 assembly (clang, -O0):
<print_other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
call   1030 <print_gap@plt>
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rsi
mov    $0x7,%edi
call   1030 <print_gap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_other>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <print_gap@plt>
lea    0xec8(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <print_gap@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"OTHER\0A=====\00"
define void @print_other(i32* %0) {
%2 = tail call i32 @print_gap(i32 2, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %0)
%4 = tail call i32 @print_gap(i32 7, i32* %0)
ret void
}
void IPCMtoCFlagClear(unsigned long ulFlags) {
  (*((volatile unsigned long *)(0x400FB700 + 0x00000000C))) |= ulFlags;
}


x86 assembly (clang, -O0):
<IPCMtoCFlagClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400fb70c,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fb70c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPCMtoCFlagClear>:
or     %rdi,0x400fb70c
40
ret

LLVM IR (-O0):
define void @IPCMtoCFlagClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074771724 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074771724 to i64*)
ret void
}

LLVM IR (-O2):
define void @IPCMtoCFlagClear(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074771724 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074771724 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *my_calloc(int, int);
void test_alloc_and_free() {
  void *x = my_calloc(2000, 1024 * 20);
  free(x);
}


x86 assembly (clang, -O0):
<test_alloc_and_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7d0,%edi
mov    $0x5000,%esi
call   1040 <my_calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_alloc_and_free>:
push   %rax
mov    $0x7d0,%edi
mov    $0x5000,%esi
call   1040 <my_calloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @test_alloc_and_free() {
%1 = alloca i8*
%2 = call i8* @my_calloc(i32 2000, i32 20480)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @test_alloc_and_free() {
%1 = tail call i8* @my_calloc(i32 2000, i32 20480)
%2 = tail call i32 @free(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
scalar_t__ ceph_frag_bits(int /*<<< orphan*/);
int /*<<< orphan*/ ceph_frag_make(scalar_t__, int);
int ceph_frag_mask(int /*<<< orphan*/);
int ceph_frag_value(int /*<<< orphan*/);
__u32 ceph_frag_parent(__u32 f) {
  return ceph_frag_make(ceph_frag_bits(f) - 1,
                        ceph_frag_value(f) & (ceph_frag_mask(f) << 1));
}


x86 assembly (clang, -O0):
<ceph_frag_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ceph_frag_bits@plt>
sub    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <ceph_frag_value@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <ceph_frag_mask@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdi
shl    $0x1,%eax
and    %eax,%esi
call   1040 <ceph_frag_make@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_frag_parent>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <ceph_frag_bits@plt>
lea    -0x1(%rax),%r14
mov    %ebx,%edi
call   1050 <ceph_frag_value@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1060 <ceph_frag_mask@plt>
lea    (%rax,%rax,1),%esi
and    %ebp,%esi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ceph_frag_make@plt>

LLVM IR (-O0):
define i32 @ceph_frag_parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ceph_frag_bits(i32 %3)
%5 = sub nsw i64 %4, 1
%6 = load i32, i32* %2
%7 = call i32 @ceph_frag_value(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @ceph_frag_mask(i32 %8)
%10 = shl i32 %9, 1
%11 = and i32 %7, %10
%12 = call i32 @ceph_frag_make(i64 %5, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @ceph_frag_parent(i32 %0) {
%2 = tail call i64 @ceph_frag_bits(i32 %0)
%3 = add nsw i64 %2, -1
%4 = tail call i32 @ceph_frag_value(i32 %0)
%5 = tail call i32 @ceph_frag_mask(i32 %0)
%6 = shl i32 %5, 1
%7 = and i32 %6, %4
%8 = tail call i32 @ceph_frag_make(i64 %3, i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x0d() {
  Assert_real((isdigit(13) == 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_isdigit.c",
              70, ("isdigit should be 0 for 0x0d"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x0d>:
push   %rax
mov    $0xd,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x0d\00"
define void @t_isdigit_0x0d() {
%1 = call i64 @isdigit(i32 13)
%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 70, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x0d\00"
define void @t_isdigit_0x0d() {
%1 = tail call i64 @isdigit(i32 13)
%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 70, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_AAuint8_reg(unsigned char val) {
  return ((val) & (-0xAA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AAuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff56,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_AAuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -170
%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_AAuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 86
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *calloc(size_t, int);
int /*<<< orphan*/ fatal(char *);
void *ckalloc(size_t bytes) {
  register void *ret;
  if ((ret = calloc(bytes, sizeof(char))) == NULL)
    fatal("Out of memory\n");
  else
    return ret;
  return ret;
}


x86 assembly (clang, -O0):
<ckalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1159 <ckalloc+0x39>
lea    0xeb1(%rip),%rdi
call   1040 <fatal@plt>
jmp    1166 <ckalloc+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <ckalloc+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckalloc>:
push   %rbx
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <ckalloc+0x1f>
lea    0xec6(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @ckalloc(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ _exit_error(int, char *);
void _ensure_argc(int line, int needed, int argc) {
  if (argc < needed)
    _exit_error(line, "Incomplete argument");
}


x86 assembly (clang, -O0):
<_ensure_argc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113c <_ensure_argc+0x2c>
mov    -0x4(%rbp),%edi
lea    0xec9(%rip),%rsi
call   1030 <_exit_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_argc>:
cmp    %esi,%edx
jge    1120 <_ensure_argc+0x10>
lea    0xee5(%rip),%rsi
jmp    1030 <_exit_error@plt>
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Incomplete argument\00"
define void @_ensure_argc(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @_exit_error(i32 %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Main();
int /*<<< orphan*/ setup_memory();
int main() {
  setup_memory();
  Main();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <setup_memory@plt>
mov    $0x0,%al
call   1030 <Main@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @setup_memory()
%2 = call i32 (...) @Main()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_memory()
%2 = tail call i32 (...) @Main()
ret i32 0
}
int Problem045() { return 1; }


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

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

LLVM IR (-O0):
define i32 @Problem045() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Problem045() {
ret i32 1
}
void XtReleasePropertyAtom() {}


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

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

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

LLVM IR (-O2):
define void @XtReleasePropertyAtom() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ probability(int);
int /*<<< orphan*/ probability_mc(int, int);
double round(int /*<<< orphan*/);
int test_70() {
  return 0.99 == round(probability(70)) &&
         0.99 == round(probability_mc(70, 100000));
}


x86 assembly (clang, -O0):
<test_70>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x46,%edi
call   1030 <probability@plt>
mov    %eax,%edi
call   1050 <round@plt>
movaps %xmm0,%xmm1
xor    %eax,%eax
movsd  0xeaa(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x1(%rbp)
jne    1199 <test_70+0x69>
jp     1199 <test_70+0x69>
mov    $0x46,%edi
mov    $0x186a0,%esi
call   1040 <probability_mc@plt>
mov    %eax,%edi
call   1050 <round@plt>
movaps %xmm0,%xmm1
movsd  0xe76(%rip),%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_70>:
push   %rax
mov    $0x46,%edi
call   1030 <probability@plt>
mov    %eax,%edi
call   1050 <round@plt>
ucomisd 0xeb6(%rip),%xmm0
jne    1177 <test_70+0x47>
jp     1177 <test_70+0x47>
mov    $0x46,%edi
mov    $0x186a0,%esi
call   1040 <probability_mc@plt>
mov    %eax,%edi
call   1050 <round@plt>
cmpeqsd 0xe93(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_70() {
%1 = call i32 @probability(i32 70)
%2 = call double @round(i32 %1)
%3 = fcmp oeq double 0x3FEFAE147AE147AE, %2
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 @probability_mc(i32 70, i32 100000)
%6 = call double @round(i32 %5)
%7 = fcmp oeq double 0x3FEFAE147AE147AE, %6
br label %8
8: ; preds = %4, %0
%9 = phi i1 [ false, %0 ], [ %7, %4 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_70() {
%1 = tail call i32 @probability(i32 70)
%2 = tail call double @round(i32 %1)
%3 = fcmp oeq double %2, 0x3FEFAE147AE147AE
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i32 @probability_mc(i32 70, i32 100000)
%6 = tail call double @round(i32 %5)
%7 = fcmp oeq double %6, 0x3FEFAE147AE147AE
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ 0, %0 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *foo(char *p) {
  if (*p) {
    free(p);
    return 0;
  } else {
    return p;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <foo+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1147 <foo+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
cmpb   $0x0,(%rdi)
je     111d <foo+0xd>
call   1030 <free@plt>
xor    %edi,%edi
mov    %rdi,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @foo(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ null, %4 ], [ %0, %1 ]
ret i8* %7
}