xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, unsigned char *, int);
int I4(unsigned char *p) {
  int i = 0;
  memcpy(&i, p, 4);
  return i;
}


x86 assembly (clang, -O0):
<I4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I4>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @I4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @I4(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void J422ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @J422ToARGB() {
ret void
}
/* Variables and functions */
int StatCovMomentDouble(double *, double *, int, int, int, int);
double StatCovnDouble(double a[], double b[], int n, int s) {
  return StatCovMomentDouble(a, b, n, s, 1, 1) / n;
}


x86 assembly (clang, -O0):
<StatCovnDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <StatCovMomentDouble@plt>
cltd
idivl  -0x14(%rbp)
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatCovnDouble>:
push   %rbx
mov    %edx,%ebx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <StatCovMomentDouble@plt>
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatCovnDouble(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @StatCovMomentDouble(double* %9, double* %10, i32 %11, i32 %12, i32 1, i32 1)
%14 = load i32, i32* %7
%15 = sdiv i32 %13, %14
%16 = sitofp i32 %15 to double
ret double %16
}

LLVM IR (-O2):
define double @StatCovnDouble(double* %0, double* %1, i32 %2, i32 %3) {
%5 = tail call i32 @StatCovMomentDouble(double* %0, double* %1, i32 %2, i32 %3, i32 1, i32 1)
%6 = sdiv i32 %5, %2
%7 = sitofp i32 %6 to double
ret double %7
}
void floattest(float d) {
  printf("%s with arg %g (%g)\n", __FUNCTION__, (float)d, 3.1f);
}


x86 assembly (clang, -O0):
<floattest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xedb(%rip),%rdi
lea    0xee9(%rip),%rsi
movsd  0xec4(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floattest>:
cvtss2sd %xmm0,%xmm0
lea    0xeed(%rip),%rdi
lea    0xefb(%rip),%rsi
movsd  0xed6(%rip),%xmm1
mov    $0x2,%al
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s with arg %g (%g)\0A\00"
@__FUNCTION__.floattest = [10 x i8] c"floattest\00"
define void @floattest(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.floattest, i64 0, i64 0), double %4, double 0x4008CCCCC0000000)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s with arg %g (%g)\0A\00"
@__FUNCTION__.floattest = [10 x i8] c"floattest\00"
define void @floattest(float %0) {
%2 = fpext float %0 to double
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.floattest, i64 0, i64 0), double %2, double 0x4008CCCCC0000000)
ret void
}
void RasterNibbleModeEnable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x28)))) |= (0x00400000u);
}


x86 assembly (clang, -O0):
<RasterNibbleModeEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x400000,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterNibbleModeEnable>:
add    $0x28,%edi
orl    $0x400000,(%rdi)
ret

