xunge/DecIR huggingface dataset:
void prInt_null(const char *s) {}


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

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

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

LLVM IR (-O2):
define void @prInt_null(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
bool doesFileExist(const char *aFilename) {
  struct stat statBuf;
  int statResult = stat(aFilename, &statBuf);
  return statResult == 0;
}


x86 assembly (clang, -O0):
<doesFileExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @doesFileExist(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @doesFileExist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void option_unset_unit2MODIF_CASELESS() {}


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

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

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

LLVM IR (-O2):
define void @option_unset_unit2MODIF_CASELESS() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ providerShutdown();
int /*<<< orphan*/ serverShutdown();
void _shutdown(void) {
  providerShutdown();
  serverShutdown();
}


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

x86 assembly (clang, -O2):
<_shutdown>:
push   %rax
xor    %eax,%eax
call   1040 <providerShutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <serverShutdown@plt>

LLVM IR (-O0):
define void @_shutdown() {
%1 = call i32 (...) @providerShutdown()
%2 = call i32 (...) @serverShutdown()
ret void
}

LLVM IR (-O2):
define void @_shutdown() {
%1 = tail call i32 (...) @providerShutdown()
%2 = tail call i32 (...) @serverShutdown()
ret void
}
void print_byte(unsigned int c) {
  if (c == '\n')
    print_byte('\r');
  while (!((*(volatile unsigned long *)0x40013800) & 0x80))
    ;
  *(volatile unsigned long *)0x40013804 = c;
}


x86 assembly (clang, -O0):
<print_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112f <print_byte+0x1f>
mov    $0xd,%edi
call   1030 <print_byte@plt>
jmp    1134 <print_byte+0x24>
mov    $0x40013800,%eax
mov    (%rax),%rax
and    $0x80,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1158 <print_byte+0x48>
jmp    115d <print_byte+0x4d>
jmp    1134 <print_byte+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x40013804,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_byte>:
cmp    $0xa,%edi
jne    1130 <print_byte+0x30>
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x80,0x40013800
je     1110 <print_byte+0x10>
movq   $0xd,0x40013804
nopw   0x0(%rax,%rax,1)
testq  $0x80,0x40013800
je     1130 <print_byte+0x30>
mov    %edi,%eax
mov    %rax,0x40013804
40
ret

LLVM IR (-O0):
define void @print_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
br label %7
7: ; preds = %12, %6
%8 = load volatile i64, i64* inttoptr (i64 1073821696 to i64*)
%9 = and i64 %8, 128
%10 = icmp ne i64 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %13
12: ; preds = %7
br label %7
13: ; preds = %7
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
store volatile i64 %15, i64* inttoptr (i64 1073821700 to i64*)
ret void
}

LLVM IR (-O2):
define void @print_byte(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = load volatile i64, i64* inttoptr (i64 1073821696 to i64*)
%5 = and i64 %4, 128
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
store volatile i64 13, i64* inttoptr (i64 1073821700 to i64*)
br label %8
8: ; preds = %7, %1
br label %9
9: ; preds = %8, %9
%10 = load volatile i64, i64* inttoptr (i64 1073821696 to i64*)
%11 = and i64 %10, 128
%12 = icmp eq i64 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9
%14 = zext i32 %0 to i64
store volatile i64 %14, i64* inttoptr (i64 1073821700 to i64*)
ret void
}
/* Variables and functions */
char *__strtok_r(char *, char const *, char **, int);
char *strtok_r(register char *__restrict s,
               register const char *__restrict delim, char **__restrict lasts) {
  return __strtok_r(s, delim, lasts, 1);
}


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

x86 assembly (clang, -O2):
<strtok_r>:
mov    $0x1,%ecx
jmp    1030 <__strtok_r@plt>

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

LLVM IR (-O2):
define i8* @strtok_r(i8* noalias %0, i8* noalias %1, i8** noalias %2) {
%4 = tail call i8* @__strtok_r(i8* %0, i8* %1, i8** %2, i32 1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler2(int sig) {
  printf("\nHandler 2: sig = %d\n", sig);
  return;
}


x86 assembly (clang, -O0):
<handler2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"\0AHandler 2: sig = %d\0A\00"
define void @handler2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OTHERNAME;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ OTHERNAME_it;
OTHERNAME *d2i_OTHERNAME(OTHERNAME **a, const unsigned char **in, long len) {
  return (OTHERNAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &OTHERNAME_it);
}


x86 assembly (clang, -O0):
<d2i_OTHERNAME>:
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
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_OTHERNAME>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@OTHERNAME_it = global i32 0
define i32* @d2i_OTHERNAME(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @OTHERNAME_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@OTHERNAME_it = global i32 0
define i32* @d2i_OTHERNAME(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @OTHERNAME_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int extension(fn)
register char *fn;
{
  char c;
  while (*fn++)
    ;
  fn--;
  c = *--fn;
  return (*--fn == '.') ? c : 0;
}


x86 assembly (clang, -O0):
<extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1125 <extension+0x25>
jmp    1108 <extension+0x8>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
mov    -0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0x2e,%eax
jne    116e <extension+0x6e>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1178 <extension+0x78>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1178 <extension+0x78>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extension>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <extension>
xor    %eax,%eax
cmpb   $0x2e,-0x3(%rdi)
movzbl -0x2(%rdi),%ecx
cmovne %eax,%ecx
movsbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @extension(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 -1
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %3, i64 -2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 46
%13 = select i1 %12, i8 %9, i8 0
%14 = sext i8 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
int htoi(unsigned char *str) {
  unsigned int result;
  (void)sscanf((char *)str, "%x", &result);
  return (int)result;
}


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

x86 assembly (clang, -O2):
<htoi>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @htoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_scf(void) { op_write1(0x37); }


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

x86 assembly (clang, -O2):
<op_enc_scf>:
mov    $0x37,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_scf() {
%1 = call i32 @op_write1(i32 55)
ret void
}

LLVM IR (-O2):
define void @op_enc_scf() {
%1 = tail call i32 @op_write1(i32 55)
ret void
}
int test_imm_01int32_reg(int val) { return ((val) & (0x01 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_01int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_01int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %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_01int32_reg(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
void remove_newline(char *str) {
  size_t ln = strlen(str) - 1;
  if (str[ln] == '\n') {
    str[ln] = '\0';
  }
}


x86 assembly (clang, -O0):
<remove_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    114f <remove_newline+0x3f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <remove_newline+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @remove_newline(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, 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
store i64 %7, i64* %3
%8 = load i8*, i8** %2
%9 = load i64, i64* %3
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %18
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 0, i8* %17
br label %18
18: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
define void @remove_newline(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 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int /*<<< orphan*/ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ (*)(void *),
                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  pthread_t th;
  foo((void *)1);
  pthread_create(&th, NULL, foo, NULL);
  pthread_join(th, NULL);
  return 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    $0x1,%edi
call   1050 <foo@plt>
lea    -0x14(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    0x2e99(%rip),%rdx
mov    %rcx,%rsi
call   1030 <pthread_create@plt>
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <foo@plt>
mov    0x2eb6(%rip),%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <pthread_create@plt>
mov    0x4(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_join@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @foo(i8* inttoptr (i64 1 to i8*))
%8 = call i32 @pthread_create(i32* %6, i32* null, i32 (i8*)* @foo, i32* null)
%9 = load i32, i32* %6
%10 = call i32 @pthread_join(i32 %9, i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @foo(i8* inttoptr (i64 1 to i8*))
%6 = call i32 @pthread_create(i32* %3, i32* null, i32 (i8*)* @foo, i32* null)
%7 = load i32, i32* %3
%8 = call i32 @pthread_join(i32 %7, i32* null)
ret i32 0
}
int soru_3(int dizi[], int N) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @soru_3(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "mv"
        " [-fi] source_file target_file\n       "
        "mv"
        " [-fi] source_file... target_file\n  -f	Do not prompt for "
        "confirmation if the destination path exists\n  -i	Prompt for "
        "confirmation if the destination path exists\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [211 x i8] c"Usage: mv [-fi] source_file target_file\0A mv [-fi] source_file... target_file\0A -f\09Do not prompt for confirmation if the destination path exists\0A -i\09Prompt for confirmation if the destination path exists\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([211 x i8], [211 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [211 x i8] c"Usage: mv [-fi] source_file target_file\0A mv [-fi] source_file... target_file\0A -f\09Do not prompt for confirmation if the destination path exists\0A -i\09Prompt for confirmation if the destination path exists\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([211 x i8], [211 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_int(int const k1, int const k2) {
  return k1 == k2;
}


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

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_int(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int scanf(char *, int *, int *, int *);
int main(void) {
  int day = 0;
  int month = 0;
  int year = 0;
  int matches = scanf("%d.%d.%d", &day, &month, &year);
  printf("%d: %d %d %d\n", matches, day, month, year);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xebd(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0xc(%rsp),%r8d
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d.%d.%d\00"
@.str.1 = [14 x i8] c"%d: %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 0
}
int st_internal_numcmp(x, y)
long x, y;
{ return x != y; }


x86 assembly (clang, -O0):
<st_internal_numcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_internal_numcmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @st_internal_numcmp(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void X509_NAME_ENTRY_get_object(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_ENTRY_get_object() {
ret void
}
void test_four(int x, int y) {
#pragma omp target
#pragma omp teams distribute parallel for simd collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_four+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_four+0x43>
jmp    1135 <test_four+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_four+0x24>
jmp    1148 <test_four+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_four+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_four(i32 %0, i32 %1) {
ret void
}
int test_imm_33int64_midword_reg(long long val) {
  return ((val >> 16) & (0x33 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_33int64_midword_reg>:
test   $0x330000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_33int64_midword_reg(i64 %0) {
%2 = and i64 %0, 3342336
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int spec_count(char *spec) {
  int cnt = 0;
  char typ;
  while ((typ = *spec++))
    if (typ != '_')
      cnt++;
  return cnt;
}


x86 assembly (clang, -O0):
<spec_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
cmp    $0x0,%al
je     1146 <spec_count+0x46>
movsbl -0xd(%rbp),%eax
cmp    $0x5f,%eax
je     1141 <spec_count+0x41>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <spec_count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spec_count>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x5f,%cl
je     1110 <spec_count+0x10>
test   %cl,%cl
je     1125 <spec_count+0x25>
add    $0x1,%eax
jmp    1110 <spec_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @spec_count(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i32 [ %10, %9 ], [ 0, %1 ]
%4 = phi i8* [ %7, %9 ], [ %0, %1 ]
br label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %4, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
switch i8 %8, label %9 [
i8 0, label %11
i8 95, label %5
]
9: ; preds = %5
%10 = add nuw nsw i32 %3, 1
br label %2
11: ; preds = %5
ret i32 %3
}
void g_scanner_warn() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_warn() {
ret void
}
int TreePtrCompare(void *a, void *b, int content) {
  return (a > b) ? -1 : (a == b) ? 0 : 1;
}


x86 assembly (clang, -O0):
<TreePtrCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    112a <TreePtrCompare+0x2a>
mov    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1142 <TreePtrCompare+0x42>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TreePtrCompare>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @TreePtrCompare(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ugt i8* %7, %8
br i1 %9, label %10, label %11
10: ; preds = %3
br label %17
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = icmp eq i8* %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 0, i32 1
br label %17
17: ; preds = %11, %10
%18 = phi i32 [ -1, %10 ], [ %16, %11 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @TreePtrCompare(i8* readnone %0, i8* readnone %1, i32 %2) {
%4 = icmp ugt i8* %0, %1
%5 = icmp ne i8* %0, %1
%6 = zext i1 %5 to i32
%7 = select i1 %4, i32 -1, i32 %6
ret i32 %7
}
/* Variables and functions */
unsigned short __builtin_bswap16(unsigned short);
unsigned short foou16(unsigned short);
unsigned short swapu16_cond(unsigned short x, int y) {
  unsigned short z = x;
  if (y)
    z = __builtin_bswap16(x);
  return foou16(z);
}


x86 assembly (clang, -O0):
<swapu16_cond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0xa(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1140 <swapu16_cond+0x30>
mov    -0x2(%rbp),%ax
rol    $0x8,%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%edi
call   1030 <foou16@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapu16_cond>:
mov    %edi,%eax
rol    $0x8,%ax
test   %esi,%esi
cmove  %edi,%eax
movzwl %ax,%edi
jmp    1030 <foou16@plt>

LLVM IR (-O0):
define zeroext i16 @swapu16_cond(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
%5 = alloca i16
store i16 %0, i16* %3
store i32 %1, i32* %4
%6 = load i16, i16* %3
store i16 %6, i16* %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i16, i16* %3
%11 = call i16 @llvm.bswap.i16(i16 %10)
store i16 %11, i16* %5
br label %12
12: ; preds = %9, %2
%13 = load i16, i16* %5
%14 = call zeroext i16 @foou16(i16 zeroext %13)
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @swapu16_cond(i16 zeroext %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = tail call i16 @llvm.bswap.i16(i16 %0)
%5 = select i1 %3, i16 %0, i16 %4
%6 = tail call zeroext i16 @foou16(i16 zeroext %5)
ret i16 %6
}
/* Type definitions */
struct dict {
  int dummy;
};

/* Variables and functions */
void dict_allow_resize(struct dict *dict, size_t hint) {}


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

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

LLVM IR (-O0):
%struct.dict = type { i32 }
define void @dict_allow_resize(%struct.dict* %0, i64 %1) {
%3 = alloca %struct.dict*
%4 = alloca i64
store %struct.dict* %0, %struct.dict** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
%struct.dict = type { i32 }
define void @dict_allow_resize(%struct.dict* nocapture %0, i64 %1) {
ret void
}
__attribute__((always_)) int PageUncached(struct page *page) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define i32 @PageUncached(%struct.page* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *month_name(unsigned char);
int /*<<< orphan*/ printf(char *, char *);
void print_month_name(unsigned char month) {
  printf("%s\n", month_name(month));
}


x86 assembly (clang, -O0):
<print_month_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <month_name@plt>
mov    %rax,%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_month_name>:
push   %rax
call   1040 <month_name@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_month_name(i8 zeroext %0) {
%2 = tail call i8* @month_name(i8 zeroext %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
unsigned long GetBGColor78();
unsigned long getbgcolor() { return GetBGColor78(); }


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

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

LLVM IR (-O0):
define i64 @getbgcolor() {
%1 = call i64 (...) @GetBGColor78()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getbgcolor() {
%1 = tail call i64 (...) @GetBGColor78()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int wcscoll(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int wcscoll_l(const wchar_t *l, const wchar_t *r, locale_t locale) {
  return wcscoll(l, r);
}


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

x86 assembly (clang, -O2):
<wcscoll_l>:
jmp    1030 <wcscoll@plt>

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

LLVM IR (-O2):
define i32 @wcscoll_l(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @wcscoll(i32* %0, i32* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isodigit(int);
void t_isodigit_0x31() {
  Assert_real((isodigit(49)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              250, ("isodigit should be 1 for 1"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
call   1040 <isodigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xfa,%edx
lea    0xf66(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x31>:
push   %rax
mov    $0x31,%edi
call   1040 <isodigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0xfa,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 1 for 1\00"
define void @t_isodigit_0x31() {
%1 = call i32 @isodigit(i32 49)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 1 for 1\00"
define void @t_isodigit_0x31() {
%1 = tail call i32 @isodigit(i32 49)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int read(int, char *, int);
char *read_some(int connfd) {
  char *feedback = malloc(80 * sizeof(char));
  int n = read(connfd, feedback, 80);
  if (n == 0) {
    return NULL;
  }
  return feedback;
}


x86 assembly (clang, -O0):
<read_some>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x50,%edx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1164 <read_some+0x44>
movq   $0x0,-0x8(%rbp)
jmp    116c <read_some+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_some>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
mov    $0x50,%edx
call   1030 <read@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovne %rbx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @read_some(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
%6 = call i8* @malloc(i32 80)
store i8* %6, i8** %4
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @read(i32 %7, i8* %8, i32 80)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i8* null, i8** %2
br label %15
13: ; preds = %1
%14 = load i8*, i8** %4
store i8* %14, i8** %2
br label %15
15: ; preds = %13, %12
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @read_some(i32 %0) {
%2 = tail call dereferenceable_or_null(80) i8* @malloc(i32 80)
%3 = tail call i32 @read(i32 %0, i8* %2, i32 80)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* null, i8* %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void print_diff_header(char *filename) {
  printf("diff --git a/%s b/%s\n--- a/%s\n+++ b/%s\n", filename, filename,
         filename, filename);
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"diff --git a/%s b/%s\0A--- a/%s\0A+++ b/%s\0A\00"
define void @print_diff_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"diff --git a/%s b/%s\0A--- a/%s\0A+++ b/%s\0A\00"
define void @print_diff_header(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void f11_2(void) {
  int x;
  x--;
  clang_analyzer_warnIfReached();
}


x86 assembly (clang, -O0):
<f11_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f11_2() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = add nsw i32 %2, -1
store i32 %3, i32* %1
%4 = call i32 (...) @clang_analyzer_warnIfReached()
ret void
}

LLVM IR (-O2):
define void @f11_2() {
%1 = tail call i32 (...) @clang_analyzer_warnIfReached()
ret void
}
int Cyc_Absyn_cmp_ptr(void *a, void *b) {
  void *_T0;
  unsigned _T1;
  void *_T2;
  unsigned _T3;
  unsigned _T4;
  int _T5;
  _T0 = a;
  _T1 = (unsigned)_T0;
  _T2 = b;
  _T3 = (unsigned)_T2;
  _T4 = _T1 - _T3;
  _T5 = (int)_T4;
  return _T5;
}


x86 assembly (clang, -O0):
<Cyc_Absyn_cmp_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_cmp_ptr>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @Cyc_Absyn_cmp_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%11 = load i8*, i8** %3
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = ptrtoint i8* %12 to i32
store i32 %13, i32* %6
%14 = load i8*, i8** %4
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = ptrtoint i8* %15 to i32
store i32 %16, i32* %8
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = sub i32 %17, %18
store i32 %19, i32* %9
%20 = load i32, i32* %9
store i32 %20, i32* %10
%21 = load i32, i32* %10
ret i32 %21
}

LLVM IR (-O2):
define i32 @Cyc_Absyn_cmp_ptr(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *proc) {
  assert(proc);
  printf("Usage:%s:[ip] [port]\n", proc);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"Usage:%s:[ip] [port]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g2_reg_init();
void g2_init(void) { g2_reg_init(); }


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

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

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

LLVM IR (-O2):
define void @g2_init() {
%1 = tail call i32 (...) @g2_reg_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int print_version(void) {
  printf("homer(1) - version %s\n", "0.1.3");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"homer(1) - version %s\0A\00"
@.str.1 = [6 x i8] c"0.1.3\00"
define i32 @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"homer(1) - version %s\0A\00"
@.str.1 = [6 x i8] c"0.1.3\00"
define i32 @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void f10() { __builtin_sin(0); }


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
call   1030 <sin@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f10() {
%1 = call double @sin(double 0.000000e+00)
ret void
}

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