xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ increment(int *);
int shiftMul(int x, int k) {
  int count = 0;
  k >>= 1;
  while (k) {
    increment(&count);
    k >>= 1;
  }
  return x << count;
}


x86 assembly (clang, -O0):
<shiftMul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114f <shiftMul+0x3f>
lea    -0xc(%rbp),%rdi
call   1030 <increment@plt>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <shiftMul+0x1e>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftMul>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
movl   $0x0,0x4(%rsp)
xor    %ecx,%ecx
cmp    $0x2,%esi
jb     1155 <shiftMul+0x45>
mov    %esi,%ebx
lea    0x4(%rsp),%r15
mov    %esi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
sar    %ebp
mov    %r15,%rdi
call   1030 <increment@plt>
cmp    $0x3,%ebx
mov    %ebp,%ebx
ja     1140 <shiftMul+0x30>
mov    0x4(%rsp),%ecx
shl    %cl,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @shiftMul(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %4
%7 = ashr i32 %6, 1
store i32 %7, i32* %4
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = call i32 @increment(i32* %5)
%13 = load i32, i32* %4
%14 = ashr i32 %13, 1
store i32 %14, i32* %4
br label %8
15: ; preds = %8
%16 = load i32, i32* %3
%17 = load i32, i32* %5
%18 = shl i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @shiftMul(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = icmp ult i32 %1, 2
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %8, %6 ], [ %1, %2 ]
%8 = ashr i32 %7, 1
%9 = call i32 @increment(i32* %3)
%10 = icmp ult i32 %7, 4
br i1 %10, label %11, label %6
11: ; preds = %6
%12 = load i32, i32* %3
br label %13
13: ; preds = %11, %2
%14 = phi i32 [ %12, %11 ], [ 0, %2 ]
%15 = shl i32 %0, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ RightShiftMain();
int main() {
  RightShiftMain();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @RightShiftMain()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @RightShiftMain()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PolicyTickAt100us();
int /*<<< orphan*/ ProtocolTickAt100us();
int /*<<< orphan*/ TypeCTickAt100us();
void core_tick_at_100us(void) {
  TypeCTickAt100us();
  ProtocolTickAt100us();
  PolicyTickAt100us();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <TypeCTickAt100us@plt>
mov    $0x0,%al
call   1040 <ProtocolTickAt100us@plt>
mov    $0x0,%al
call   1050 <PolicyTickAt100us@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1030 <TypeCTickAt100us@plt>
xor    %eax,%eax
call   1040 <ProtocolTickAt100us@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <PolicyTickAt100us@plt>

LLVM IR (-O0):
define void @core_tick_at_100us() {
%1 = call i32 (...) @TypeCTickAt100us()
%2 = call i32 (...) @ProtocolTickAt100us()
%3 = call i32 (...) @PolicyTickAt100us()
ret void
}

LLVM IR (-O2):
define void @core_tick_at_100us() {
%1 = tail call i32 (...) @TypeCTickAt100us()
%2 = tail call i32 (...) @ProtocolTickAt100us()
%3 = tail call i32 (...) @PolicyTickAt100us()
ret void
}
int d_bun_rc1(double a1) { return (__builtin_isunordered(a1, 100)); }


x86 assembly (clang, -O0):
<d_bun_rc1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bun_rc1>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @d_bun_rc1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp uno double %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_bun_rc1(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int lremovexattr(char const *, char const *);
int removexattr(char const *, char const *);
int smack_remove_label_for_path(const char *path, const char *xattr,
                                int follow) {
  return follow ? removexattr(path, xattr) : lremovexattr(path, xattr);
}


x86 assembly (clang, -O0):
<smack_remove_label_for_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1152 <smack_remove_label_for_path+0x32>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <removexattr@plt>
mov    %eax,-0x18(%rbp)
jmp    1162 <smack_remove_label_for_path+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <lremovexattr@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smack_remove_label_for_path>:
test   %edx,%edx
je     1129 <smack_remove_label_for_path+0x9>
jmp    1030 <removexattr@plt>
jmp    1040 <lremovexattr@plt>

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

LLVM IR (-O2):
define i32 @smack_remove_label_for_path(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @removexattr(i8* %0, i8* %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @lremovexattr(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
void ff_hevc_put_hevc_uni_epel_h6_12_sse4() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gpuReset() {
ret void
}
/* Variables and functions */
char _ReceiveChar(long);
void WaitFor(long lPort, char cWaitChar) {
  char cChar;
  while (1) {
    cChar = _ReceiveChar(lPort);
    if (cChar == cWaitChar) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<WaitFor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_ReceiveChar@plt>
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1143 <WaitFor+0x33>
jmp    1148 <WaitFor+0x38>
jmp    1122 <WaitFor+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitFor>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <_ReceiveChar@plt>
cmp    %bpl,%al
jne    1120 <WaitFor+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @WaitFor(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
br label %6
6: ; preds = %2, %15
%7 = load i64, i64* %3
%8 = call signext i8 @_ReceiveChar(i64 %7)
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %10, %12
br i1 %13, label %14, label %15
14: ; preds = %6
br label %16
15: ; preds = %6
br label %6
16: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @WaitFor(i64 %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call signext i8 @_ReceiveChar(i64 %0)
%5 = icmp eq i8 %4, %1
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
void set_memory_ro(long addr, unsigned int pages) {}


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

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

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

LLVM IR (-O2):
define void @set_memory_ro(i64 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
__attribute__((noreturn)) void version(void) {
  fprintf(stdout, "these are not (GNU gettext-tools) 99.9999.9999\n");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [48 x i8] c"these are not (GNU gettext-tools) 99.9999.9999\0A\00"
define void @version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [48 x i8] c"these are not (GNU gettext-tools) 99.9999.9999\0A\00"
define void @version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int Pidentifier();
PkeywordNameDef() {
  int b = -1;
  ;
  b = Pidentifier();
  return (b);
}


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

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

LLVM IR (-O0):
define i32 @PkeywordNameDef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @Pidentifier()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PkeywordNameDef() {
%1 = tail call i32 (...) @Pidentifier()
ret i32 %1
}
R0R1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if (r0 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0R1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movzbl -0x5(%rbp),%eax
movzbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jg     113a <R0R1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <R0R1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0R1>:
movzbl %dil,%ecx
movzbl %sil,%edx
xor    %eax,%eax
cmp    %edx,%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @R0R1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = and i32 %0, 255
%8 = and i32 %1, 255
%9 = icmp ule i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
char *strcpy(char *d, const char *s) {
  char *r = d;
  unsigned char c;
  do {
    c = *d = *s;
    d++;
    s++;
  } while (c != 0);
  return r;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movzbl -0x19(%rbp),%eax
cmp    $0x0,%eax
jne    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %8, %3 ]
%5 = phi i8* [ %0, %2 ], [ %7, %3 ]
%6 = load i8, i8* %4
store i8 %6, i8* %5
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %6, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int controlparse_eof(struct controlparse *cp) {
  (void)cp;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.controlparse = type opaque
define i32 @controlparse_eof(%struct.controlparse* nocapture readnone %0) {
ret i32 0
}
void *splay_tree_xmalloc_allocate(size, data)
int size;
void *data __attribute__((__unused__));
{ return (void *)xmalloc(size); }


x86 assembly (clang, -O0):
<splay_tree_xmalloc_allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <xmalloc@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @splay_tree_xmalloc_allocate(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @splay_tree_xmalloc_allocate(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void ignore_signal(int signo) { signal(signo, SIG_IGN); }


x86 assembly (clang, -O0):
<ignore_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_signal>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
define void @ignore_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
define void @ignore_signal(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %0, i32 %2)
ret void
}
void encode_chs(int C, int H, int S, unsigned char *result) {
  *result++ = (unsigned char)H;
  *result++ = (unsigned char)(S + ((C & 0x00000300) >> 2));
  *result = (unsigned char)(C & 0x000000FF);
}


x86 assembly (clang, -O0):
<encode_chs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x300,%ecx
sar    $0x2,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_chs>:
mov    %sil,(%rcx)
mov    %edi,%eax
shr    $0x2,%eax
and    $0xc0,%eax
add    %edx,%eax
mov    %al,0x1(%rcx)
mov    %dil,0x2(%rcx)
ret

LLVM IR (-O0):
define void @encode_chs(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %8
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %8
store i8 %10, i8* %11
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = and i32 %14, 768
%16 = ashr i32 %15, 2
%17 = add nsw i32 %13, %16
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %8
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %8
store i8 %18, i8* %19
%21 = load i32, i32* %5
%22 = and i32 %21, 255
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %8
store i8 %23, i8* %24
ret void
}

LLVM IR (-O2):
define void @encode_chs(i32 %0, i32 %1, i32 %2, i8* nocapture writeonly %3) {
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %3
%7 = lshr i32 %0, 2
%8 = and i32 %7, 192
%9 = add nsw i32 %8, %2
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %10, i8* %6
%12 = trunc i32 %0 to i8
store i8 %12, i8* %11
ret void
}
int fun924() { return 924; }


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

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

LLVM IR (-O0):
define i32 @fun924() {
ret i32 924
}

LLVM IR (-O2):
define i32 @fun924() {
ret i32 924
}
/* Variables and functions */
int /*<<< orphan*/ smp_test_sio_sprinf();
void smp_test_sio_main() { smp_test_sio_sprinf(); }


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

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

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

LLVM IR (-O2):
define void @smp_test_sio_main() {
%1 = tail call i32 (...) @smp_test_sio_sprinf()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
int iconv_close(iconv_t cd __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @iconv_close(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __link(const char *from, const char *to) {
  if (from == NULL || to == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <__link+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1150 <__link+0x40>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <__link+0x55>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__link>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    %rax,%rcx
test   %rsi,%rsi
je     1127 <__link+0x17>
mov    0x2ec1(%rip),%rcx
test   %rdi,%rdi
cmove  %rax,%rcx
mov    (%rcx),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__link(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
%6 = load i32, i32* @EINVAL
%7 = load i32, i32* @ENOSYS
%8 = select i1 %5, i32 %6, i32 %7
%9 = tail call i32 @__set_errno(i32 %8)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sort(char *, char *, int,
                        int (*)(void const *, void const *));
void qsort(void *base, int n, int size,
           int (*cmp)(const void *, const void *)) {
  sort((char *)base, (char *)base + (n - 1) * size, size, cmp);
}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
imul   -0x10(%rbp),%eax
cltq
add    %rax,%rsi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort>:
add    $0xffffffff,%esi
imul   %edx,%esi
movslq %esi,%rsi
add    %rdi,%rsi
jmp    1030 <sort@plt>

LLVM IR (-O0):
define void @qsort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
%13 = load i32, i32* %7
%14 = mul nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %10, i64 %15
%17 = load i32, i32* %7
%18 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%19 = call i32 @sort(i8* %9, i8* %16, i32 %17, i32 (i8*, i8*)* %18)
ret void
}

LLVM IR (-O2):
define void @qsort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3) {
%5 = add nsw i32 %1, -1
%6 = mul nsw i32 %5, %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @sort(i8* %0, i8* %8, i32 %2, i32 (i8*, i8*)* %3)
ret void
}
/* Variables and functions */
double exp(double);
double Gaussian(double r, double junk, double a) {
  junk = 1;
  return exp(a * r * r);
}


x86 assembly (clang, -O0):
<Gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gaussian>:
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @Gaussian(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 1.000000e+00, double* %5
%7 = load double, double* %6
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = call double @exp(double %11)
ret double %12
}

LLVM IR (-O2):
define double @Gaussian(double %0, double %1, double %2) {
%4 = fmul double %0, %2
%5 = fmul double %4, %0
%6 = tail call double @exp(double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int helloWorld(int argc, char **argv) {
  printf("Hello World.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World.\0A\00"
define i32 @helloWorld(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World.\00"
define i32 @helloWorld(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int pidfd_open(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { return pidfd_open(getpid(), 0); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <pidfd_open@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @pidfd_open(i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @pidfd_open(i32 %1, i32 0)
ret i32 %2
}
foo(int *bar) { *bar = 8; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x8,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x8,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture writeonly %0) {
store i32 8, i32* %0
ret i32 undef
}
/* Variables and functions */
int sockWrite(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int sockPuts(int sock, char *str) {
  return (sockWrite(sock, str, strlen(str)));
}


x86 assembly (clang, -O0):
<sockPuts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <sockWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockPuts>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sockWrite@plt>

LLVM IR (-O0):
define i32 @sockPuts(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @sockWrite(i32 %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @sockPuts(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @sockWrite(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_hello() { printf("Hello World\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define void @print_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define void @print_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strpbrk(char *, char const *);
char *strsep(char **stringp, const char *delim) {
  char *ret = *stringp;
  if (ret == NULL)
    return (NULL);
  if ((*stringp = strpbrk(*stringp, delim)) != NULL) {
    *((*stringp)++) = '\0';
  }
  return (ret);
}


x86 assembly (clang, -O0):
<strsep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1143 <strsep+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1180 <strsep+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     1178 <strsep+0x68>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsep>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
test   %rbx,%rbx
je     113c <strsep+0x2c>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1030 <strpbrk@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     113c <strsep+0x2c>
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,(%r14)
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strsep(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i8* @strpbrk(i8* %3, i8* %1)
store i8* %6, i8** %0
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %9, i8** %0
store i8 0, i8* %6
br label %10
10: ; preds = %5, %8, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
long strtol(char const *, char **, int);
int main(int argc, const char *argv[]) {
  long d;
  char *endptr;
  d = strtol(argv[1], &endptr, 8);
  if (*endptr != '\0')
    return (1);
  printf("%ld", d);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116c <main+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <main+0x63>
mov    -0x18(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    %rsp,%rsi
mov    $0x8,%edx
call   1040 <strtol@plt>
mov    (%rsp),%rdx
mov    $0x1,%ecx
cmpb   $0x0,(%rdx)
jne    1151 <main+0x31>
lea    0xeb9(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @strtol(i8* %10, i8** %7, i32 8)
store i64 %11, i64* %6
%12 = load i8*, i8** %7
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %20
17: ; preds = %2
%18 = load i64, i64* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %18)
store i32 0, i32* %3
br label %20
20: ; preds = %17, %16
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i64 @strtol(i8* %6, i8** %3, i32 8)
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %7)
br label %13
13: ; preds = %2, %11
%14 = phi i32 [ 0, %11 ], [ 1, %2 ]
ret i32 %14
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_read_mixed_cell_configuration(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(80, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_read_mixed_cell_configuration>:
mov    $0x50,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @celcon_read_mixed_cell_configuration() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 80, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buf_offset(struct buf *, void *);
int /*<<< orphan*/ buf_remove(struct buf *, int /*<<< orphan*/);
void buf_removeat(struct buf *b, void *p) { buf_remove(b, buf_offset(b, p)); }


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

x86 assembly (clang, -O2):
<buf_removeat>:
push   %rbx
mov    %rdi,%rbx
call   1030 <buf_offset@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <buf_remove@plt>

LLVM IR (-O0):
%struct.buf = type { i32 }
define void @buf_removeat(%struct.buf* %0, i8* %1) {
%3 = alloca %struct.buf*
%4 = alloca i8*
store %struct.buf* %0, %struct.buf** %3
store i8* %1, i8** %4
%5 = load %struct.buf*, %struct.buf** %3
%6 = load %struct.buf*, %struct.buf** %3
%7 = load i8*, i8** %4
%8 = call i32 @buf_offset(%struct.buf* %6, i8* %7)
%9 = call i32 @buf_remove(%struct.buf* %5, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.buf = type { i32 }
define void @buf_removeat(%struct.buf* %0, i8* %1) {
%3 = tail call i32 @buf_offset(%struct.buf* %0, i8* %1)
%4 = tail call i32 @buf_remove(%struct.buf* %0, i32 %3)
ret void
}
void gdk_pixbuf_get_from_drawable() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pixbuf_get_from_drawable() {
ret void
}
char test_69_0(char *mem) { return __atomic_fetch_xor(mem + 0, -1, 4); }


x86 assembly (clang, -O0):
<test_69_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test_69_0+0x4a>
jmp    111f <test_69_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_69_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_69_0+0x10>
ret

LLVM IR (-O0):
define signext i8 @test_69_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 -1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw xor i8* %6, i8 %7 acq_rel
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @test_69_0(i8* nocapture %0) {
%2 = atomicrmw xor i8* %0, i8 -1 acq_rel
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void pfail(const char *s) {
  perror(s);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<pfail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pfail>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @pfail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @pfail(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((no)) void foo(void *p) {
  long l = (long)p;
  if (l < 0 || l > 6)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     113a <foo+0x2a>
cmpq   $0x6,-0x10(%rbp)
jle    1141 <foo+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %rdi,%rdi
js     111c <foo+0xc>
cmp    $0x7,%rdi
jge    111c <foo+0xc>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp slt i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %3
%10 = icmp sgt i64 %9, 6
br i1 %10, label %11, label %13
11: ; preds = %8, %1
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @foo(i8* readnone %0) {
%2 = icmp slt i8* %0, null
%3 = icmp sgt i8* %0, inttoptr (i64 6 to i8*)
%4 = or i1 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}
float Sleef_asinhf_u10(float x) { return __builtin_asinhf(x); }


x86 assembly (clang, -O0):
<Sleef_asinhf_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asinhf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_asinhf_u10>:
jmp    1030 <asinhf@plt>

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

LLVM IR (-O2):
define float @Sleef_asinhf_u10(float %0) {
%2 = tail call float @asinhf(float %0)
ret float %2
}
/* Variables and functions */
unsigned int readInt(int, unsigned char *);
unsigned long long readLongLong(int pos, unsigned char *cmddata) {
  unsigned int a, b;
  unsigned long long c;
  a = readInt(pos, cmddata);
  b = readInt(pos + 4, cmddata);
  c = a;
  c <<= 32;
  c |= b;
  return c;
}


x86 assembly (clang, -O0):
<readLongLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <readInt@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
add    $0x4,%edi
mov    -0x10(%rbp),%rsi
call   1030 <readInt@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x20,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLongLong>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <readInt@plt>
mov    %eax,%ebx
add    $0x4,%ebp
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <readInt@plt>
shl    $0x20,%rbx
mov    %eax,%eax
or     %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @readLongLong(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @readInt(i32 %8, i8* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 4
%13 = load i8*, i8** %4
%14 = call i32 @readInt(i32 %12, i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
store i64 %16, i64* %7
%17 = load i64, i64* %7
%18 = shl i64 %17, 32
store i64 %18, i64* %7
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = load i64, i64* %7
%22 = or i64 %21, %20
store i64 %22, i64* %7
%23 = load i64, i64* %7
ret i64 %23
}

LLVM IR (-O2):
define i64 @readLongLong(i32 %0, i8* %1) {
%3 = tail call i32 @readInt(i32 %0, i8* %1)
%4 = add nsw i32 %0, 4
%5 = tail call i32 @readInt(i32 %4, i8* %1)
%6 = zext i32 %3 to i64
%7 = shl nuw i64 %6, 32
%8 = zext i32 %5 to i64
%9 = or i64 %7, %8
ret i64 %9
}
/* Variables and functions */
double swe_degnorm(double);
double swe_difdeg2n(double p1, double p2) {
  double dif;
  dif = swe_degnorm(p1 - p2);
  if (dif >= 180.0)
    return (dif - 360.0);
  return (dif);
}


x86 assembly (clang, -O0):
<swe_difdeg2n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <swe_degnorm@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1168 <swe_difdeg2n+0x58>
movsd  -0x20(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <swe_difdeg2n+0x62>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swe_difdeg2n>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <swe_degnorm@plt>
movsd  0xede(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm2
cmpnlesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @swe_difdeg2n(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = call double @swe_degnorm(double %9)
store double %10, double* %6
%11 = load double, double* %6
%12 = fcmp oge double %11, 1.800000e+02
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load double, double* %6
%15 = fsub double %14, 3.600000e+02
store double %15, double* %3
br label %18
16: ; preds = %2
%17 = load double, double* %6
store double %17, double* %3
br label %18
18: ; preds = %16, %13
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @swe_difdeg2n(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @swe_degnorm(double %3)
%5 = fcmp ult double %4, 1.800000e+02
%6 = fadd double %4, -3.600000e+02
%7 = select i1 %5, double %4, double %6
ret double %7
}
int do_842() { return 842; }


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

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

LLVM IR (-O0):
define i32 @do_842() {
ret i32 842
}

LLVM IR (-O2):
define i32 @do_842() {
ret i32 842
}
void __attribute__((unused)) dummySyslog(__const char *__fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @dummySyslog(i8* nocapture %0, ...) {
ret void
}