xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void test2() { printf("%d + %d = %d\n", 10, 20, (10 + 20)); }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1e,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1e,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define void @test2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 30)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define void @test2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 30)
ret void
}
void wifi_rsp_sme_start_ap_mode(
    const struct wifi_msg_sme_start_ap_mode_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_start_ap_mode_rsp_t = type opaque
define void @wifi_rsp_sme_start_ap_mode(%struct.wifi_msg_sme_start_ap_mode_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SCOTCH_errorPrint(char *);
int wgraphPartFmResize() {
  SCOTCH_errorPrint("wgraphPartFmResize: not implemented");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"wgraphPartFmResize: not implemented\00"
define i32 @wgraphPartFmResize() {
%1 = call i32 @SCOTCH_errorPrint(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"wgraphPartFmResize: not implemented\00"
define i32 @wgraphPartFmResize() {
%1 = tail call i32 @SCOTCH_errorPrint(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F2C(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double input;
  printf("Enter a Fahrenheit Temp: ");
  scanf("%lf", &input);
  printf("The corresponding Celcius temperature is: %.0lf degrees", F2C(input));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <F2C@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <F2C@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter a Fahrenheit Temp: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [56 x i8] c"The corresponding Celcius temperature is: %.0lf degrees\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call i32 @F2C(double %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter a Fahrenheit Temp: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [56 x i8] c"The corresponding Celcius temperature is: %.0lf degrees\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call i32 @F2C(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *memory_realloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (p == NULL) {
    fprintf(stderr,
            "ERROR: memory_realloc() Failed to reallocate %zd bytes memory",
            size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<memory_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <memory_realloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <memory_realloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"ERROR: memory_realloc() Failed to reallocate %zd bytes memory\00"
define i8* @memory_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i64, i64* %4
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"ERROR: memory_realloc() Failed to reallocate %zd bytes memory\00"
define noalias i8* @memory_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i64 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int __ocml_isinf_f64(double);
int __isinf(double x) { return __ocml_isinf_f64(x); }


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

x86 assembly (clang, -O2):
<__isinf>:
jmp    1030 <__ocml_isinf_f64@plt>

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

LLVM IR (-O2):
define i32 @__isinf(double %0) {
%2 = tail call i32 @__ocml_isinf_f64(double %0)
ret i32 %2
}
int getByte(int x, int n) { return (x >> (n << 3)) & 0xFF; }


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
lea    0x0(,%rsi,8),%ecx
sar    %cl,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @getByte(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 = shl i32 %6, 3
%8 = ashr i32 %5, %7
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = ashr i32 %0, %3
%5 = and i32 %4, 255
ret i32 %5
}
void av_pixelutils_get_sad_fn() {}


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

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

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

LLVM IR (-O2):
define void @av_pixelutils_get_sad_fn() {
ret void
}
int do_551() { return 551; }


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

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

LLVM IR (-O0):
define i32 @do_551() {
ret i32 551
}

LLVM IR (-O2):
define i32 @do_551() {
ret i32 551
}
/* Variables and functions */
int unmap_page(int);
int unmap_page_range(int vpg_start, int pgcount) {
  int i, res = 0;
  for (i = 0; i < pgcount; i++) {
    if (unmap_page(vpg_start + i) == -1) {
      res = -1;
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<unmap_page_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1166 <unmap_page_range+0x56>
mov    -0x4(%rbp),%edi
add    -0xc(%rbp),%edi
call   1030 <unmap_page@plt>
cmp    $0xffffffff,%eax
jne    1153 <unmap_page_range+0x43>
movl   $0xffffffff,-0x10(%rbp)
jmp    1158 <unmap_page_range+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <unmap_page_range+0x1c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmap_page_range>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1138 <unmap_page_range+0x28>
mov    %esi,%r14d
mov    %edi,%ebx
xor    %ebp,%ebp
nop
mov    %ebx,%edi
call   1030 <unmap_page@plt>
cmp    $0xffffffff,%eax
cmove  %eax,%ebp
add    $0x1,%ebx
add    $0xffffffff,%r14d
jne    1120 <unmap_page_range+0x10>
jmp    113a <unmap_page_range+0x2a>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @unmap_page_range(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %11, %4 ], [ 0, %2 ]
%7 = add nsw i32 %6, %0
%8 = tail call i32 @unmap_page(i32 %7)
%9 = icmp eq i32 %8, -1
%10 = select i1 %9, i32 -1, i32 %5
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int setegid(uid_t euid) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<setegid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setegid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setegid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setegid(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
double doubleTest(double value) { return value; }


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

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

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

LLVM IR (-O2):
define double @doubleTest(double returned %0) {
ret double %0
}
void DriverInfo_Cache(void) {}


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

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

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

LLVM IR (-O2):
define void @DriverInfo_Cache() {
ret void
}
void marker(int anarg) {
  asm("    .global "
      "set_point"
      "\n"
      "set_point"
      ":\n"
      "    call "
      "x86_trace_dummy"
      "\n");
  ++anarg;
  asm("    .global "
      "four_byter"
      "\n"
      "four_byter"
      ":\n");
}


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

x86 assembly (clang, -O2):
<marker>:
call   1030 <x86_trace_dummy@plt>

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

LLVM IR (-O2):
define void @marker(i32 %0) {
tail call void asm sideeffect " .global set_point\0Aset_point:\0A call x86_trace_dummy\0A", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " .global four_byter\0Afour_byter:\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void unallocateBlock(int *p) { *(p - 1) = (*(p - 1) & ~0x1); }


x86 assembly (clang, -O0):
<unallocateBlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%ecx
and    $0xfffffffe,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,-0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unallocateBlock>:
andb   $0xfe,-0x4(%rdi)
ret

LLVM IR (-O0):
define void @unallocateBlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -1
%5 = load i32, i32* %4
%6 = and i32 %5, -2
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 -1
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @unallocateBlock(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = load i32, i32* %2
%4 = and i32 %3, -2
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _usage(void) { printf("Usage: [path to disc] [starting object]\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Usage: [path to disc] [starting object]\0A\00"
define void @_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Usage: [path to disc] [starting object]\00"
define void @_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
f1(a) long a;
{
  int i;
  for (i = 0; i < 10; i++) {
    if (--a == -1)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    114d <f1+0x4d>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
cmp    $0xffffffffffffffff,%rax
jne    113a <f1+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <f1+0x54>
jmp    113f <f1+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <f1+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
cmp    $0x9,%rdi
mov    $0x9,%ecx
cmovb  %rdi,%rcx
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i64 %0) {
%2 = call i64 @llvm.umin.i64(i64 %0, i64 9)
%3 = trunc i64 %2 to i32
%4 = icmp ult i64 %0, 10
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ tape_reset();
void tape_shutdown(void) { tape_reset(); }


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

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

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

LLVM IR (-O2):
define void @tape_shutdown() {
%1 = tail call i32 (...) @tape_reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M92_f(char *s) {
  debug("M92_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M92_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M92_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M92_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M92_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M92_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M92_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
char *get_file_contents(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char const *);
char *get_cpu_str(const char *item, int cpuid) {
  char fn[256];
  snprintf(fn, 256, "/sys/devices/system/cpu/cpu%d/%s", cpuid, item);
  return get_file_contents(fn);
}


x86 assembly (clang, -O0):
<get_cpu_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8
mov    $0x100,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <get_file_contents@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu_str>:
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ecx
mov    %rdi,%r8
lea    0xecc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <get_file_contents@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"/sys/devices/system/cpu/cpu%d/%s\00"
define i8* @get_cpu_str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i8* @get_file_contents(i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [33 x i8] c"/sys/devices/system/cpu/cpu%d/%s\00"
define i8* @get_cpu_str(i8* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%6 = call i8* @get_file_contents(i8* %4)
ret i8* %6
}
/* Variables and functions */
scalar_t__ __builtin_llfloorl(long double);
int /*<<< orphan*/ link_failure_builtin_llfloorl();
void test_builtin_llfloorl(long double ld) {
  if (__builtin_llfloorl(ld) != __builtin_llfloorl(ld))
    link_failure_builtin_llfloorl();
}


x86 assembly (clang, -O0):
<test_builtin_llfloorl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__builtin_llfloorl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__builtin_llfloorl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_builtin_llfloorl+0x43>
mov    $0x0,%al
call   1040 <link_failure_builtin_llfloorl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_llfloorl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <__builtin_llfloorl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <__builtin_llfloorl@plt>
cmp    %rax,%rbx
jne    1151 <test_builtin_llfloorl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_llfloorl@plt>

LLVM IR (-O0):
define void @test_builtin_llfloorl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @__builtin_llfloorl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @__builtin_llfloorl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_llfloorl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_llfloorl(x86_fp80 %0) {
%2 = tail call i64 @__builtin_llfloorl(x86_fp80 %0)
%3 = tail call i64 @__builtin_llfloorl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_llfloorl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spi_transfer_nr(int /*<<< orphan*/);
void sendPixel_blank(void) {
  spi_transfer_nr(0);
  spi_transfer_nr(0);
}


x86 assembly (clang, -O0):
<sendPixel_blank>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <spi_transfer_nr@plt>
xor    %edi,%edi
call   1030 <spi_transfer_nr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendPixel_blank>:
push   %rax
xor    %edi,%edi
call   1030 <spi_transfer_nr@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <spi_transfer_nr@plt>

LLVM IR (-O0):
define void @sendPixel_blank() {
%1 = call i32 @spi_transfer_nr(i32 0)
%2 = call i32 @spi_transfer_nr(i32 0)
ret void
}

LLVM IR (-O2):
define void @sendPixel_blank() {
%1 = tail call i32 @spi_transfer_nr(i32 0)
%2 = tail call i32 @spi_transfer_nr(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  printf("%3.1f\n", 5.0);
  printf("%5.1f\n", 5.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xedb(%rip),%rdi
movsd  0xecb(%rip),%xmm0
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
movsd  0xeb7(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
movsd  0xecc(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%3.1f\0A\00"
@.str.1 = [7 x i8] c"%5.1f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 5.000000e+00)
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 5.000000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%3.1f\0A\00"
@.str.1 = [7 x i8] c"%5.1f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 5.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 5.000000e+00)
ret i32 0
}
void rop3_225_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_225_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_225_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
xor    %dl,%cl
or     %sil,%dl
or     %dl,%cl
not    %cl
and    %al,%dl
or     %cl,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_225_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_225_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %5, %2
%7 = or i8 %2, %1
%8 = or i8 %7, %6
%9 = xor i8 %8, -1
%10 = and i8 %4, %7
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Type definitions */
struct net_bridge_port {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ br_transmit_config(struct net_bridge_port *);
void br_reply(struct net_bridge_port *p) { br_transmit_config(p); }


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

x86 assembly (clang, -O2):
<br_reply>:
jmp    1030 <br_transmit_config@plt>

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

LLVM IR (-O2):
%struct.net_bridge_port = type { i32 }
define void @br_reply(%struct.net_bridge_port* %0) {
%2 = tail call i32 @br_transmit_config(%struct.net_bridge_port* %0)
ret void
}
void rmb() { asm volatile("lfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @rmb() {
tail call void asm sideeffect "lfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void av_get_pix_fmt_loss() {}


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

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

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

LLVM IR (-O2):
define void @av_get_pix_fmt_loss() {
ret void
}
void test10() {
  enum { A = 10, C = 2, B = 4, D = 12 } a;
  switch (a) {
  case 0 ... 1:
  case 2 ... 4:
  case 5 ... 9:
  case 10 ... 12:
  case 13 ... 16:
    break;
  }
}


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x10,%rax
ja     1142 <test10+0x42>
mov    -0x10(%rbp),%rax
lea    0xee0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    112e <test10+0x2e>
jmp    1133 <test10+0x33>
jmp    1138 <test10+0x38>
jmp    113d <test10+0x3d>
jmp    1142 <test10+0x42>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test10() {
%1 = alloca i32
%2 = load i32, i32* %1
switch i32 %2, label %8 [
i32 13, label %7
i32 14, label %7
i32 15, label %7
i32 16, label %7
i32 10, label %6
i32 11, label %6
i32 12, label %6
i32 5, label %5
i32 6, label %5
i32 7, label %5
i32 8, label %5
i32 9, label %5
i32 2, label %4
i32 3, label %4
i32 4, label %4
i32 0, label %3
i32 1, label %3
]
3: ; preds = %0, %0
br label %4
4: ; preds = %0, %0, %0, %3
br label %5
5: ; preds = %0, %0, %0, %0, %0, %4
br label %6
6: ; preds = %0, %0, %0, %5
br label %7
7: ; preds = %0, %0, %0, %0, %6
br label %8
8: ; preds = %0, %7
ret void
}

LLVM IR (-O2):
define void @test10() {
ret void
}
/* Variables and functions */
double ruspma_rand_decimal();
double arm2(void) { return ruspma_rand_decimal(); }


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

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

LLVM IR (-O0):
define double @arm2() {
%1 = call double (...) @ruspma_rand_decimal()
ret double %1
}

LLVM IR (-O2):
define double @arm2() {
%1 = tail call double (...) @ruspma_rand_decimal()
ret double %1
}
void foo422(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo422(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_LOCAL;
int /*<<< orphan*/ SOCK_RAW;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void socketNotClosed() {
  int fd = socket(AF_LOCAL, SOCK_RAW, 0);
  if (fd != -1) {
    char buffer[256];
    write(fd, buffer, strlen(buffer));
  }
}


x86 assembly (clang, -O0):
<socketNotClosed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1198 <socketNotClosed+0x68>
mov    -0x4(%rbp),%eax
mov    %eax,-0x11c(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
lea    -0x110(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x11c(%rbp),%edi
mov    -0x118(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketNotClosed>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
cmp    $0xffffffff,%eax
je     1171 <socketNotClosed+0x41>
mov    %eax,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@AF_LOCAL = global i32 0
@SOCK_RAW = global i32 0
define void @socketNotClosed() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = load i32, i32* @AF_LOCAL
%4 = load i32, i32* @SOCK_RAW
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i32, i32* %1
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @write(i32 %9, i8* %10, i32 %12)
br label %14
14: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
@AF_LOCAL = global i32 0
@SOCK_RAW = global i32 0
define void @socketNotClosed() {
%1 = alloca [256 x i8]
%2 = load i32, i32* @AF_LOCAL
%3 = load i32, i32* @SOCK_RAW
%4 = tail call i32 @socket(i32 %2, i32 %3, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %4, i8* %7, i32 %8)
br label %10
10: ; preds = %6, %0
ret void
}
void *pgeVramRelativePointer(void *ptr) {
  return (void *)((unsigned long)ptr & ~0x04000000);
}


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

x86 assembly (clang, -O2):
<pgeVramRelativePointer>:
mov    %rdi,%rax
and    $0xfffffffffbffffff,%rax
ret

LLVM IR (-O0):
define i8* @pgeVramRelativePointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, -67108865
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @pgeVramRelativePointer(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, -67108865
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void subChar(char *s, char oldChar, char newChar) {
  char c;
  for (;;) {
    c = *s;
    if (c == 0)
      break;
    if (c == oldChar)
      *s = newChar;
    ++s;
  }
}


x86 assembly (clang, -O0):
<subChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xb(%rbp)
movsbl -0xb(%rbp),%eax
cmp    $0x0,%eax
jne    112e <subChar+0x2e>
jmp    1158 <subChar+0x58>
movsbl -0xb(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <subChar+0x47>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <subChar+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<subChar>:
mov    (%rdi),%al
test   %al,%al
je     1125 <subChar+0x25>
add    $0x1,%rdi
jmp    111b <subChar+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <subChar+0x25>
cmp    %sil,%al
jne    1110 <subChar+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <subChar+0x10>
ret

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

LLVM IR (-O2):
define void @subChar(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int fflush(int /*<<< orphan*/ *);
int sca_fflush(FILE *Stream) {
  int value;
  value = -1;
  errno = EINTR;
  while (value == -1 && errno == EINTR) {
    value = fflush(Stream);
  }
}


x86 assembly (clang, -O0):
<sca_fflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%rcx
mov    0x2eac(%rip),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
cmpl   $0xffffffff,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jne    1160 <sca_fflush+0x50>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1170 <sca_fflush+0x60>
jmp    1181 <sca_fflush+0x71>
mov    -0x10(%rbp),%rdi
call   1030 <fflush@plt>
mov    %eax,-0x14(%rbp)
jmp    1137 <sca_fflush+0x27>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sca_fflush>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb9(%rip),%r14
mov    (%r14),%rax
mov    0x2eb7(%rip),%r15
mov    %rax,(%r15)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <fflush@plt>
cmp    $0xffffffff,%eax
jne    1145 <sca_fflush+0x35>
mov    (%r14),%rax
cmp    %rax,(%r15)
je     1130 <sca_fflush+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EINTR = global i64 0
@errno = global i64 0
define i32 @sca_fflush(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 -1, i32* %4
%5 = load i64, i64* @EINTR
store i64 %5, i64* @errno
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i64, i64* @errno
%11 = load i64, i64* @EINTR
%12 = icmp eq i64 %10, %11
br label %13
13: ; preds = %9, %6
%14 = phi i1 [ false, %6 ], [ %12, %9 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32*, i32** %3
%17 = call i32 @fflush(i32* %16)
store i32 %17, i32* %4
br label %6
18: ; preds = %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@EINTR = global i64 0
@errno = global i64 0
define i32 @sca_fflush(i32* nocapture %0) {
%2 = load i64, i64* @EINTR
store i64 %2, i64* @errno
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @fflush(i32* %0)
%5 = icmp eq i32 %4, -1
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
%9 = select i1 %5, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3
ret i32 undef
}
void g_closure_add_marshal_guards() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_add_marshal_guards() {
ret void
}
void ipipe_init_vector_irq(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @ipipe_init_vector_irq(i32 %0) {
ret void
}
void cond_dummy_copy(const struct XCSF *xcsf, struct Cl *dest,
                     const struct Cl *src) {
  (void)xcsf;
  (void)dest;
  (void)src;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_copy(%struct.XCSF* %0, %struct.Cl* %1, %struct.Cl* %2) {
%4 = alloca %struct.XCSF*
%5 = alloca %struct.Cl*
%6 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %4
store %struct.Cl* %1, %struct.Cl** %5
store %struct.Cl* %2, %struct.Cl** %6
%7 = load %struct.XCSF*, %struct.XCSF** %4
%8 = load %struct.Cl*, %struct.Cl** %5
%9 = load %struct.Cl*, %struct.Cl** %6
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_copy(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, %struct.Cl* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ download();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ parse_args(int, char **);
int main(int argc, char *argv[]) {
  parse_args(argc, argv);
  download();
  exit(0);
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_args@plt>
mov    $0x0,%al
call   1040 <download@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O0):
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* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_args(i32 %6, i8** %7)
%9 = call i32 (...) @download()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @download()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_detach();
int /*<<< orphan*/ test_link();
int /*<<< orphan*/ test_move();
int /*<<< orphan*/ test_parent_count();
int /*<<< orphan*/ test_unlink();
int main() {
  test_link();
  test_unlink();
  test_detach();
  test_move();
  test_parent_count();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_link@plt>
mov    $0x0,%al
call   1050 <test_unlink@plt>
mov    $0x0,%al
call   1070 <test_detach@plt>
mov    $0x0,%al
call   1040 <test_move@plt>
mov    $0x0,%al
call   1060 <test_parent_count@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_link@plt>
xor    %eax,%eax
call   1050 <test_unlink@plt>
xor    %eax,%eax
call   1070 <test_detach@plt>
xor    %eax,%eax
call   1040 <test_move@plt>
xor    %eax,%eax
call   1060 <test_parent_count@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_link()
%3 = call i32 (...) @test_unlink()
%4 = call i32 (...) @test_detach()
%5 = call i32 (...) @test_move()
%6 = call i32 (...) @test_parent_count()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_link()
%2 = tail call i32 (...) @test_unlink()
%3 = tail call i32 (...) @test_detach()
%4 = tail call i32 (...) @test_move()
%5 = tail call i32 (...) @test_parent_count()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char const *);
void dolog(const char *v) {
  openlog("elmboxo", LOG_PID, 1);
  syslog(LOG_INFO, v);
  closelog();
}


x86 assembly (clang, -O0):
<dolog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x1,%edx
call   1050 <openlog@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dolog>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
mov    $0x1,%edx
call   1050 <openlog@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"elmboxo\00"
@LOG_PID = global i32 0
@LOG_INFO = global i32 0
define void @dolog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_PID
%4 = call i32 @openlog(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3, i32 1)
%5 = load i32, i32* @LOG_INFO
%6 = load i8*, i8** %2
%7 = call i32 @syslog(i32 %5, i8* %6)
%8 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"elmboxo\00"
@LOG_PID = global i32 0
@LOG_INFO = global i32 0
define void @dolog(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1)
%4 = load i32, i32* @LOG_INFO
%5 = tail call i32 @syslog(i32 %4, i8* %0)
%6 = tail call i32 (...) @closelog()
ret void
}