xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  fprintf(stdout, "Begin run...\n");
  fprintf(stdout, "End run.\n");
  return (EXIT_SUCCESS);
}


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)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"Begin run...\0A\00"
@.str.1 = [10 x i8] c"End run.\0A\00"
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"Begin run...\0A\00"
@.str.1 = [10 x i8] c"End run.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
int /*<<< orphan*/ S_IRUSR;
int /*<<< orphan*/ provideUserAccess(char const *, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  const char *path = "/dev/tty7";
  if (argc >= 2)
    path = argv[1];
  provideUserAccess(path, R_OK, S_IRUSR);
  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)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1147 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
call   1030 <provideUserAccess@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     111c <main+0xc>
mov    0x8(%rsi),%rdi
jmp    1123 <main+0x13>
lea    0xedd(%rip),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
call   1030 <provideUserAccess@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/tty7\00"
@R_OK = global i32 0
@S_IRUSR = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
store i8* %12, i8** %6
br label %13
13: ; preds = %9, %2
%14 = load i8*, i8** %6
%15 = load i32, i32* @R_OK
%16 = load i32, i32* @S_IRUSR
%17 = call i32 @provideUserAccess(i8* %14, i32 %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/tty7\00"
@R_OK = global i32 0
@S_IRUSR = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = load i32, i32* @R_OK
%10 = load i32, i32* @S_IRUSR
%11 = tail call i32 @provideUserAccess(i8* %8, i32 %9, i32 %10)
ret i32 0
}
int check_valid_index(int index, int *board) {
  if (index > 99 || index < 0 || board[index])
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_valid_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x63,-0x8(%rbp)
jg     1131 <check_valid_index+0x31>
cmpl   $0x0,-0x8(%rbp)
jl     1131 <check_valid_index+0x31>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     113d <check_valid_index+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <check_valid_index+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_valid_index>:
xor    %eax,%eax
cmp    $0x63,%edi
ja     1112 <check_valid_index+0x12>
mov    %edi,%ecx
xor    %eax,%eax
cmpl   $0x0,(%rsi,%rcx,4)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_valid_index(i32 %0, i32* nocapture %1) {
%3 = icmp ugt i32 %0, 99
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void main() {
  char *x = "X now has a string attached\n";
  puts(x);
  x = x + 6;
  puts(x);
  x[12] = '\n';
  x[13] = '\0';
  puts(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
movb   $0xa,0xc(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0xd(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"X now has a string attached\0A\00"
define void @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @puts(i8* %2)
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 6
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @puts(i8* %6)
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 12
store i8 10, i8* %9
%10 = load i8*, i8** %1
%11 = getelementptr inbounds i8, i8* %10, i64 13
store i8 0, i8* %11
%12 = load i8*, i8** %1
%13 = call i32 @puts(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"X now has a string attached\0A\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 6))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 6))
ret void
}
/* Variables and functions */
scalar_t__ global_done();
int /*<<< orphan*/ step_begin();
void coll_begin(void) {
  if (global_done())
    return;
  step_begin();
}


x86 assembly (clang, -O0):
<coll_begin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <global_done@plt>
cmp    $0x0,%rax
je     113a <coll_begin+0x1a>
jmp    1141 <coll_begin+0x21>
mov    $0x0,%al
call   1030 <step_begin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<coll_begin>:
push   %rax
xor    %eax,%eax
call   1040 <global_done@plt>
test   %rax,%rax
je     112f <coll_begin+0xf>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <step_begin@plt>

LLVM IR (-O0):
define void @coll_begin() {
%1 = call i64 (...) @global_done()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %6
4: ; preds = %0
%5 = call i32 (...) @step_begin()
br label %6
6: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @coll_begin() {
%1 = tail call i64 (...) @global_done()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @step_begin()
br label %5
5: ; preds = %0, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int /*<<< orphan*/ LittleEndianWriteU16(int /*<<< orphan*/,
                                        int /*<<< orphan*/ *);
void LittleEndianWriteS16(int16_t value, uint8_t *bytes) {
  LittleEndianWriteU16((uint16_t)value, bytes);
}


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

x86 assembly (clang, -O2):
<LittleEndianWriteS16>:
jmp    1030 <LittleEndianWriteU16@plt>

LLVM IR (-O0):
define void @LittleEndianWriteS16(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i32*, i32** %4
%8 = call i32 @LittleEndianWriteU16(i32 %6, i32* %7)
ret void
}

LLVM IR (-O2):
define void @LittleEndianWriteS16(i64 %0, i32* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @LittleEndianWriteU16(i32 %3, i32* %1)
ret void
}
int isdotdirname(char *name) {
  if (name[0] == '.')
    return (name[1] == '.') ? !name[2] : !name[1];
  return 0;
}


x86 assembly (clang, -O0):
<isdotdirname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1163 <isdotdirname+0x63>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    1143 <isdotdirname+0x43>
mov    -0x10(%rbp),%rax
cmpb   $0x0,0x2(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <isdotdirname+0x58>
mov    -0x10(%rbp),%rax
cmpb   $0x0,0x1(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <isdotdirname+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdotdirname>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    1119 <isdotdirname+0x19>
mov    0x1(%rdi),%cl
cmp    $0x2e,%cl
jne    1112 <isdotdirname+0x12>
mov    0x2(%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

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

/* Variables and functions */
double ms20_filter_tick(struct ms20_filter *, double, double, double, double,
                        double, double);
double ms20_filter_tick_lp(struct ms20_filter *s, double dt, double freq,
                           double reso, double clip_level, double input) {
  return ms20_filter_tick(s, dt, freq, reso, clip_level, input, 0.0);
}


x86 assembly (clang, -O0):
<ms20_filter_tick_lp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
xorps  %xmm5,%xmm5
call   1030 <ms20_filter_tick@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms20_filter_tick_lp>:
xorps  %xmm5,%xmm5
jmp    1030 <ms20_filter_tick@plt>

LLVM IR (-O0):
%struct.ms20_filter = type { i32 }
define double @ms20_filter_tick_lp(%struct.ms20_filter* %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca %struct.ms20_filter*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store %struct.ms20_filter* %0, %struct.ms20_filter** %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load %struct.ms20_filter*, %struct.ms20_filter** %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load double, double* %12
%19 = call double @ms20_filter_tick(%struct.ms20_filter* %13, double %14, double %15, double %16, double %17, double %18, double 0.000000e+00)
ret double %19
}

LLVM IR (-O2):
%struct.ms20_filter = type { i32 }
define double @ms20_filter_tick_lp(%struct.ms20_filter* %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @ms20_filter_tick(%struct.ms20_filter* %0, double %1, double %2, double %3, double %4, double %5, double 0.000000e+00)
ret double %7
}
long long f(long long a) { return (int)a; }


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

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = shl i64 %0, 32
%3 = ashr exact i64 %2, 32
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ FIONBIO;
int /*<<< orphan*/ STDIN_FILENO;
int ioctl(int /*<<< orphan*/, int /*<<< orphan*/, int *);
int chat_unalarm(void) {
  int off = 0;
  return ioctl(STDIN_FILENO, FIONBIO, &off);
}


x86 assembly (clang, -O0):
<chat_unalarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chat_unalarm>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@FIONBIO = global i32 0
define i32 @chat_unalarm() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @FIONBIO
%4 = call i32 @ioctl(i32 %2, i32 %3, i32* %1)
ret i32 %4
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@FIONBIO = global i32 0
define i32 @chat_unalarm() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = load i32, i32* @STDIN_FILENO
%4 = load i32, i32* @FIONBIO
%5 = call i32 @ioctl(i32 %3, i32 %4, i32* %1)
ret i32 %5
}
int test_imm_FBint64_midword_reg(long long val) {
  return ((val >> 16) & (0xFB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FBint64_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, 251
%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_FBint64_midword_reg(i64 %0) {
%2 = and i64 %0, 16449536
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strchr(char *, char);
bool ends_in_newline(char *buf) { return !!strchr(buf, '\n'); }


x86 assembly (clang, -O0):
<ends_in_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ends_in_newline>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ends_in_newline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strchr(i8* %3, i8 signext 10)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ends_in_newline(i8* %0) {
%2 = tail call i32 @strchr(i8* %0, i8 signext 10)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *astrcpy(char const *);
size_t strlen(char const *);
char *astrright(const char *src, size_t count) {
  static const char fnName[] __attribute__((unused)) = "astrright()";
  char *rightString = NULL;
  if (count >= strlen(src)) {
    return astrcpy(src);
  } else {
    return astrcpy(&src[strlen(src) - count]);
  }
  return rightString;
}


x86 assembly (clang, -O0):
<astrright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jb     116b <astrright+0x4b>
mov    -0x10(%rbp),%rdi
call   1040 <astrcpy@plt>
mov    %rax,-0x8(%rbp)
jmp    1190 <astrright+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
sub    -0x18(%rbp),%rax
add    %rax,%rdi
call   1040 <astrcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astrright>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %edi,%edi
sub    %r14,%rax
cmovae %rax,%rdi
add    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <astrcpy@plt>

LLVM IR (-O0):
@astrright.fnName = internal constant [12 x i8] c"astrright()\00"
define i8* @astrright(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* null, i8** %6
%7 = load i64, i64* %5
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = icmp uge i64 %7, %9
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i8* @astrcpy(i8* %12)
store i8* %13, i8** %3
br label %22
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = load i8*, i8** %4
%17 = call i64 @strlen(i8* %16)
%18 = load i64, i64* %5
%19 = sub i64 %17, %18
%20 = getelementptr inbounds i8, i8* %15, i64 %19
%21 = call i8* @astrcpy(i8* %20)
store i8* %21, i8** %3
br label %22
22: ; preds = %14, %11
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @astrright(i8* %0, i64 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = call i64 @llvm.usub.sat.i64(i64 %3, i64 %1)
%5 = getelementptr i8, i8* %0, i64 %4
%6 = tail call i8* @astrcpy(i8* %5)
ret i8* %6
}
void gdk_utf8_to_compound_text_for_display() {}


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

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

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

LLVM IR (-O2):
define void @gdk_utf8_to_compound_text_for_display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ close(int);
int dup2(int, int);
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
void xdup(int infd, int outfd) {
  if (-1 == dup2(infd, outfd))
    err(EXIT_FAILURE, "dup2");
  if (outfd != infd)
    close(infd);
}


x86 assembly (clang, -O0):
<xdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dup2@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    116d <xdup+0x3d>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1050 <err@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1181 <xdup+0x51>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdup>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <dup2@plt>
cmp    $0xffffffff,%eax
je     114c <xdup+0x1c>
cmp    %ebx,%ebp
jne    1165 <xdup+0x35>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1050 <err@plt>
cmp    %ebx,%ebp
je     1145 <xdup+0x15>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <close@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [5 x i8] c"dup2\00"
define void @xdup(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 = call i32 @dup2(i32 %5, i32 %6)
%8 = icmp eq i32 -1, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @err(i32 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %2
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %3
%18 = call i32 @close(i32 %17)
br label %19
19: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [5 x i8] c"dup2\00"
define void @xdup(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @err(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
%9 = icmp eq i32 %1, %0
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 @close(i32 %0)
br label %12
12: ; preds = %10, %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int /*<<< orphan*/ PATH_MAX;
int /*<<< orphan*/ _shm_get_path(char *, int, char const *);
int unlink(char *);
int shm_unlink(const char *name) {
  char path[PATH_MAX + 1];
  if (!_shm_get_path(path, sizeof(path), name)) {
    return -1;
  }
  return unlink(path);
}


x86 assembly (clang, -O0):
<shm_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <_shm_get_path@plt>
cmp    $0x0,%eax
jne    1182 <shm_unlink+0x62>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x24(%rbp)
jmp    1195 <shm_unlink+0x75>
mov    -0x30(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_unlink>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rdx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    %rsp,%rbx
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <_shm_get_path@plt>
test   %eax,%eax
je     115c <shm_unlink+0x3c>
mov    %rbx,%rdi
call   1030 <unlink@plt>
jmp    1161 <shm_unlink+0x41>
mov    $0xffffffff,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
define i32 @shm_unlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i32, i32* @PATH_MAX
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %4
%11 = alloca i8, i64 %9
store i64 %9, i64* %5
%12 = trunc i64 %9 to i32
%13 = load i8*, i8** %3
%14 = call i32 @_shm_get_path(i8* %11, i32 %12, i8* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %1
store i32 -1, i32* %2
store i32 1, i32* %6
br label %19
17: ; preds = %1
%18 = call i32 @unlink(i8* %11)
store i32 %18, i32* %2
store i32 1, i32* %6
br label %19
19: ; preds = %17, %16
%20 = load i8*, i8** %4
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
define i32 @shm_unlink(i8* %0) {
%2 = load i32, i32* @PATH_MAX
%3 = add nsw i32 %2, 1
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @_shm_get_path(i8* %5, i32 %3, i8* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @unlink(i8* %5)
br label %10
10: ; preds = %1, %8
%11 = phi i32 [ %9, %8 ], [ -1, %1 ]
ret i32 %11
}
int Media_Pause() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Media_Pause() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 0;
  while (i < 10) {
    printf("Hello World !!!");
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello World !!!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello World !!!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ swap2(int *, int *);
int main() {
  int a = 3, b = 4;
  swap2(&a, &b);
  printf("a is %d\n", a);
  printf("b is %d\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap2@plt>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3,0x4(%rsp)
movl   $0x4,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap2@plt>
mov    0x4(%rsp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"a is %d\0A\00"
@.str.1 = [9 x i8] c"b is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 4, i32* %2
%5 = call i32 @swap2(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
void java_lang_System_initNativeLayer__() {}


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

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

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

LLVM IR (-O2):
define void @java_lang_System_initNativeLayer__() {
ret void
}
void indent(int k) {
  while (k--) {
    ;
  }
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1120 <indent+0x20>
jmp    1107 <indent+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @indent(i32 %0) {
ret void
}
/* Variables and functions */
double log10(double);
double log10_wrapper(double *arg_list) { return (log10(arg_list[0])); }


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

x86 assembly (clang, -O2):
<log10_wrapper>:
movsd  (%rdi),%xmm0
jmp    1030 <log10@plt>

LLVM IR (-O0):
define double @log10_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call double @log10(double %5)
ret double %6
}

LLVM IR (-O2):
define double @log10_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @log10(double %2)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ dump_time(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  time_t t = time(NULL);
  dump_time(t);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dump_time(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @dump_time(i32 %1)
ret i32 0
}
/* Variables and functions */
int __syscall(char const *, void *, int /*<<< orphan*/, int /*<<< orphan*/,
              int);
int stat(const char *__restrict filename, void *__restrict info) {
  return __syscall(filename, info, 0, 0, 38);
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    $0x26,%r8d
mov    %ecx,%edx
call   1030 <__syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x26,%r8d
jmp    1030 <__syscall@plt>

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

LLVM IR (-O2):
define i32 @stat(i8* noalias %0, i8* noalias %1) {
%3 = tail call i32 @__syscall(i8* %0, i8* %1, i32 0, i32 0, i32 38)
ret i32 %3
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t get_uint32(unsigned char *buf) {
  return (buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24));
}


x86 assembly (clang, -O0):
<get_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint32>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @get_uint32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
%25 = trunc i32 %24 to i8
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @get_uint32(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ geteuid();
uid_t c_geteuid(void) { return geteuid(); }


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

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

LLVM IR (-O0):
define i32 @c_geteuid() {
%1 = call i32 (...) @geteuid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @c_geteuid() {
%1 = tail call i32 (...) @geteuid()
ret i32 %1
}
int sike_r2_fp_code_identifier() { return 2; }


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

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

LLVM IR (-O0):
define i32 @sike_r2_fp_code_identifier() {
ret i32 2
}

LLVM IR (-O2):
define i32 @sike_r2_fp_code_identifier() {
ret i32 2
}
unsigned long *lvector(nl, nh)
long nh, nl;
{
  unsigned long *v;
  v = (unsigned long *)malloc((unsigned int)((nh - nl + 1 + 1) * sizeof(long)));
  if (!v)
    nrerror("allocation failure in lvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x1,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116a <lvector+0x4a>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %r14d,%esi
lea    0x10(,%rsi,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <lvector+0x2c>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = zext i32 %12 to i64
%14 = call i8* @malloc(i64 %13)
%15 = bitcast i8* %14 to i64*
store i64* %15, i64** %5
%16 = load i64*, i64** %5
%17 = icmp ne i64* %16, null
br i1 %17, label %20, label %18
18: ; preds = %2
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %2
%21 = load i64*, i64** %5
%22 = load i64, i64* %3
%23 = sub i64 0, %22
%24 = getelementptr inbounds i64, i64* %21, i64 %23
%25 = getelementptr inbounds i64, i64* %24, i64 1
ret i64* %25
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = and i64 %5, 4294967288
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @nrerror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = bitcast i8* %7 to i64*
%13 = sub i64 0, %0
%14 = getelementptr inbounds i64, i64* %12, i64 %13
%15 = getelementptr inbounds i64, i64* %14, i64 1
ret i64* %15
}
int find_middle(register int start, register int end) {
  return start + (end - start) / 2;
}


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

x86 assembly (clang, -O2):
<find_middle>:
sub    %edi,%esi
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @find_middle(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 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = sdiv i32 %8, 2
%10 = add nsw i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @find_middle(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_update_byte(int /*<<< orphan*/ *, int /*<<< orphan*/);
void eeconfig_update_default_layer(uint8_t val) {
  eeprom_update_byte((uint8_t *)3, val);
}


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

x86 assembly (clang, -O2):
<eeconfig_update_default_layer>:
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <eeprom_update_byte@plt>

LLVM IR (-O0):
define void @eeconfig_update_default_layer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @eeprom_update_byte(i32* inttoptr (i64 3 to i32*), i32 %3)
ret void
}

LLVM IR (-O2):
define void @eeconfig_update_default_layer(i32 %0) {
%2 = tail call i32 @eeprom_update_byte(i32* inttoptr (i64 3 to i32*), i32 %0)
ret void
}
char *scan_number(args, resultptr)
char *args;
int *resultptr;
{
  *resultptr = 0;
  while ('0' <= *args && *args <= '9')
    *resultptr = *resultptr * 10 + *args++ - '0';
  return (args);
}


x86 assembly (clang, -O0):
<scan_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jg     113f <scan_number+0x3f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114f <scan_number+0x4f>
jmp    1178 <scan_number+0x78>
mov    -0x10(%rbp),%rax
imul   $0xa,(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rax),%eax
add    %eax,%ecx
sub    $0x30,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1116 <scan_number+0x16>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_number>:
mov    %rdi,%rax
movl   $0x0,(%rsi)
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
cmp    $0x9,%dl
ja     113f <scan_number+0x3f>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %cl,%ecx
lea    (%rdx,%rdx,4),%edx
lea    (%rcx,%rdx,2),%edx
add    $0xffffffd0,%edx
mov    %edx,(%rsi)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
lea    -0x30(%rcx),%edi
cmp    $0xa,%dil
jb     1120 <scan_number+0x20>
ret

LLVM IR (-O0):
define i8* @scan_number(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
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp sle i32 48, %9
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ false, %6 ], [ %15, %11 ]
br i1 %17, label %18, label %29
18: ; preds = %16
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = mul nsw i32 %20, 10
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
%24 = load i8, i8* %22
%25 = sext i8 %24 to i32
%26 = add nsw i32 %21, %25
%27 = sub nsw i32 %26, 48
%28 = load i32*, i32** %4
store i32 %27, i32* %28
br label %6
29: ; preds = %16
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
define i8* @scan_number(i8* %0, i32* nocapture %1) {
store i32 0, i32* %1
%3 = load i8, i8* %0
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %2, %6
%7 = phi i8 [ %15, %6 ], [ %3, %2 ]
%8 = phi i8* [ %12, %6 ], [ %0, %2 ]
%9 = phi i32 [ %14, %6 ], [ 0, %2 ]
%10 = zext i8 %7 to i32
%11 = mul nsw i32 %9, 10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = add i32 %11, -48
%14 = add i32 %13, %10
store i32 %14, i32* %1
%15 = load i8, i8* %12
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %2
%19 = phi i8* [ %0, %2 ], [ %12, %6 ]
ret i8* %19
}