xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int start, finish, *examine;
  examine = &start;
  *examine = 101;
  printf("%d little old ladies started the race\n", *examine);
  examine = &finish;
  *examine = 8;
  printf("But only %d little old ladies finished it", *examine);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x65,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x8,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x65,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"%d little old ladies started the race\0A\00"
@.str.1 = [42 x i8] c"But only %d little old ladies finished it\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
store i32* %2, i32** %4
%5 = load i32*, i32** %4
store i32 101, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32* %3, i32** %4
%9 = load i32*, i32** %4
store i32 8, i32* %9
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"%d little old ladies started the race\0A\00"
@.str.1 = [42 x i8] c"But only %d little old ladies finished it\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 101)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_printf_stderr(char *, ...);
void test_string_null_empty(const char *m, char c) {
  if (m == NULL)
    test_printf_stderr("% 4s %c NULL\n", "", c);
  else
    test_printf_stderr("% 4u:%c ''\n", 0u, c);
}


x86 assembly (clang, -O0):
<test_string_null_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114b <test_string_null_empty+0x3b>
movsbl -0x9(%rbp),%edx
lea    0xec8(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x0,%al
call   1030 <test_printf_stderr@plt>
jmp    115f <test_string_null_empty+0x4f>
movsbl -0x9(%rbp),%edx
lea    0xeb8(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <test_printf_stderr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_string_null_empty>:
mov    %esi,%edx
test   %rdi,%rdi
je     1127 <test_string_null_empty+0x17>
lea    0xef0(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <test_printf_stderr@plt>
lea    0xed2(%rip),%rdi
lea    0xee4(%rip),%rsi
xor    %eax,%eax
jmp    1030 <test_printf_stderr@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"% 4s %c NULL\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [12 x i8] c"% 4u:%c ''\0A\00"
define void @test_string_null_empty(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %15
11: ; preds = %2
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %13)
br label %15
15: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"% 4s %c NULL\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [12 x i8] c"% 4u:%c ''\0A\00"
define void @test_string_null_empty(i8* readnone %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
%4 = sext i8 %1 to i32
br i1 %3, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %4)
br label %9
9: ; preds = %7, %5
ret void
}
void strcatc(s, c) char *s;
char c;
{
  while (*s)
    s++;
  *s = c;
  s++;
  *s = 0;
}


x86 assembly (clang, -O0):
<strcatc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112c <strcatc+0x2c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <strcatc+0xe>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcatc>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcatc>
mov    %sil,-0x1(%rdi)
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @strcatc(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = trunc i32 %1 to i8
store i8 %9, i8* %4
store i8 0, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int,
                           int /*<<< orphan*/);
int getpid();
int getppid();
int gettid();
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ stderr;
void cancel_it(void *arg) {
  (void)arg;
  fprintf(stderr, "thread local destructor pid %d tid %d ppid %d tid %ld \n",
          getpid(), gettid(), getppid(), pthread_self());
}


x86 assembly (clang, -O0):
<cancel_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1070 <getppid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    %eax,%r9d
lea    0xe5c(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cancel_it>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2e82(%rip),%rax
mov    (%rax),%r14d
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1030 <gettid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <getppid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <pthread_self@plt>
lea    0xe75(%rip),%rsi
mov    %r14d,%edi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"thread local destructor pid %d tid %d ppid %d tid %ld \0A\00"
define void @cancel_it(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 (...) @getpid()
%6 = call i32 (...) @gettid()
%7 = call i32 (...) @getppid()
%8 = call i32 (...) @pthread_self()
%9 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"thread local destructor pid %d tid %d ppid %d tid %ld \0A\00"
define void @cancel_it(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 (...) @gettid()
%5 = tail call i32 (...) @getppid()
%6 = tail call i32 (...) @pthread_self()
%7 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6)
ret void
}
void foo_1_2_1_1_1_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_1_1_2_1_2() {
ret void
}
/* Variables and functions */
int B(int, int, int);
__attribute__((no)) int A(int x, int y, int z) { return B(z, y, x) + x * y; }


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <B@plt>
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
mov    %ebp,%edx
call   1030 <B@plt>
imul   %ebp,%ebx
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @A(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @B(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %11, %12
%14 = add nsw i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @A(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @B(i32 %2, i32 %1, i32 %0)
%5 = mul nsw i32 %1, %0
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
scalar_t__ utilIsLittleEndian();
void utilWriteInt16(unsigned char *buf, int16_t i) {
  if (utilIsLittleEndian()) {
    buf[0] = ((unsigned char *)&i)[1];
    buf[1] = ((unsigned char *)&i)[0];
  } else {
    memcpy(buf, (unsigned char *)&i, 2);
  }
}


x86 assembly (clang, -O0):
<utilWriteInt16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <utilIsLittleEndian@plt>
cmp    $0x0,%rax
je     1158 <utilWriteInt16+0x38>
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
jmp    116a <utilWriteInt16+0x4a>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilWriteInt16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,0x4(%rsp)
xor    %eax,%eax
call   1040 <utilIsLittleEndian@plt>
test   %rax,%rax
je     1141 <utilWriteInt16+0x21>
rol    $0x8,%bp
mov    %bp,(%rbx)
jmp    1153 <utilWriteInt16+0x33>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @utilWriteInt16(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = tail call i64 (...) @utilIsLittleEndian()
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = trunc i32 %1 to i8
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
store i8 %9, i8* %0
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %10
br label %14
11: ; preds = %2
%12 = bitcast i32* %3 to i8*
%13 = call i32 @memcpy(i8* %0, i8* %12, i32 2)
br label %14
14: ; preds = %11, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Extn_Reset();
int /*<<< orphan*/ IWM_Reset();
int /*<<< orphan*/ SCC_Reset();
int /*<<< orphan*/ SCSI_Reset();
int /*<<< orphan*/ Sony_Reset();
int /*<<< orphan*/ VIA1_Reset();
int /*<<< orphan*/ VIA2_Reset();
__attribute__((no)) void customreset(void) {
  IWM_Reset();
  SCC_Reset();
  SCSI_Reset();
  VIA1_Reset();
  VIA2_Reset();
  Sony_Reset();
  Extn_Reset();
}


x86 assembly (clang, -O0):
<customreset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1090 <IWM_Reset@plt>
mov    $0x0,%al
call   1080 <SCC_Reset@plt>
mov    $0x0,%al
call   1060 <SCSI_Reset@plt>
mov    $0x0,%al
call   1040 <VIA1_Reset@plt>
mov    $0x0,%al
call   1050 <VIA2_Reset@plt>
mov    $0x0,%al
call   1030 <Sony_Reset@plt>
mov    $0x0,%al
call   1070 <Extn_Reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<customreset>:
push   %rax
xor    %eax,%eax
call   1090 <IWM_Reset@plt>
xor    %eax,%eax
call   1080 <SCC_Reset@plt>
xor    %eax,%eax
call   1060 <SCSI_Reset@plt>
xor    %eax,%eax
call   1040 <VIA1_Reset@plt>
xor    %eax,%eax
call   1050 <VIA2_Reset@plt>
xor    %eax,%eax
call   1030 <Sony_Reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <Extn_Reset@plt>

LLVM IR (-O0):
define void @customreset() {
%1 = call i32 (...) @IWM_Reset()
%2 = call i32 (...) @SCC_Reset()
%3 = call i32 (...) @SCSI_Reset()
%4 = call i32 (...) @VIA1_Reset()
%5 = call i32 (...) @VIA2_Reset()
%6 = call i32 (...) @Sony_Reset()
%7 = call i32 (...) @Extn_Reset()
ret void
}

LLVM IR (-O2):
define void @customreset() {
%1 = tail call i32 (...) @IWM_Reset()
%2 = tail call i32 (...) @SCC_Reset()
%3 = tail call i32 (...) @SCSI_Reset()
%4 = tail call i32 (...) @VIA1_Reset()
%5 = tail call i32 (...) @VIA2_Reset()
%6 = tail call i32 (...) @Sony_Reset()
%7 = tail call i32 (...) @Extn_Reset()
ret void
}
int color_offset_f4(int x, int y) {
  return ((y) + ((523 * (x)) / 173) - 12111);
}


x86 assembly (clang, -O0):
<color_offset_f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x20b,-0x4(%rbp),%eax
mov    $0xad,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0x2f4f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f4>:
imul   $0x20b,%edi,%eax
cltq
imul   $0x17ad2209,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xffffd0b1,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 523, %6
%8 = sdiv i32 %7, 173
%9 = add nsw i32 %5, %8
%10 = sub nsw i32 %9, 12111
ret i32 %10
}

LLVM IR (-O2):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 523
%4 = sdiv i32 %3, 173
%5 = add i32 %1, -12111
%6 = add i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int MB_CUR_MAX;
int isu8start(unsigned char c) {
  return MB_CUR_MAX > 1 && (c & (0x80 | 0x40)) == (0x80 | 0x40);
}


x86 assembly (clang, -O0):
<isu8start>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
mov    0x2ee5(%rip),%rcx
cmpl   $0x1,(%rcx)
mov    %al,-0x2(%rbp)
jle    1133 <isu8start+0x33>
movzbl -0x1(%rbp),%eax
and    $0xc0,%eax
cmp    $0xc0,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isu8start>:
mov    0x2ef1(%rip),%rax
cmpl   $0x2,(%rax)
setge  %al
cmp    $0xc0,%dil
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@MB_CUR_MAX = global i32 0
define i32 @isu8start(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @MB_CUR_MAX
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = and i32 %7, 192
%9 = icmp eq i32 %8, 192
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@MB_CUR_MAX = global i32 0
define i32 @isu8start(i8 zeroext %0) {
%2 = load i32, i32* @MB_CUR_MAX
%3 = icmp sgt i32 %2, 1
%4 = icmp ugt i8 %0, -65
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void devpts_kill_index(int idx) {}


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

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

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

LLVM IR (-O2):
define void @devpts_kill_index(i32 %0) {
ret void
}
/* Variables and functions */
intptr_t lookupHash(intptr_t classHash, intptr_t selectorHash) {
  return (classHash ^ selectorHash) & 4096 - 1;
}


x86 assembly (clang, -O0):
<lookupHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    -0x10(%rbp),%rax
and    $0xfff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookupHash>:
mov    %rsi,%rax
xor    %edi,%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i64 @lookupHash(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 = xor i64 %5, %6
%8 = and i64 %7, 4095
ret i64 %8
}

LLVM IR (-O2):
define i64 @lookupHash(i64 %0, i64 %1) {
%3 = xor i64 %1, %0
%4 = and i64 %3, 4095
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _print_greetings_patched() { printf("Resolved IFUNC to PATCHED\n"); }


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

x86 assembly (clang, -O2):
<_print_greetings_patched>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Resolved IFUNC to PATCHED\0A\00"
define void @_print_greetings_patched() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Resolved IFUNC to PATCHED\00"
define void @_print_greetings_patched() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
int fn_ab(int a, int b) {
  int c;
  c = a + b;
  return c;
}


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

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

LLVM IR (-O0):
define i32 @fn_ab(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* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @fn_ab(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x30() {
  Assert_real((isalnum(48)),
              "/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_isalnum.c",
              245, ("isalnum should be 1 for 0"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x30>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xf5,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x30>:
push   %rax
mov    $0x30,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xf5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for 0\00"
define void @t_isalnum_0x30() {
%1 = tail call i32 @isalnum(i32 48)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int not_in_foo_h(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @not_in_foo_h(i32 returned %0) {
ret i32 %0
}
int test_unquoted_keys() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_unquoted_keys() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void binary(int n) {
  int i;
  for (i = 31; i >= 0; i--) {
    printf("%d", (n >> i) & 1);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1153 <binary+0x43>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
sar    %cl,%esi
and    $0x1,%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <binary+0x12>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x1f,%ebp
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     1140 <binary+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @binary(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 31, %1 ], [ %7, %2 ]
%4 = lshr i32 %0, %3
%5 = and i32 %4, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %3, -1
%8 = icmp eq i32 %3, 0
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int ENAMETOOLONG;
int /*<<< orphan*/ logadds(int, char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ pathlong(char *, char *);
int /*<<< orphan*/ strerror(int);
void print_error(char *src, int errno_) {
  if (errno_ == ENAMETOOLONG)
    pathlong(src, src);
  else
    logadds(-1, "%s: %s", src, strerror(errno_));
  return;
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
jne    1163 <print_error+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <pathlong@plt>
jmp    118a <print_error+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
mov    $0xffffffff,%edi
lea    0xe7b(%rip),%rsi
call   1030 <logadds@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
cmp    %esi,(%rax)
jne    114b <print_error+0x1b>
mov    %rbx,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <pathlong@plt>
mov    %esi,%edi
call   1050 <strerror@plt>
lea    0xea7(%rip),%rsi
mov    $0xffffffff,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
jmp    1030 <logadds@plt>

LLVM IR (-O0):
@ENAMETOOLONG = global i32 0
@.str = [7 x i8] c"%s: %s\00"
define void @print_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @ENAMETOOLONG
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @pathlong(i8* %9, i8* %10)
br label %17
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @strerror(i32 %14)
%16 = call i32 @logadds(i32 -1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %15)
br label %17
17: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@ENAMETOOLONG = global i32 0
@.str = [7 x i8] c"%s: %s\00"
define void @print_error(i8* %0, i32 %1) {
%3 = load i32, i32* @ENAMETOOLONG
%4 = icmp eq i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @pathlong(i8* %0, i8* %0)
br label %10
7: ; preds = %2
%8 = tail call i32 @strerror(i32 %1)
%9 = tail call i32 @logadds(i32 -1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %8)
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led0Toggle();
void TestM__Leds__led0Toggle(void) { LedsP__Leds__led0Toggle(); }


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

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

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

LLVM IR (-O2):
define void @TestM__Leds__led0Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led0Toggle()
ret void
}
/* Type definitions */
struct nlmsghdr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct nlmsghdr *);
void nlmsg_free(struct nlmsghdr *p) { free(p); }


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

x86 assembly (clang, -O2):
<nlmsg_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
define void @nlmsg_free(%struct.nlmsghdr* %0) {
%2 = alloca %struct.nlmsghdr*
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %2
%3 = load %struct.nlmsghdr*, %struct.nlmsghdr** %2
%4 = call i32 @free(%struct.nlmsghdr* %3)
ret void
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
define void @nlmsg_free(%struct.nlmsghdr* nocapture %0) {
%2 = tail call i32 @free(%struct.nlmsghdr* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int y;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xconfigure_y(void *_p, int _v) {
  ((XEvent *)_p)->xconfigure.y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xconfigure_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xconfigure_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xconfigure_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
char *_my_strdup(char const *);
char const *dirname(char *);
int /*<<< orphan*/ free(char *);
char *rfile_fn_dirname(const char *file) {
  char *fn, *dn;
  if ((fn = _my_strdup(file), !fn) || (dn = _my_strdup(dirname(fn)), !dn))
    return NULL;
  free(fn);
  return dn;
}


x86 assembly (clang, -O0):
<rfile_fn_dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_my_strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1187 <rfile_fn_dirname+0x57>
mov    -0x18(%rbp),%rdi
call   1050 <dirname@plt>
mov    %rax,%rdi
call   1030 <_my_strdup@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1187 <rfile_fn_dirname+0x57>
jmp    1194 <rfile_fn_dirname+0x64>
movq   $0x0,-0x8(%rbp)
jmp    11a5 <rfile_fn_dirname+0x75>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfile_fn_dirname>:
push   %r14
push   %rbx
push   %rax
call   1030 <_my_strdup@plt>
test   %rax,%rax
je     1163 <rfile_fn_dirname+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <dirname@plt>
mov    %rax,%rdi
call   1030 <_my_strdup@plt>
test   %rax,%rax
je     1163 <rfile_fn_dirname+0x33>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <free@plt>
jmp    1166 <rfile_fn_dirname+0x36>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @rfile_fn_dirname(i8* %0) {
%2 = tail call i8* @_my_strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i8* @dirname(i8* %2)
%6 = tail call i8* @_my_strdup(i8* %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @free(i8* %2)
br label %10
10: ; preds = %1, %4, %8
%11 = phi i8* [ %6, %8 ], [ null, %4 ], [ null, %1 ]
ret i8* %11
}
int test_imm_2Fint8_mem(signed char *val) {
  return ((*val) & (-0x2F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Fint8_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, -47
%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_2Fint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -47
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
xmain(int y) { return y; }


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

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

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

LLVM IR (-O2):
define i32 @xmain(i32 returned %0) {
ret i32 %0
}
double u64ToDouble(unsigned long long value) {
  double r;
  unsigned long long tmp = value & (0x7fffffffffffffffULL);
  r = (double)(signed long long)tmp;
  if (value & (0x8000000000000000ULL))
    r += 9.2233720368547758080e18;
  return r;
}


x86 assembly (clang, -O0):
<u64ToDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
and    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movabs $0x8000000000000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     114f <u64ToDouble+0x4f>
movsd  0xebb(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<u64ToDouble>:
movabs $0x7fffffffffffffff,%rax
ff ff 7f
and    %rdi,%rax
cvtsi2sd %rax,%xmm0
test   %rdi,%rdi
jns    111f <u64ToDouble+0x1f>
addsd  0xee1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @u64ToDouble(i64 %0) {
%2 = alloca i64
%3 = alloca double
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = and i64 %5, 9223372036854775807
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to double
store double %8, double* %3
%9 = load i64, i64* %2
%10 = and i64 %9, -9223372036854775808
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load double, double* %3
%14 = fadd double %13, 0x43E0000000000000
store double %14, double* %3
br label %15
15: ; preds = %12, %1
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @u64ToDouble(i64 %0) {
%2 = and i64 %0, 9223372036854775807
%3 = sitofp i64 %2 to double
%4 = icmp sgt i64 %0, -1
%5 = fadd double %3, 0x43E0000000000000
%6 = select i1 %4, double %3, double %5
ret double %6
}
/* Variables and functions */
double sin(double);
double module_libc_sin(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<module_libc_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @module_libc_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ debug_write(char *);
int main(int argc, char *argv[]) {
  debug_write("Hello, world!\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <debug_write@plt>
jmp    1132 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <debug_write@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @debug_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %7
br label %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @debug_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
br label %4
}
int PCGetFileSize(const char *fullPath) {
  int filesize = -1;
  return filesize;
}


x86 assembly (clang, -O0):
<PCGetFileSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @PCGetFileSize(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ memset(int volatile *, int /*<<< orphan*/, int);
__attribute__((no)) void fct(volatile int *buffer) {
  memset(buffer - 1, 0, 7 * sizeof(int));
}


x86 assembly (clang, -O0):
<fct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fct>:
add    $0xfffffffffffffffc,%rdi
xor    %esi,%esi
mov    $0x1c,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @fct(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -1
%5 = call i32 @memset(i32* %4, i32 0, i32 28)
ret void
}

LLVM IR (-O2):
define void @fct(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = tail call i32 @memset(i32* %2, i32 0, i32 28)
ret void
}
int ReallyRandom(myRange)
int myRange;
{
  int maxMultiple, rnum;
  maxMultiple = (int)(0x7FFF / myRange);
  maxMultiple *= myRange;
  while ((rnum = rand()) >= maxMultiple) {
    continue;
  }
  return (rnum % myRange);
}


x86 assembly (clang, -O0):
<ReallyRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7fff,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jl     1149 <ReallyRandom+0x39>
jmp    1131 <ReallyRandom+0x21>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReallyRandom>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x7fff,%eax
xor    %edx,%edx
idiv   %edi
mov    %edx,%ebp
xor    $0x7fff,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %ebp,%eax
jge    1130 <ReallyRandom+0x20>
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ReallyRandom(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 32767, %5
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, %7
store i32 %9, i32* %3
br label %10
10: ; preds = %14, %1
%11 = call i32 (...) @rand()
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = icmp sge i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = srem i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @ReallyRandom(i32 %0) {
%2 = srem i32 32767, %0
%3 = xor i32 %2, 32767
br label %4
4: ; preds = %4, %1
%5 = tail call i32 (...) @rand()
%6 = icmp slt i32 %5, %3
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = srem i32 %5, %0
ret i32 %8
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char *, int);
int file_is_y4m(const char detect[4]) {
  if (memcmp(detect, "YUV4", 4) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_is_y4m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1147 <file_is_y4m+0x37>
movl   $0x1,-0x4(%rbp)
jmp    114e <file_is_y4m+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_is_y4m>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"YUV4\00"
define i32 @file_is_y4m(i8* %0) {
%2 = tail call i64 @memcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
long double fmodl(long double x, long double y) {
  unsigned short fpsr;
  do
    __asm__("fprem; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y));
  while (fpsr & 0x400);
  return x;
}


x86 assembly (clang, -O0):
<fmodl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fprem
fnstsw %ax
fstp   %st(1)
fstpt  -0x10(%rbp)
mov    %ax,-0x22(%rbp)
movzwl -0x22(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
jne    1110 <fmodl+0x10>
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodl>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
nopl   0x0(%rax,%rax,1)
fprem
fnstsw %ax
test   $0x400,%eax
jne    1110 <fmodl+0x10>
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca i16
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
br label %6
6: ; preds = %12, %2
%7 = load x86_fp80, x86_fp80* %3
%8 = load x86_fp80, x86_fp80* %4
%9 = call { x86_fp80, i16 } asm "fprem; fnstsw %ax", "={st},={ax},{st(1)},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %8, x86_fp80 %7)
%10 = extractvalue { x86_fp80, i16 } %9, 0
%11 = extractvalue { x86_fp80, i16 } %9, 1
store x86_fp80 %10, x86_fp80* %3
store i16 %11, i16* %5
br label %12
12: ; preds = %6
%13 = load i16, i16* %5
%14 = zext i16 %13 to i32
%15 = and i32 %14, 1024
%16 = icmp ne i32 %15, 0
br i1 %16, label %6, label %17
17: ; preds = %12
%18 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %18
}

LLVM IR (-O2):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi x86_fp80 [ %0, %2 ], [ %6, %3 ]
%5 = tail call { x86_fp80, i16 } asm "fprem; fnstsw %ax", "={st},={ax},{st(1)},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %1, x86_fp80 %4)
%6 = extractvalue { x86_fp80, i16 } %5, 0
%7 = extractvalue { x86_fp80, i16 } %5, 1
%8 = and i16 %7, 1024
%9 = icmp eq i16 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = extractvalue { x86_fp80, i16 } %5, 0
ret x86_fp80 %11
}
int do_108() { return 108; }


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

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

LLVM IR (-O0):
define i32 @do_108() {
ret i32 108
}

LLVM IR (-O2):
define i32 @do_108() {
ret i32 108
}
int leap(float x) {
  int y, z;
  z = x / 4;
  y = (x - z) * 365 + z * 366;
  return y;
}


x86 assembly (clang, -O0):
<leap>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
subss  %xmm1,%xmm0
imul   $0x16e,-0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
movss  0xebe(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leap>:
movss  0xef8(%rip),%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
cvttps2dq %xmm1,%xmm1
imul   $0x16e,%eax,%eax
cvtsi2ss %eax,%xmm2
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
mulss  0xed7(%rip),%xmm0
addss  %xmm2,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @leap(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fdiv float %5, 4.000000e+00
%7 = fptosi float %6 to i32
store i32 %7, i32* %4
%8 = load float, float* %2
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to float
%11 = fsub float %8, %10
%12 = load i32, i32* %4
%13 = mul nsw i32 %12, 366
%14 = sitofp i32 %13 to float
%15 = call float @llvm.fmuladd.f32(float %11, float 3.650000e+02, float %14)
%16 = fptosi float %15 to i32
store i32 %16, i32* %3
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @leap(float %0) {
%2 = fmul float %0, 2.500000e-01
%3 = fptosi float %2 to i32
%4 = sitofp i32 %3 to float
%5 = fsub float %0, %4
%6 = mul nsw i32 %3, 366
%7 = sitofp i32 %6 to float
%8 = tail call float @llvm.fmuladd.f32(float %5, float 3.650000e+02, float %7)
%9 = fptosi float %8 to i32
ret i32 %9
}
/* Variables and functions */
unsigned long __builtin_arm_rsr64(char *);
unsigned long rsr64_2() { return __builtin_arm_rsr64("0:1:2:3:4"); }


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

x86 assembly (clang, -O2):
<rsr64_2>:
lea    0xee9(%rip),%rdi
jmp    1030 <__builtin_arm_rsr64@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"0:1:2:3:4\00"
define i64 @rsr64_2() {
%1 = call i64 @__builtin_arm_rsr64(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}

LLVM IR (-O2):
@.str = [10 x i8] c"0:1:2:3:4\00"
define i64 @rsr64_2() {
%1 = tail call i64 @__builtin_arm_rsr64(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}
XNoOp() {}


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

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

LLVM IR (-O0):
define i32 @XNoOp() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XNoOp() {
ret i32 undef
}