LLVM IR (-O0):
define void @RasterNibbleModeEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 40
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 4194304
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @RasterNibbleModeEnable(i32 %0) {
%2 = add i32 %0, 40
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 4194304
store volatile i32 %6, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_read_byte(int /*<<< orphan*/ *);
bool eeconfig_read_handedness(void) {
  return !!eeprom_read_byte((uint8_t *)14);
}


x86 assembly (clang, -O0):
<eeconfig_read_handedness>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
call   1030 <eeprom_read_byte@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_read_handedness>:
push   %rax
mov    $0xe,%edi
call   1030 <eeprom_read_byte@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eeconfig_read_handedness() {
%1 = call i32 @eeprom_read_byte(i32* inttoptr (i64 14 to i32*))
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @eeconfig_read_handedness() {
%1 = tail call i32 @eeprom_read_byte(i32* inttoptr (i64 14 to i32*))
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Decodes an image data taken from the USB port of a GS820 "
         "oscilloscope to a PNM file.\n");
  printf("Usage:\n");
  printf("  decode <input-file> [color]\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf31(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"Decodes an image data taken from the USB port of a GS820 oscilloscope to a PNM file.\0A\00"
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [31 x i8] c" decode <input-file> [color]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [85 x i8] c"Decodes an image data taken from the USB port of a GS820 oscilloscope to a PNM file.\00"
@str.3 = [7 x i8] c"Usage:\00"
@str.4 = [30 x i8] c" decode <input-file> [color]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fig03_13();
int main(void) {
  fig03_13();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fig03_13()
ret i32 0
}
void gnu() {
  int a = 2, b = 3;
  int max_a_b = ({
    int _a = (a), _b = (b);
    _a > _b ? _a : _b;
  });
  int complex_a_b = ({
    int _c = (a);
    while (_c > 0) {
      _c--;
      a = a + b;
    }
    a + b + _c;
  });
}


x86 assembly (clang, -O0):
<gnu>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1135 <gnu+0x35>
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    113b <gnu+0x3b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    116e <gnu+0x6e>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <gnu+0x4d>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gnu() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 2, i32* %1
store i32 3, i32* %2
%10 = load i32, i32* %1
store i32 %10, i32* %4
%11 = load i32, i32* %2
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = load i32, i32* %4
br label %19
17: ; preds = %0
%18 = load i32, i32* %5
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
store i32 %20, i32* %6
%21 = load i32, i32* %6
store i32 %21, i32* %3
%22 = load i32, i32* %1
store i32 %22, i32* %8
br label %23
23: ; preds = %26, %19
%24 = load i32, i32* %8
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i32, i32* %8
%28 = add nsw i32 %27, -1
store i32 %28, i32* %8
%29 = load i32, i32* %1
%30 = load i32, i32* %2
%31 = add nsw i32 %29, %30
store i32 %31, i32* %1
br label %23
32: ; preds = %23
%33 = load i32, i32* %1
%34 = load i32, i32* %2
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %8
%37 = add nsw i32 %35, %36
store i32 %37, i32* %9
%38 = load i32, i32* %9
store i32 %38, i32* %7
ret void
}

LLVM IR (-O2):
define void @gnu() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t __cstring_hash(void *k) {
  char *s = k;
  uint32_t hash = 5381;
  int c = 0;
  while ((c = *s++) != '\0') {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<__cstring_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1150 <__cstring_hash+0x50>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    111e <__cstring_hash+0x1e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cstring_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <__cstring_hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <__cstring_hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @__cstring_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i32 %6, 33
%11 = add nsw i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int shutdown_free(void *data) {
  free(data);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @shutdown_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int main() {
  char *buffer = malloc(4096);
  printf("Enter the stirng....\n");
  read(0, buffer, 4096);
  printf("%s\n", buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
mov    $0x1000,%edx
call   1040 <read@plt>
mov    -0x8(%rbp),%rsi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1000,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1000,%edx
call   1040 <read@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the stirng....\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 4096)
store i8* %2, i8** %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @read(i32 0, i8* %4, i32 4096)
%6 = load i8*, i8** %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Enter the stirng....\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(4096) i8* @malloc(i32 4096)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @read(i32 0, i8* %1, i32 4096)
%4 = tail call i32 @puts(i8* dereferenceable(1) %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_putc(int /*<<< orphan*/);
void serial_puts_no_delay(const char *s) {
  while (*s != '\0') {
    serial_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<serial_puts_no_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <serial_puts_no_delay+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <serial_putc@plt>
jmp    111c <serial_puts_no_delay+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_puts_no_delay>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <serial_puts_no_delay+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <serial_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <serial_puts_no_delay+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @serial_puts_no_delay(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @serial_putc(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int IsSerialName(str)
char *str;
{
  int len = strlen(str);
  return (len > 1 && isdigit(str[len - 1]));
}


x86 assembly (clang, -O0):
<IsSerialName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1166 <IsSerialName+0x46>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSerialName>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
jl     1132 <IsSerialName+0x22>
add    $0xffffffff,%eax
movsbl (%rbx,%rax,1),%eax
add    $0xffffffd0,%eax
xor    %ecx,%ecx
cmp    $0xa,%eax
setb   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @IsSerialName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %19
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 @isdigit(i32 %16)
%18 = icmp ne i32 %17, 0
br label %19
19: ; preds = %9, %1
%20 = phi i1 [ false, %1 ], [ %18, %9 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @IsSerialName(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = add i64 %2, 4294967295
%7 = and i64 %6, 4294967295
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = add nsw i32 %10, -48
%12 = icmp ult i32 %11, 10
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %5, %1
%15 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ print_usage(char const *);
int /*<<< orphan*/ printf(char *);
void print_help(const char *bin) {
  print_usage(bin);
  printf("Options are:\n");
  printf("\tl     -- List file metadata\n");
  printf("\th     -- Display this help prompt\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <print_usage@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
call   1040 <print_usage@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Options are:\0A\00"
@.str.1 = [30 x i8] c"\09l -- List file metadata\0A\00"
@.str.2 = [36 x i8] c"\09h -- Display this help prompt\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @print_usage(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Options are:\00"
@str.3 = [29 x i8] c"\09l -- List file metadata\00"
@str.4 = [35 x i8] c"\09h -- Display this help prompt\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @print_usage(i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int syscall(int, char *, int /*<<< orphan*/);
int rmdir(char *name) { return syscall(21, name, 0); }


x86 assembly (clang, -O0):
<rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x15,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmdir>:
mov    %rdi,%rsi
mov    $0x15,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @rmdir(i8* %0) {
%2 = tail call i32 @syscall(i32 21, i8* %0, i32 0)
ret i32 %2
}
void test_one(int x) {
#pragma omp distribute simd
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_one+0x2d>
jmp    111f <test_one+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_one+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_one(i32 %0) {
ret void
}
/* Type definitions */
typedef int var;

/* Variables and functions */
bool check_bit(int var, int pos) { return ((var) & (1 << (pos))); }


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

x86 assembly (clang, -O2):
<check_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @check_bit(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 1, %6
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @check_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int get_time_units(void *self, char *units) {
  strncpy(units, "{{ time.units }}", (2048));
  return (0);
}


x86 assembly (clang, -O0):
<get_time_units>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x800,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_units>:
push   %rax
mov    %rsi,%rdi
lea    0xee5(%rip),%rsi
mov    $0x800,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"{{ time.units }}\00"
define i32 @get_time_units(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strncpy(i8* %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 2048)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"{{ time.units }}\00"
define i32 @get_time_units(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 2048)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
void shell() {
  printf("\n==Attack==\nOpening a malicious shell\n");
  setuid(0);
  system("/bin/sh");
}


x86 assembly (clang, -O0):
<shell>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <setuid@plt>
lea    0xed9(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell>:
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <setuid@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"\0A==Attack==\0AOpening a malicious shell\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @shell() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/sh\00"
@str = [38 x i8] c"\0A==Attack==\0AOpening a malicious shell\00"
define void @shell() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @setuid(i32 0)
%3 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int sad_mx_n_c(unsigned char const *, int, unsigned char const *, int,
                        unsigned int, int, int);
unsigned int vp8_sad16x8_c(const unsigned char *src_ptr, int src_stride,
                           const unsigned char *ref_ptr, int ref_stride,
                           unsigned int max_sad) {
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 8);
}


x86 assembly (clang, -O0):
<vp8_sad16x8_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x10,%r9d
movl   $0x8,(%rsp)
call   1030 <sad_mx_n_c@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad16x8_c>:
push   %rax
movl   $0x8,(%rsp)
mov    $0x10,%r9d
call   1030 <sad_mx_n_c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vp8_sad16x8_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @sad_mx_n_c(i8* %11, i32 %12, i8* %13, i32 %14, i32 %15, i32 16, i32 8)
ret i32 %16
}

LLVM IR (-O2):
define i32 @vp8_sad16x8_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 16, i32 8)
ret i32 %6
}
const char *tachyon_phaser_command(void) { return "shoot"; }


x86 assembly (clang, -O0):
<tachyon_phaser_command>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tachyon_phaser_command>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"shoot\00"
define i8* @tachyon_phaser_command() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"shoot\00"
define i8* @tachyon_phaser_command() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void cxl_teardown_msi_irqs(struct pci_dev *pdev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @cxl_teardown_msi_irqs(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
void server_respond(int fd, char *buf, size_t bufsize) {}


x86 assembly (clang, -O0):
<server_respond>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @server_respond(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @server_respond(i32 %0, i8* nocapture %1, i64 %2) {
ret void
}
void gtk_tree_view_set_drag_dest_row() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_drag_dest_row() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, int *, int, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int getCursorPos() {
  int pos;
  int80(14, &pos, 1, 0, 0, 0);
  return pos;
}


x86 assembly (clang, -O0):
<getCursorPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe,%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCursorPos>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0xe,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getCursorPos() {
%1 = alloca i32
%2 = call i32 @int80(i32 14, i32* %1, i32 1, i32 0, i32 0, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @getCursorPos() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @int80(i32 14, i32* %1, i32 1, i32 0, i32 0, i32 0)
%4 = load i32, i32* %1
ret i32 %4
}
int apply_c(int x, int (*foo)(int)) { return foo(x); }


x86 assembly (clang, -O0):
<apply_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_c>:
jmp    *%rsi

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

LLVM IR (-O2):
define i32 @apply_c(i32 %0, i32 (i32)* nocapture %1) {
%3 = tail call i32 %1(i32 %0)
ret i32 %3
}
/* Type definitions */
typedef int fpu_control_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int fetestexcept(int excepts) {
  fpu_control_t temp;
  _FPU_GETCW(temp);
  return temp & excepts & FE_ALL_EXCEPT;
}


x86 assembly (clang, -O0):
<fetestexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    0x2eb0(%rip),%rcx
and    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %3
%5 = call i32 @_FPU_GETCW(i32 %4)
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %6, %7
%9 = load i32, i32* @FE_ALL_EXCEPT
%10 = and i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fetestexcept(i32 %0) {
%2 = tail call i32 @_FPU_GETCW(i32 undef)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *__glmStrdup(const char *string) {
  char *copy;
  copy = (char *)malloc(strlen(string) + 1);
  if (copy == NULL)
    return NULL;
  strcpy(copy, string);
  return copy;
}


x86 assembly (clang, -O0):
<__glmStrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <__glmStrdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <__glmStrdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glmStrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115a <__glmStrdup+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115c <__glmStrdup+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @__glmStrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
float test_ceilf(float x) { return __builtin_ceilf(x); }


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

x86 assembly (clang, -O2):
<test_ceilf>:
jmp    1030 <ceilf@plt>

LLVM IR (-O0):
define float @test_ceilf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.ceil.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test_ceilf(float %0) {
%2 = tail call float @llvm.ceil.f32(float %0)
ret float %2
}
/* Variables and functions */
double M1_y(double, double, double, double);
double M2_x(double sign, double xi, double et, double qq) {
  return M1_y(sign, xi, et, qq);
}


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

x86 assembly (clang, -O2):
<M2_x>:
jmp    1030 <M1_y@plt>

LLVM IR (-O0):
define double @M2_x(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @M1_y(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @M2_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @M1_y(double %0, double %1, double %2, double %3)
ret double %5
}
/* Variables and functions */
scalar_t__ input_joystick_available();
char const *lang_get(char *);
const char *f_input_fire3() {
  return lang_get(input_joystick_available() ? "INPUT_JOY_FIRE3"
                                             : "INPUT_KEYB_FIRE3");
}


x86 assembly (clang, -O0):
<f_input_fire3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <input_joystick_available@plt>
mov    %rax,%rcx
lea    0xedb(%rip),%rdi
lea    0xec4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <lang_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_input_fire3>:
push   %rax
xor    %eax,%eax
call   1040 <input_joystick_available@plt>
test   %rax,%rax
lea    0xede(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <lang_get@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"INPUT_JOY_FIRE3\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE3\00"
define i8* @f_input_fire3() {
%1 = call i64 (...) @input_joystick_available()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%5 = call i8* @lang_get(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"INPUT_JOY_FIRE3\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE3\00"
define i8* @f_input_fire3() {
%1 = tail call i64 (...) @input_joystick_available()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%4 = tail call i8* @lang_get(i8* %3)
ret i8* %4
}
void i915_pmu_gt_unparked(struct drm_i915_private *i915) {}


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

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

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

LLVM IR (-O2):
%struct.drm_i915_private = type opaque
define void @i915_pmu_gt_unparked(%struct.drm_i915_private* nocapture %0) {
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *FLAC_plugin__charset_convert_string(const char *string, char *from,
                                          char *to) {
  (void)from, (void)to;
  if (!string)
    return NULL;
  return strdup(string);
}


x86 assembly (clang, -O0):
<FLAC_plugin__charset_convert_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113c <FLAC_plugin__charset_convert_string+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1149 <FLAC_plugin__charset_convert_string+0x39>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLAC_plugin__charset_convert_string>:
test   %rdi,%rdi
je     111a <FLAC_plugin__charset_convert_string+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @FLAC_plugin__charset_convert_string(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i8* @strdup(i8* %0)
br label %7
7: ; preds = %3, %5
%8 = phi i8* [ %6, %5 ], [ null, %3 ]
ret i8* %8
}
/* Variables and functions */
unsigned int bit(int);
unsigned bit_toggle(unsigned w, int n) { return bit(n) ^ w; }


x86 assembly (clang, -O0):
<bit_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bit@plt>
xor    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_toggle>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <bit@plt>
xor    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bit_toggle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @bit(i32 %5)
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bit_toggle(i32 %0, i32 %1) {
%3 = tail call i32 @bit(i32 %1)
%4 = xor i32 %3, %0
ret i32 %4
}
float calc_slider_value(float from, float to, signed int size, signed int pos) {
  if (size == 0)
    return 0;
  return from + (((float)pos) * (to - from)) / (float)size;
}


x86 assembly (clang, -O0):
<calc_slider_value>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    112b <calc_slider_value+0x2b>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <calc_slider_value+0x55>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
mulss  %xmm2,%xmm1
cvtsi2ssl -0x10(%rbp),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_slider_value>:
test   %edi,%edi
je     1120 <calc_slider_value+0x20>
cvtsi2ss %esi,%xmm2
cvtsi2ss %edi,%xmm3
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
divss  %xmm3,%xmm1
addss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @calc_slider_value(float %0, float %1, i32 %2, i32 %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca i32
store float %0, float* %6
store float %1, float* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %8
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %4
store float 0.000000e+00, float* %5
br label %25
13: ; preds = %4
%14 = load float, float* %6
%15 = load i32, i32* %9
%16 = sitofp i32 %15 to float
%17 = load float, float* %7
%18 = load float, float* %6
%19 = fsub float %17, %18
%20 = fmul float %16, %19
%21 = load i32, i32* %8
%22 = sitofp i32 %21 to float
%23 = fdiv float %20, %22
%24 = fadd float %14, %23
store float %24, float* %5
br label %25
25: ; preds = %13, %12
%26 = load float, float* %5
ret float %26
}

LLVM IR (-O2):
define float @calc_slider_value(float %0, float %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = sitofp i32 %3 to float
%8 = fsub float %1, %0
%9 = fmul float %8, %7
%10 = sitofp i32 %2 to float
%11 = fdiv float %9, %10
%12 = fadd float %11, %0
br label %13
13: ; preds = %4, %6
%14 = phi float [ %12, %6 ], [ 0.000000e+00, %4 ]
ret float %14
}
unsigned xrop3_196_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_196_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_196_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
lea    -0x100(%rsi),%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_196_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_196_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %5, -256
%7 = and i32 %4, %6
ret i32 %7
}