xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(char);
int strlen(char *);
void utils_trim_string(char *str) {
  if (isspace(str[strlen(str) - 1]))
    str[strlen(str) - 1] = '\0';
}


x86 assembly (clang, -O0):
<utils_trim_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     117d <utils_trim_string+0x5d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_trim_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movsbl -0x1(%rax,%rbx,1),%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     1149 <utils_trim_string+0x29>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @utils_trim_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = tail call i32 @strlen(i8* %0)
%11 = add nsw i32 %10, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %9, %1
ret void
}
void SteamAPI_ISteamGameServer_SetGameData(void *self,
                                           const char *pchGameData) {
  xlogf("%s(self = %p, pchGameData = %s)\n", __func__, self, pchGameData);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamGameServer_SetGameData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamGameServer_SetGameData>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xefd(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"%s(self = %p, pchGameData = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetGameData = [38 x i8] c"SteamAPI_ISteamGameServer_SetGameData\00"
define void @SteamAPI_ISteamGameServer_SetGameData(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamGameServer_SetGameData, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s(self = %p, pchGameData = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetGameData = [38 x i8] c"SteamAPI_ISteamGameServer_SetGameData\00"
define void @SteamAPI_ISteamGameServer_SetGameData(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamGameServer_SetGameData, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_exts();
int /*<<< orphan*/ get_exts();
int find_extensionsGL(void) {
  if (!get_exts())
    return 0;
  free_exts();
  return 1;
}


x86 assembly (clang, -O0):
<find_extensionsGL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_exts@plt>
cmp    $0x0,%eax
jne    1144 <find_extensionsGL+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1152 <find_extensionsGL+0x32>
mov    $0x0,%al
call   1030 <free_exts@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_extensionsGL>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <get_exts@plt>
test   %eax,%eax
je     113a <find_extensionsGL+0x1a>
xor    %eax,%eax
call   1030 <free_exts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @find_extensionsGL() {
%1 = alloca i32
%2 = call i32 (...) @get_exts()
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 0, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 (...) @free_exts()
store i32 1, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @find_extensionsGL() {
%1 = tail call i32 (...) @get_exts()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @free_exts()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
int sign_ext(int x, int nbits) {
  int n = 32 - nbits;
  return (int)((x << n) >> n);
}


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

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

LLVM IR (-O0):
define i32 @sign_ext(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 32, %6
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = shl i32 %8, %9
%11 = load i32, i32* %5
%12 = ashr i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @sign_ext(i32 %0, i32 %1) {
%3 = sub nsw i32 32, %1
%4 = shl i32 %0, %3
%5 = ashr i32 %4, %3
ret i32 %5
}
int UAX_ExHeapResetMark() { return (0); }


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

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

LLVM IR (-O0):
define i32 @UAX_ExHeapResetMark() {
ret i32 0
}

LLVM IR (-O2):
define i32 @UAX_ExHeapResetMark() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int writeint() {
  int a = 0, b = 0;
#pragma omp atomic write
  ;
#pragma omp atomic write
  foo();
#pragma omp atomic write
  a += b;
#pragma omp atomic write
  a = 0;
#pragma omp atomic write
  a = b;
#pragma omp atomic write write
  a = b;
  return 0;
}


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

x86 assembly (clang, -O2):
<writeint>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @writeint() {
%1 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *,
                           char *);
int /*<<< orphan*/ log_fp();
char *strerror(int /*<<< orphan*/);
void lsd_fatal_error(char *file, int line, char *mesg) {
  fprintf(log_fp(), "ERROR: [%s:%d] %s: %s\n", file, line, mesg,
          strerror(errno));
  fflush(log_fp());
}


x86 assembly (clang, -O0):
<lsd_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <log_fp@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    %rax,%r9
lea    0xe67(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <log_fp@plt>
mov    %eax,%edi
call   1050 <fflush@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsd_fatal_error>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <log_fp@plt>
mov    %eax,%ebp
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe92(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %r14,%r8
mov    %rax,%r9
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <log_fp@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"ERROR: [%s:%d] %s: %s\0A\00"
@errno = global i32 0
define void @lsd_fatal_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 (...) @log_fp()
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10, i8* %12)
%14 = call i32 (...) @log_fp()
%15 = call i32 @fflush(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"ERROR: [%s:%d] %s: %s\0A\00"
@errno = global i32 0
define void @lsd_fatal_error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 (...) @log_fp()
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %6)
%8 = tail call i32 (...) @log_fp()
%9 = tail call i32 @fflush(i32 %8)
ret void
}
void sleep(int counter) {
  int i;
  for (i = 0; i < counter; i++)
    ;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <sleep+0x2d>
jmp    111f <sleep+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <sleep+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sleep(i32 %0) {
ret void
}
int stuffchar(signed char data, unsigned char *buffer, unsigned short *index) {
  if (data < 0) {
    data *= -1;
    data |= 0x80;
  }
  buffer[*index] = data;
  *index += 1;
  return (*index);
}


x86 assembly (clang, -O0):
<stuffchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jge    1135 <stuffchar+0x35>
movsbl -0x1(%rbp),%eax
imul   $0xffffffff,%eax,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzwl (%rcx),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
movzwl (%rax),%ecx
add    $0x1,%ecx
mov    %cx,(%rax)
mov    -0x18(%rbp),%rax
movzwl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stuffchar>:
mov    %edi,%eax
neg    %al
or     $0x80,%al
test   %dil,%dil
movzbl %al,%eax
cmovns %edi,%eax
movzwl (%rdx),%ecx
mov    %al,(%rsi,%rcx,1)
movzwl (%rdx),%eax
add    $0x1,%eax
mov    %ax,(%rdx)
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @stuffchar(i8 signext %0, i8* %1, i16* %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i16*
store i8 %0, i8* %4
store i8* %1, i8** %5
store i16* %2, i16** %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %3
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = mul nsw i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %4
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = or i32 %16, 128
%18 = trunc i32 %17 to i8
store i8 %18, i8* %4
br label %19
19: ; preds = %10, %3
%20 = load i8, i8* %4
%21 = load i8*, i8** %5
%22 = load i16*, i16** %6
%23 = load i16, i16* %22
%24 = zext i16 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
store i8 %20, i8* %25
%26 = load i16*, i16** %6
%27 = load i16, i16* %26
%28 = zext i16 %27 to i32
%29 = add nsw i32 %28, 1
%30 = trunc i32 %29 to i16
store i16 %30, i16* %26
%31 = load i16*, i16** %6
%32 = load i16, i16* %31
%33 = zext i16 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
define i32 @stuffchar(i8 signext %0, i8* nocapture writeonly %1, i16* nocapture %2) {
%4 = icmp slt i8 %0, 0
%5 = sub i8 0, %0
%6 = or i8 %5, -128
%7 = select i1 %4, i8 %6, i8 %0
%8 = load i16, i16* %2
%9 = zext i16 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 %7, i8* %10
%11 = load i16, i16* %2
%12 = add i16 %11, 1
store i16 %12, i16* %2
%13 = zext i16 %12 to i32
ret i32 %13
}
unsigned xrop3_30_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | S;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_30_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_30_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%eax
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
or     $0xff,%ecx
xor    %edx,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_30_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_30_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = xor i32 %7, %8
%10 = xor i32 %5, -1
%11 = and i32 %9, %10
%12 = or i32 %11, %3
ret i32 %12
}
/* Type definitions */
struct lexer_token {
  int dummy;
};

/* Variables and functions */
double lexer_token_to_double(struct lexer_token *);
extern float lexer_token_to_float(struct lexer_token *tok) {
  double d = lexer_token_to_double(tok);
  float f = (float)d;
  ;
  return f;
}


x86 assembly (clang, -O0):
<lexer_token_to_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lexer_token_to_double@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lexer_token_to_float>:
push   %rax
call   1030 <lexer_token_to_double@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.lexer_token = type { i32 }
define float @lexer_token_to_float(%struct.lexer_token* %0) {
%2 = alloca %struct.lexer_token*
%3 = alloca double
%4 = alloca float
store %struct.lexer_token* %0, %struct.lexer_token** %2
%5 = load %struct.lexer_token*, %struct.lexer_token** %2
%6 = call double @lexer_token_to_double(%struct.lexer_token* %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = fptrunc double %7 to float
store float %8, float* %4
%9 = load float, float* %4
ret float %9
}

LLVM IR (-O2):
%struct.lexer_token = type { i32 }
define float @lexer_token_to_float(%struct.lexer_token* %0) {
%2 = tail call double @lexer_token_to_double(%struct.lexer_token* %0)
%3 = fptrunc double %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ bubble_sort(int *, int);
int /*<<< orphan*/ print_array(int *, int);
int main(int argc, const char *argv[]) {
  int a[(7)] = {522, 200, 350, 4, 8, 9, 12};
  print_array(a, (7));
  bubble_sort(a, (7));
  print_array(a, (7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1030 <print_array@plt>
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1040 <bubble_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <bubble_sort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 522, i32 200, i32 350, i32 4, i32 8, i32 9, i32 12]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [7 x i32]* %6 to i8*
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%9 = call i32 @print_array(i32* %8, i32 7)
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%11 = call i32 @bubble_sort(i32* %10, i32 7)
%12 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%13 = call i32 @print_array(i32* %12, i32 7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 522, i32 200, i32 350, i32 4, i32 8, i32 9, i32 12]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i32]
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%6 = call i32 @print_array(i32* %5, i32 7)
%7 = call i32 @bubble_sort(i32* %5, i32 7)
%8 = call i32 @print_array(i32* %5, i32 7)
ret i32 0
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 "
         "REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 "
         "CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Sat "
         "Jan  5 18:51:29 CST 2013 BUILD=DEBUG CPU=ux500 USING_UMP=1 "
         "USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 "
         "USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= "
         "MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

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

LLVM IR (-O0):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Sat Jan 5 18:51:29 CST 2013 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Sat Jan 5 18:51:29 CST 2013 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printString(void *value) {
  char *charPtr = (char *)value;
  printf("%s", charPtr);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printString(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int ntohl(int);
int /*<<< orphan*/ stderr;
void traps(void) {
  static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
  int *p = (int *)test;
  if (*p != ntohl(0x434f4e46)) {
    fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n", *p);
    exit(2);
  }
}


x86 assembly (clang, -O0):
<traps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2ef9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
je     1188 <traps+0x58>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traps>:
push   %rax
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
cmp    $0x464e4f43,%eax
jne    1144 <traps+0x14>
pop    %rax
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    $0x464e4f43,%edx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@traps.test = internal global [5 x i8] c"CONF\00"
@stderr = global i32 0
@.str = [50 x i8] c"fixdep: sizeof(int) != 4 or wrong endianess? %#x\0A\00"
define void @traps() {
%1 = alloca i32*
store i32* bitcast ([5 x i8]* @traps.test to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 1129270854)
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = load i32*, i32** %1
%9 = load i32, i32* %8
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"fixdep: sizeof(int) != 4 or wrong endianess? %#x\0A\00"
define void @traps() {
%1 = tail call i32 @ntohl(i32 1129270854)
%2 = icmp eq i32 %1, 1179537219
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 1179537219)
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, ...);
void free_helper(void *ptr) {
  if (!ptr) {
    printf("[-] free pointer == NULL\n");
    return;
  }
  free(ptr);
  printf("[+] free: %p\n", ptr);
}


x86 assembly (clang, -O0):
<free_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114a <free_helper+0x2a>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1165 <free_helper+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_helper>:
test   %rdi,%rdi
je     1150 <free_helper+0x20>
push   %rbx
mov    %rdi,%rbx
call   1030 <free@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>
lea    0xeb7(%rip),%rdi
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str.1 = [14 x i8] c"[+] free: %p\0A\00"
@str = [25 x i8] c"[-] free pointer == NULL\00"
define void @free_helper(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %8
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %5, %3
ret void
}
int test_imm_82int64_lowword_reg(long long val) {
  return ((val) & (0x82 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_82int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 130
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void sclp_print(const char *str) { write(1, str, strlen(str)); }


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

x86 assembly (clang, -O2):
<sclp_print>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @sclp_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @sclp_print(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
double asin(double);
double Asin(double a, double b) { return asin(a); }


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

x86 assembly (clang, -O2):
<Asin>:
jmp    1030 <asin@plt>

LLVM IR (-O0):
define double @Asin(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 = call double @asin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @Asin(double %0, double %1) {
%3 = tail call double @asin(double %0)
ret double %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XErrorEvent;

/* Variables and functions */
void *get_XErrorEvent_display(void *_p) {
  return (void *)((XErrorEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XErrorEvent_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XErrorEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XErrorEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
__m128i __attribute__((__always___, __nodebug__)) _mm_castps_si128(__m128 in) {
  return (__m128i)in;
}


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

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

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

LLVM IR (-O2):
define i32 @_mm_castps_si128(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void prool_version() {
  printf(
      "Built by Prool %s %s proolix@gmail.com\nhttp://calculixforwin.com\nUse "
      "PROOL command in CGX main window for additional info\n",
      "Mar 18 2022", "23:03:57");
}


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

x86 assembly (clang, -O2):
<prool_version>:
lea    0xee9(%rip),%rdi
lea    0xf5d(%rip),%rsi
lea    0xf62(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [123 x i8] c"Built by Prool %s %s proolix@gmail.com\0Ahttp://calculixforwin.com\0AUse PROOL command in CGX main window for additional info\0A\00"
@.str.1 = [12 x i8] c"Mar 18 2022\00"
@.str.2 = [9 x i8] c"23:03:57\00"
define void @prool_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [123 x i8] c"Built by Prool %s %s proolix@gmail.com\0Ahttp://calculixforwin.com\0AUse PROOL command in CGX main window for additional info\0A\00"
@.str.1 = [12 x i8] c"Mar 18 2022\00"
@.str.2 = [9 x i8] c"23:03:57\00"
define void @prool_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool char_needs_quotes(const char ch) {
  switch (ch) {
  case ':':
  case '{':
  case '}':
  case '[':
  case ']':
  case ',':
  case '&':
  case '*':
  case '#':
  case '?':
  case '|':
  case '-':
  case '<':
  case '>':
  case '=':
  case '!':
  case '%':
  case '@':
  case '`':
  case ' ':
    return true;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<char_needs_quotes>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5d,%eax
ja     1140 <char_needs_quotes+0x40>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1147 <char_needs_quotes+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_needs_quotes>:
add    $0xffffffe0,%edi
cmp    $0x5d,%edi
ja     111e <char_needs_quotes+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @char_needs_quotes(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 58, label %6
i32 123, label %6
i32 125, label %6
i32 91, label %6
i32 93, label %6
i32 44, label %6
i32 38, label %6
i32 42, label %6
i32 35, label %6
i32 63, label %6
i32 124, label %6
i32 45, label %6
i32 60, label %6
i32 62, label %6
i32 61, label %6
i32 33, label %6
i32 37, label %6
i32 64, label %6
i32 96, label %6
i32 32, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @char_needs_quotes(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 58, label %4
i32 123, label %4
i32 125, label %4
i32 91, label %4
i32 93, label %4
i32 44, label %4
i32 38, label %4
i32 42, label %4
i32 35, label %4
i32 63, label %4
i32 124, label %4
i32 45, label %4
i32 60, label %4
i32 62, label %4
i32 61, label %4
i32 33, label %4
i32 37, label %4
i32 64, label %4
i32 96, label %4
i32 32, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
WINDOW *create_newwin(int height, int width, int starty, int startx) {
  WINDOW *local_win;
  local_win = newwin(height, width, starty, startx);
  box(local_win, 0, 0);
  wrefresh(local_win);
  return local_win;
}


x86 assembly (clang, -O0):
<create_newwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <newwin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <box@plt>
mov    -0x18(%rbp),%rdi
call   1030 <wrefresh@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_newwin>:
push   %rbx
call   1040 <newwin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <box@plt>
mov    %rbx,%rdi
call   1030 <wrefresh@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @create_newwin(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32* @newwin(i32 %10, i32 %11, i32 %12, i32 %13)
store i32* %14, i32** %9
%15 = load i32*, i32** %9
%16 = call i32 @box(i32* %15, i32 0, i32 0)
%17 = load i32*, i32** %9
%18 = call i32 @wrefresh(i32* %17)
%19 = load i32*, i32** %9
ret i32* %19
}

LLVM IR (-O2):
define i32* @create_newwin(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @newwin(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @box(i32* %5, i32 0, i32 0)
%7 = tail call i32 @wrefresh(i32* %5)
ret i32* %5
}
int test_int_no1(int no1, int no2) { return (no1 + no2); }


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

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

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

LLVM IR (-O2):
define i32 @test_int_no1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void iwl3945_led_unregister(struct iwl_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define void @iwl3945_led_unregister(%struct.iwl_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MySound_Stop();
void EnterSpeedStopped(void) { MySound_Stop(); }


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

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

LLVM IR (-O0):
define void @EnterSpeedStopped() {
%1 = call i32 (...) @MySound_Stop()
ret void
}

LLVM IR (-O2):
define void @EnterSpeedStopped() {
%1 = tail call i32 (...) @MySound_Stop()
ret void
}
int test_imm_24uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x24 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_24uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x24,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_24uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 154618822656
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ Rand1();
int RandNum(int num) { return (int)((double)Rand1() * num); }


x86 assembly (clang, -O0):
<RandNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Rand1@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandNum>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <Rand1@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @RandNum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @Rand1()
%4 = sitofp i64 %3 to double
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fmul double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @RandNum(i32 %0) {
%2 = tail call i64 (...) @Rand1()
%3 = sitofp i64 %2 to double
%4 = sitofp i32 %0 to double
%5 = fmul double %4, %3
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close_connection();
int /*<<< orphan*/ connect_to_nnserver();
int /*<<< orphan*/ wait_for_connecting();
int /*<<< orphan*/ write_msg(char *);
int main() {
  connect_to_nnserver();
  wait_for_connecting();
  write_msg("NO_NAME V0.1\n");
  close_connection();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <connect_to_nnserver@plt>
mov    $0x0,%al
call   1030 <wait_for_connecting@plt>
lea    0xe9c(%rip),%rdi
call   1060 <write_msg@plt>
mov    $0x0,%al
call   1040 <close_connection@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <connect_to_nnserver@plt>
xor    %eax,%eax
call   1030 <wait_for_connecting@plt>
lea    0xeaa(%rip),%rdi
call   1060 <write_msg@plt>
xor    %eax,%eax
call   1040 <close_connection@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"NO_NAME V0.1\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @connect_to_nnserver()
%3 = call i32 (...) @wait_for_connecting()
%4 = call i32 @write_msg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @close_connection()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"NO_NAME V0.1\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @connect_to_nnserver()
%2 = tail call i32 (...) @wait_for_connecting()
%3 = tail call i32 @write_msg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @close_connection()
ret i32 0
}
int test_imm_23int8_mem(signed char *val) {
  return ((*val) & (-0x23 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_23int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -35
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *srand48_r;
int main(int argc, char *argv[]) {
  void *p;
  (void)argc;
  (void)argv;
  p = srand48_r;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
@srand48_r = global i8* null
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** @srand48_r
store i8* %9, i8** %6
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@srand48_r = global i8* null
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
void VIDDummyVdp1ScaledSpriteDraw(void) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp1ScaledSpriteDraw() {
ret void
}
unsigned int test3(unsigned int e, unsigned int f) { return (e ^ f) == 0; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @test3(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 = xor i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test3(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}