xunge/DecIR huggingface dataset:
unsigned char inportb(unsigned short port) {
  unsigned char result;
  __asm__ __volatile__("inb %1, %0" : "=a"(result) : "dN"(port));
  return result;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
int ld(int x) {
  int ret = 0;
  while (x >>= 1)
    ret++;
  return ret;
}


x86 assembly (clang, -O0):
<ld>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <ld+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ld+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <ld+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <ld+0x10>
ret

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

LLVM IR (-O2):
define i32 @ld(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
char *h_name(int x) {
  static char s[5] = "B-G-";
  int i = x / 8;
  s[3] = s[1] = '1' + i;
  return s;
}


x86 assembly (clang, -O0):
<h_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x31,%eax
mov    %al,0x2f00(%rip)
mov    %al,0x2efc(%rip)
lea    0x2ef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_name>:
lea    0x7(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
shr    $0x3,%ecx
add    $0x31,%cl
mov    %cl,0x2f0d(%rip)
lea    0x2f05(%rip),%rax
mov    %cl,0x2f02(%rip)
ret

LLVM IR (-O0):
@h_name.s = internal global [5 x i8] c"B-G-\00"
define i8* @h_name(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 8
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 49, %6
%8 = trunc i32 %7 to i8
store i8 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @h_name.s, i64 0, i64 1)
store i8 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @h_name.s, i64 0, i64 3)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @h_name.s, i64 0, i64 0)
}

LLVM IR (-O2):
@h_name.s = internal global [5 x i8] c"B-G-\00"
define i8* @h_name(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = trunc i32 %2 to i8
%4 = add i8 %3, 49
store i8 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @h_name.s, i64 0, i64 1)
store i8 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @h_name.s, i64 0, i64 3)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @h_name.s, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ COND_GT();
int /*<<< orphan*/ EA_A7_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sgt_8_pd7(void) {
  m68ki_write_8(EA_A7_PD_8(), COND_GT() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sgt_8_pd7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_A7_PD_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_GT@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sgt_8_pd7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_A7_PD_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_GT@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sgt_8_pd7() {
%1 = call i32 (...) @EA_A7_PD_8()
%2 = call i64 (...) @COND_GT()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sgt_8_pd7() {
%1 = tail call i32 (...) @EA_A7_PD_8()
%2 = tail call i64 (...) @COND_GT()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Type definitions */
struct sockaddr_un {
  int /*<<< orphan*/ sun_path;
  int /*<<< orphan*/ sun_family;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
int do_connect(int s, char *name) {
  struct sockaddr_un sun;
  int length;
  sun.sun_family = AF_UNIX;
  (void)strcpy(sun.sun_path, name);
  length = sizeof(sun.sun_family) + sizeof(sun.sun_path);
  return connect(s, (struct sockaddr *)(&sun), length);
}


x86 assembly (clang, -O0):
<do_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x8,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <connect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_connect>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
call   1030 <strcpy@plt>
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
mov    $0x8,%edx
call   1040 <connect@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
@AF_UNIX = global i32 0
define i32 @do_connect(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.sockaddr_un
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* @AF_UNIX
%8 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %5, i32 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %5, i32 0, i32 0
%10 = load i32, i32* %9
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i32 %10, i8* %11)
store i32 8, i32* %6
%13 = load i32, i32* %3
%14 = bitcast %struct.sockaddr_un* %5 to %struct.sockaddr*
%15 = load i32, i32* %6
%16 = call i32 @connect(i32 %13, %struct.sockaddr* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
@AF_UNIX = global i32 0
define i32 @do_connect(i32 %0, i8* %1) {
%3 = alloca %struct.sockaddr_un
%4 = bitcast %struct.sockaddr_un* %3 to i8*
%5 = load i32, i32* @AF_UNIX
%6 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i64 0, i32 1
store i32 %5, i32* %6
%7 = tail call i32 @strcpy(i32 undef, i8* %1)
%8 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%9 = call i32 @connect(i32 %0, %struct.sockaddr* %8, i32 8)
ret i32 %9
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strlist_compare_strings(const void *a, const void *b) {
  const char *sa = *(const char **)a;
  const char *sb = *(const char **)b;
  return strcmp(sa, sb);
}


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

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

LLVM IR (-O0):
define i32 @strlist_compare_strings(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @strlist_compare_strings(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void response_complete(void *user_data) {}


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

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

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

LLVM IR (-O2):
define void @response_complete(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int rest(int c) { return isalpha(c) || c == '_' || isdigit(c); }


x86 assembly (clang, -O0):
<rest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1166 <rest+0x46>
mov    $0x1,%al
cmpl   $0x5f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1166 <rest+0x46>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rest>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    $0x5f,%ebx
je     114c <rest+0x2c>
test   %rcx,%rcx
jne    114c <rest+0x2c>
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rest(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i64 @isdigit(i32 %0)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
void f15(int a, int b, int c, int d, int e, int f, void *X) {}


x86 assembly (clang, -O0):
<f15>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f15(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i8* %6, i8** %14
ret void
}

LLVM IR (-O2):
define void @f15(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* nocapture %6) {
ret void
}
int iHxFaceGetPin(int iPinType, int iBypassFlag, unsigned char *psPin,
                  unsigned char *pszPan, unsigned char *pszPrompt1,
                  unsigned char *pszPrompt2, unsigned char *pszLanguage) {
  return (99);
}


x86 assembly (clang, -O0):
<iHxFaceGetPin>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x63,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iHxFaceGetPin(i32 %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
ret i32 99
}

LLVM IR (-O2):
define i32 @iHxFaceGetPin(i32 %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6) {
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ user_new(char *, char *);
int user_init(void) {
  (void)user_new("default", "c21f969b5f03d33d43e04f8f136e7682");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"default\00"
@.str.1 = [33 x i8] c"c21f969b5f03d33d43e04f8f136e7682\00"
define i32 @user_init() {
%1 = call i32 @user_new(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"default\00"
@.str.1 = [33 x i8] c"c21f969b5f03d33d43e04f8f136e7682\00"
define i32 @user_init() {
%1 = tail call i32 @user_new(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int f418(int *);
int f419(int *p) { return f418(p); }


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

x86 assembly (clang, -O2):
<f419>:
jmp    1030 <f418@plt>

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

LLVM IR (-O2):
define i32 @f419(i32* %0) {
%2 = tail call i32 @f418(i32* %0)
ret i32 %2
}
/* Type definitions */
struct pscnv_ib_chan {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ OUT_RING(struct pscnv_ib_chan *, int);
void BEGIN_RING_NVC0_CONST(struct pscnv_ib_chan *ch, int subc, int mthd,
                           int len) {
  OUT_RING(ch, (0x6 << 28) | (len << 16) | (subc << 13) | (mthd >> 2));
}


x86 assembly (clang, -O0):
<BEGIN_RING_NVC0_CONST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x10,%esi
or     $0x60000000,%esi
mov    -0xc(%rbp),%eax
shl    $0xd,%eax
or     %eax,%esi
mov    -0x10(%rbp),%eax
sar    $0x2,%eax
or     %eax,%esi
call   1030 <OUT_RING@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEGIN_RING_NVC0_CONST>:
shl    $0x10,%ecx
shl    $0xd,%esi
sar    $0x2,%edx
or     %edx,%esi
or     %ecx,%esi
or     $0x60000000,%esi
jmp    1030 <OUT_RING@plt>

LLVM IR (-O0):
%struct.pscnv_ib_chan = type { i32 }
define void @BEGIN_RING_NVC0_CONST(%struct.pscnv_ib_chan* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.pscnv_ib_chan*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.pscnv_ib_chan* %0, %struct.pscnv_ib_chan** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.pscnv_ib_chan*, %struct.pscnv_ib_chan** %5
%10 = load i32, i32* %8
%11 = shl i32 %10, 16
%12 = or i32 1610612736, %11
%13 = load i32, i32* %6
%14 = shl i32 %13, 13
%15 = or i32 %12, %14
%16 = load i32, i32* %7
%17 = ashr i32 %16, 2
%18 = or i32 %15, %17
%19 = call i32 @OUT_RING(%struct.pscnv_ib_chan* %9, i32 %18)
ret void
}

LLVM IR (-O2):
%struct.pscnv_ib_chan = type { i32 }
define void @BEGIN_RING_NVC0_CONST(%struct.pscnv_ib_chan* %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 16
%6 = shl i32 %1, 13
%7 = ashr i32 %2, 2
%8 = or i32 %6, %7
%9 = or i32 %8, %5
%10 = or i32 %9, 1610612736
%11 = tail call i32 @OUT_RING(%struct.pscnv_ib_chan* %0, i32 %10)
ret void
}
int exe$ssvexc(struct _fab *fab, void *err, void *suc) {
  printk("not implemented\n");
}


x86 assembly (clang, -O0):
<exe$ssvexc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe$ssvexc>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$ssvexc"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct._fab*
%6 = alloca i8*
%7 = alloca i8*
store %struct._fab* %0, %struct._fab** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$ssvexc"(%struct._fab* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int strcspn(char *, char *);
char *StripData(char *str, char *delim) {
  int idx = strcspn(str, delim);
  if (str[idx]) {
    str[idx] = 0;
    return str + idx + 1;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<StripData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcspn@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1166 <StripData+0x56>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116e <StripData+0x5e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StripData>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcspn@plt>
cltq
cmpb   $0x0,(%rbx,%rax,1)
je     112d <StripData+0x1d>
add    %rax,%rbx
movb   $0x0,(%rbx)
add    $0x1,%rbx
jmp    112f <StripData+0x1f>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @StripData(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strcspn(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
store i8 0, i8* %5
%9 = getelementptr inbounds i8, i8* %5, i64 1
br label %10
10: ; preds = %2, %8
%11 = phi i8* [ %9, %8 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void helloworld(char *string) {
  if (*string) {
    printf("%c", *string);
    helloworld(string + 1);
  }
}


x86 assembly (clang, -O0):
<helloworld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <helloworld+0x39>
mov    -0x8(%rbp),%rax
lea    0xebc(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <helloworld@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helloworld>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <helloworld+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <helloworld+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @helloworld(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void RTVfsObjFromSymlink(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsObjFromSymlink() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a = 0;
  printf("%ld\n", sizeof(a++));
  printf("%d\n", a);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ caddvrfield2(float *, float *, float *, int, int, int);
void caddvrfield2_(float *a, float *b, float *c, int *ndim, int *nxe,
                   int *nye) {
  caddvrfield2(a, b, c, *ndim, *nxe, *nye);
  return;
}


x86 assembly (clang, -O0):
<caddvrfield2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%rax
mov    (%rax),%r9d
call   1030 <caddvrfield2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caddvrfield2_>:
mov    (%rcx),%ecx
mov    (%r8),%r8d
mov    (%r9),%r9d
jmp    1030 <caddvrfield2@plt>

LLVM IR (-O0):
define void @caddvrfield2_(float* %0, float* %1, float* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load float*, float** %7
%14 = load float*, float** %8
%15 = load float*, float** %9
%16 = load i32*, i32** %10
%17 = load i32, i32* %16
%18 = load i32*, i32** %11
%19 = load i32, i32* %18
%20 = load i32*, i32** %12
%21 = load i32, i32* %20
%22 = call i32 @caddvrfield2(float* %13, float* %14, float* %15, i32 %17, i32 %19, i32 %21)
ret void
}

LLVM IR (-O2):
define void @caddvrfield2_(float* %0, float* %1, float* %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = tail call i32 @caddvrfield2(float* %0, float* %1, float* %2, i32 %7, i32 %8, i32 %9)
ret void
}
/* Variables and functions */
size_t pso_prs_max_compressed_size(size_t len) {
  len += 2;
  return len + (len >> 3) + ((len & 0x07) ? 1 : 0);
}


x86 assembly (clang, -O0):
<pso_prs_max_compressed_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x3,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rsi
and    $0x7,%rsi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%rsi
cmovne %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pso_prs_max_compressed_size>:
lea    0x2(%rdi),%rcx
mov    %rcx,%rax
shr    $0x3,%rax
add    %rdi,%rax
add    $0x2,%rax
and    $0x7,%ecx
cmp    $0x1,%rcx
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @pso_prs_max_compressed_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = load i64, i64* %2
%7 = lshr i64 %6, 3
%8 = add i64 %5, %7
%9 = load i64, i64* %2
%10 = and i64 %9, 7
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
%14 = sext i32 %13 to i64
%15 = add i64 %8, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @pso_prs_max_compressed_size(i64 %0) {
%2 = add i64 %0, 2
%3 = lshr i64 %2, 3
%4 = add i64 %3, %2
%5 = and i64 %2, 7
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = add i64 %4, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ lnxcdispPaint(int);
void lnxcDisplayPaint() { lnxcdispPaint(1); }


x86 assembly (clang, -O0):
<lnxcDisplayPaint>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <lnxcdispPaint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnxcDisplayPaint>:
mov    $0x1,%edi
jmp    1030 <lnxcdispPaint@plt>

LLVM IR (-O0):
define void @lnxcDisplayPaint() {
%1 = call i32 @lnxcdispPaint(i32 1)
ret void
}

LLVM IR (-O2):
define void @lnxcDisplayPaint() {
%1 = tail call i32 @lnxcdispPaint(i32 1)
ret void
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *, char *, int, double);
int main(void) {
  char s[] = "-1234.5678";
  printf("%s + %d = %f\n", s, (int)(atof(s)), atof(s) - (int)(atof(s)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xf(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0xf(%rbp),%rdi
call   1030 <atof@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
lea    -0xf(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
lea    -0xf(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm1,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x36352e343332312d,%rax
2e 35 36
mov    %rax,(%rsp)
movl   $0x383736,0x7(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
cvttsd2si %xmm0,%edx
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [11 x i8] c"-1234.5678\00"
@.str = [14 x i8] c"%s + %d = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 0, i32* %1
%3 = bitcast [11 x i8]* %2 to i8*
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%6 = call double @atof(i8* %5)
%7 = fptosi double %6 to i32
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%9 = call double @atof(i8* %8)
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%11 = call double @atof(i8* %10)
%12 = fptosi double %11 to i32
%13 = sitofp i32 %12 to double
%14 = fsub double %9, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %7, double %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [11 x i8] c"-1234.5678\00"
@.str = [14 x i8] c"%s + %d = %f\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call double @atof(i8* %2)
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fsub double %3, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %4, double %6)
ret i32 0
}
char *wad_strcpy(char *t, const char *s) {
  if (s)
    for (; *s; s++, t++)
      *t = *s;
  *t = 0;
  return t;
}


x86 assembly (clang, -O0):
<wad_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1157 <wad_strcpy+0x57>
jmp    111c <wad_strcpy+0x1c>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <wad_strcpy+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <wad_strcpy+0x1c>
jmp    1157 <wad_strcpy+0x57>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wad_strcpy>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1131 <wad_strcpy+0x31>
mov    (%rsi),%cl
test   %cl,%cl
je     1131 <wad_strcpy+0x31>
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <wad_strcpy+0x20>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @wad_strcpy(i8* writeonly %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %13, %7 ], [ %5, %4 ]
%9 = phi i8* [ %11, %7 ], [ %1, %4 ]
%10 = phi i8* [ %12, %7 ], [ %0, %4 ]
store i8 %8, i8* %10
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %4, %2
%16 = phi i8* [ %0, %2 ], [ %0, %4 ], [ %12, %7 ]
store i8 0, i8* %16
ret i8* %16
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
float quat_length_squared(float *);
__attribute__((always_)) float psquat_length_squared(struct quat *a) {
  return quat_length_squared((float *)a);
}


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

x86 assembly (clang, -O2):
<psquat_length_squared>:
jmp    1030 <quat_length_squared@plt>

LLVM IR (-O0):
%struct.quat = type { i32 }
define float @psquat_length_squared(%struct.quat* %0) {
%2 = alloca %struct.quat*
store %struct.quat* %0, %struct.quat** %2
%3 = load %struct.quat*, %struct.quat** %2
%4 = bitcast %struct.quat* %3 to float*
%5 = call float @quat_length_squared(float* %4)
ret float %5
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define float @psquat_length_squared(%struct.quat* %0) {
%2 = bitcast %struct.quat* %0 to float*
%3 = tail call float @quat_length_squared(float* %2)
ret float %3
}
int *f() {
  static int a[2];
  return a + 3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f19(%rip),%rax
add    $0xc,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@f.a = internal global [2 x i32] zeroinitializer
define i32* @f() {
ret i32* getelementptr inbounds ([2 x i32], [2 x i32]* @f.a, i64 1, i64 1)
}

LLVM IR (-O2):
@f.a = internal global [2 x i32] zeroinitializer
define i32* @f() {
ret i32* getelementptr inbounds ([2 x i32], [2 x i32]* @f.a, i64 1, i64 1)
}
/* Variables and functions */
int /*<<< orphan*/ send_http_error(int, char *, char *);
void send_504_gateway_timeout(int clientsock) {
  send_http_error(clientsock, "504 Gateway Timeout", "no-signal");
}


x86 assembly (clang, -O0):
<send_504_gateway_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
lea    0xee8(%rip),%rdx
call   1030 <send_http_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_504_gateway_timeout>:
lea    0xee9(%rip),%rsi
lea    0xef6(%rip),%rdx
jmp    1030 <send_http_error@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"504 Gateway Timeout\00"
@.str.1 = [10 x i8] c"no-signal\00"
define void @send_504_gateway_timeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @send_http_error(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"504 Gateway Timeout\00"
@.str.1 = [10 x i8] c"no-signal\00"
define void @send_504_gateway_timeout(i32 %0) {
%2 = tail call i32 @send_http_error(i32 %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int gob_end_struct(char *, size_t);
int gob_end_type_definition(char *buf, size_t buf_size) {
  return gob_end_struct(buf, buf_size);
}


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

x86 assembly (clang, -O2):
<gob_end_type_definition>:
jmp    1030 <gob_end_struct@plt>

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

LLVM IR (-O2):
define i32 @gob_end_type_definition(i8* %0, i64 %1) {
%3 = tail call i32 @gob_end_struct(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int read(int, char *, int);
int readSerial(int portHandle, char *data, int byteCount) {
  int bytesRead = read(portHandle, data, byteCount);
  return bytesRead;
}


x86 assembly (clang, -O0):
<readSerial>:
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 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSerial>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @readSerial(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ signal(int, int);
void f(void) {
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  puts("done");
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
lea    0xe51(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"done\00"
define void @f() {
%1 = call i32 @signal(i32 8, i32 1)
%2 = call i32 @signal(i32 8, i32 1)
%3 = call i32 @signal(i32 8, i32 1)
%4 = call i32 @signal(i32 8, i32 1)
%5 = call i32 @signal(i32 8, i32 1)
%6 = call i32 @signal(i32 8, i32 1)
%7 = call i32 @signal(i32 8, i32 1)
%8 = call i32 @signal(i32 8, i32 1)
%9 = call i32 @signal(i32 8, i32 1)
%10 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"done\00"
define void @f() {
%1 = tail call i32 @signal(i32 8, i32 1)
%2 = tail call i32 @signal(i32 8, i32 1)
%3 = tail call i32 @signal(i32 8, i32 1)
%4 = tail call i32 @signal(i32 8, i32 1)
%5 = tail call i32 @signal(i32 8, i32 1)
%6 = tail call i32 @signal(i32 8, i32 1)
%7 = tail call i32 @signal(i32 8, i32 1)
%8 = tail call i32 @signal(i32 8, i32 1)
%9 = tail call i32 @signal(i32 8, i32 1)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_create_solution_output_file(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(131, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_create_solution_output_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x83,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_create_solution_output_file>:
mov    $0x83,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_create_solution_output_file() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 131, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_create_solution_output_file() {
%1 = tail call i32 @_ada_use_c2phc(i32 131, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Type definitions */
struct csv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ csv_parse_impl(struct csv *, char const *, char const *,
                                  int);
void csv_parse_chunk(struct csv *csv, const char *s, const char *end) {
  csv_parse_impl(csv, s, end, false);
}


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

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

LLVM IR (-O0):
%struct.csv = type { i32 }
define void @csv_parse_chunk(%struct.csv* %0, i8* %1, i8* %2) {
%4 = alloca %struct.csv*
%5 = alloca i8*
%6 = alloca i8*
store %struct.csv* %0, %struct.csv** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.csv*, %struct.csv** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @csv_parse_impl(%struct.csv* %7, i8* %8, i8* %9, i32 0)
ret void
}

LLVM IR (-O2):
%struct.csv = type { i32 }
define void @csv_parse_chunk(%struct.csv* %0, i8* %1, i8* %2) {
%4 = tail call i32 @csv_parse_impl(%struct.csv* %0, i8* %1, i8* %2, i32 0)
ret void
}
/* Variables and functions */
int F2_cc_nu_n(double, double);
double F1_nc_n(double xx, double Q2) { return F2_cc_nu_n(xx, Q2) / 2 / xx; }


x86 assembly (clang, -O0):
<F1_nc_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <F2_cc_nu_n@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F1_nc_n>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <F2_cc_nu_n@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @F1_nc_n(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @F2_cc_nu_n(double %5, double %6)
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to double
%10 = load double, double* %3
%11 = fdiv double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @F1_nc_n(double %0, double %1) {
%3 = tail call i32 @F2_cc_nu_n(double %0, double %1)
%4 = sdiv i32 %3, 2
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, %0
ret double %6
}
/* Variables and functions */
char *appaserver_parameter_file_get_apache_cgi_directory();
char *appaserver_parameter_file_get_cgi_directory(void) {
  return appaserver_parameter_file_get_apache_cgi_directory();
}


x86 assembly (clang, -O0):
<appaserver_parameter_file_get_cgi_directory>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <appaserver_parameter_file_get_apache_cgi_directory@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @appaserver_parameter_file_get_cgi_directory() {
%1 = call i8* (...) @appaserver_parameter_file_get_apache_cgi_directory()
ret i8* %1
}

LLVM IR (-O2):
define i8* @appaserver_parameter_file_get_cgi_directory() {
%1 = tail call i8* (...) @appaserver_parameter_file_get_apache_cgi_directory()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void client_log(const char *message) { printf("[Client Log]: %s\n", message); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"[Client Log]: %s\0A\00"
define void @client_log(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"[Client Log]: %s\0A\00"
define void @client_log(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int gcspy_arrayInputBaseRead(char *buffer) {
  int res;
  res = (int)*buffer;
  if (res < 0)
    res += 256;
  return res;
}


x86 assembly (clang, -O0):
<gcspy_arrayInputBaseRead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1127 <gcspy_arrayInputBaseRead+0x27>
mov    -0xc(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcspy_arrayInputBaseRead>:
movsbl (%rdi),%ecx
lea    0x100(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcspy_arrayInputBaseRead(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 256
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @gcspy_arrayInputBaseRead(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = icmp slt i8 %2, 0
%5 = add nsw i32 %3, 256
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}