xunge/DecIR huggingface dataset:
unsigned long ltobl(unsigned long little) {
  int c = 0;
  union {
    unsigned long big;
    char bytes[sizeof(unsigned long)];
  } swapper_big;
  union {
    char bytes[sizeof(unsigned long)];
    unsigned long little;
  } swapper_little;
  swapper_little.little = little;
  for (c = 0; c < sizeof(unsigned long); c++)
    swapper_big.bytes[c] = swapper_little.bytes[sizeof(unsigned long) - c - 1];
  return (swapper_big.big);
}


x86 assembly (clang, -O0):
<ltobl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x8,%rax
jae    1156 <ltobl+0x56>
movslq -0xc(%rbp),%rcx
mov    $0x8,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    -0x20(%rbp,%rax,1),%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x18(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111e <ltobl+0x1e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltobl>:
mov    %rdi,%rax
bswap  %rax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
%union.anon.0 = type { i64 }
define i64 @ltobl(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca %union.anon
%5 = alloca %union.anon.0
store i64 %0, i64* %2
store i32 0, i32* %3
%6 = load i64, i64* %2
%7 = bitcast %union.anon.0* %5 to i64*
store i64 %6, i64* %7
store i32 0, i32* %3
br label %8
8: ; preds = %24, %1
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = icmp ult i64 %10, 8
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = bitcast %union.anon.0* %5 to [8 x i8]*
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = sub i64 8, %15
%17 = sub i64 %16, 1
%18 = getelementptr inbounds [8 x i8], [8 x i8]* %13, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = bitcast %union.anon* %4 to [8 x i8]*
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8 x i8], [8 x i8]* %20, i64 0, i64 %22
store i8 %19, i8* %23
br label %24
24: ; preds = %12
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %8
27: ; preds = %8
%28 = bitcast %union.anon* %4 to i64*
%29 = load i64, i64* %28
ret i64 %29
}

LLVM IR (-O2):
define i64 @ltobl(i64 %0) {
%2 = call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
void write_event_with_delay(delta, event_type, channel, data, n) int delta;
int event_type;
int channel, n;
char data[];
{
  if (channel >= 16) {
    event_error("Channel limit exceeded\n");
  } else {
    mf_write_midi_event(delta, event_type, channel, data, n);
  };
}


x86 assembly (clang, -O0):
<write_event_with_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
cmpl   $0x10,-0xc(%rbp)
jl     1156 <write_event_with_delay+0x36>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <event_error@plt>
jmp    116e <write_event_with_delay+0x4e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x0,%al
call   1030 <mf_write_midi_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_event_with_delay>:
cmp    $0x10,%edx
jl     1133 <write_event_with_delay+0x13>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
jmp    1040 <event_error@plt>
xor    %eax,%eax
jmp    1030 <mf_write_midi_event@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Channel limit exceeded\0A\00"
define void @write_event_with_delay(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %8
%12 = icmp sge i32 %11, 16
br i1 %12, label %13, label %15
13: ; preds = %5
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @event_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %22
15: ; preds = %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = load i8*, i8** %9
%20 = load i32, i32* %10
%21 = call i32 (i32, i32, i32, i8*, i32, ...) bitcast (i32 (...)* @mf_write_midi_event to i32 (i32, i32, i32, i8*, i32, ...)*)(i32 %16, i32 %17, i32 %18, i8* %19, i32 %20)
br label %22
22: ; preds = %15, %13
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Channel limit exceeded\0A\00"
define void @write_event_with_delay(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = icmp sgt i32 %2, 15
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @event_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %5
%10 = tail call i32 (i32, i32, i32, i8*, i32, ...) bitcast (i32 (...)* @mf_write_midi_event to i32 (i32, i32, i32, i8*, i32, ...)*)(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
volatile bool buttonRight(volatile unsigned int *p) {
  static bool b = false;
  if (((*p) & 0x00000008) == 0x00000008) {
    if (b == false) {
      b = true;
      return true;
    } else
      return false;
  }
  b = false;
  return false;
}


x86 assembly (clang, -O0):
<buttonRight>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x8,%eax
jne    1149 <buttonRight+0x49>
cmpl   $0x0,0x2f03(%rip)
jne    113d <buttonRight+0x3d>
movl   $0x1,0x2ef3(%rip)
movl   $0x1,-0x4(%rbp)
jmp    115a <buttonRight+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    115a <buttonRight+0x5a>
movl   $0x0,0x2ed1(%rip)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buttonRight>:
mov    (%rdi),%ecx
xor    %edx,%edx
test   $0x8,%cl
je     1119 <buttonRight+0x19>
mov    $0x1,%edx
xor    %eax,%eax
cmpb   $0x0,0x2f0d(%rip)
jne    1127 <buttonRight+0x27>
shr    $0x3,%cl
and    $0x1,%cl
mov    %cl,0x2eff(%rip)
mov    %edx,%eax
ret

LLVM IR (-O0):
@buttonRight.b = internal global i32 0
define i32 @buttonRight(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 8
%7 = icmp eq i32 %6, 8
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @buttonRight.b
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* @buttonRight.b
store i32 1, i32* %2
br label %14
12: ; preds = %8
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* @buttonRight.b
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@buttonRight.b = internal unnamed_addr global i1 false
define i32 @buttonRight(i32* %0) {
%2 = load volatile i32, i32* %0
%3 = and i32 %2, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i1, i1* @buttonRight.b
br i1 %6, label %10, label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
%9 = xor i1 %4, true
store i1 %9, i1* @buttonRight.b
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ 0, %5 ], [ %8, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/
get_nth_fibonacci_non_recursive_algorithm(unsigned long long);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  unsigned long long n = 1000000;
  printf("\n\n------\n");
  printf("[c99] nth_fibonacci_non_recursive_algorithm(%d)=%llu\n", n,
         get_nth_fibonacci_non_recursive_algorithm(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xf4240,-0x18(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <get_nth_fibonacci_non_recursive_algorithm@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf4240,%edi
call   1050 <get_nth_fibonacci_non_recursive_algorithm@plt>
lea    0xeb2(%rip),%rdi
mov    $0xf4240,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0A\0A------\0A\00"
@.str.1 = [54 x i8] c"[c99] nth_fibonacci_non_recursive_algorithm(%d)=%llu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 1000000, i64* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i64, i64* %6
%9 = load i64, i64* %6
%10 = call i32 @get_nth_fibonacci_non_recursive_algorithm(i64 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i64 %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [54 x i8] c"[c99] nth_fibonacci_non_recursive_algorithm(%d)=%llu\0A\00"
@str = [9 x i8] c"\0A\0A------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @get_nth_fibonacci_non_recursive_algorithm(i64 1000000)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i64 1000000, i32 %4)
ret i32 0
}
int bobette(char y) {}


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

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

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

LLVM IR (-O2):
define i32 @bobette(i8 signext %0) {
ret i32 undef
}
main() {
a:
  &&a;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %4, %0
%3 = load i32, i32* %1
ret i32 %3
4: ; No predecessors!
indirectbr i8* undef, [label %2]
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dtype_normalize(char *, char const *);
int strcmp(char *, char *);
int dtype_cmp(const char *dtype1, const char *dtype2) {
  char ndtype1[8], ndtype2[8];
  dtype_normalize(ndtype1, dtype1);
  dtype_normalize(ndtype2, dtype2);
  return strcmp(ndtype1, ndtype2);
}


x86 assembly (clang, -O0):
<dtype_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <dtype_normalize@plt>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <dtype_normalize@plt>
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtype_cmp>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1030 <dtype_normalize@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <dtype_normalize@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @dtype_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [8 x i8]
%6 = alloca [8 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @dtype_normalize(i8* %7, i8* %8)
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @dtype_normalize(i8* %10, i8* %11)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @dtype_cmp(i8* %0, i8* %1) {
%3 = alloca [8 x i8]
%4 = alloca [8 x i8]
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%7 = call i32 @dtype_normalize(i8* %5, i8* %0)
%8 = call i32 @dtype_normalize(i8* %6, i8* %1)
%9 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %9
}
int value2scale(double val, double mx) {
  val = 100.0 * val / mx;
  if (val > 75)
    return 4;
  if (val > 50)
    return 3;
  if (val > 25)
    return 2;
  if (val > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<value2scale>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xef2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1148 <value2scale+0x48>
movl   $0x4,-0x4(%rbp)
jmp    11b3 <value2scale+0xb3>
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116b <value2scale+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    11b3 <value2scale+0xb3>
movsd  -0x10(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    118e <value2scale+0x8e>
movl   $0x2,-0x4(%rbp)
jmp    11b3 <value2scale+0xb3>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11ac <value2scale+0xac>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <value2scale+0xb3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<value2scale>:
mulsd  0xef8(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    $0x4,%eax
ucomisd 0xeef(%rip),%xmm0
ja     1146 <value2scale+0x46>
mov    $0x3,%eax
ucomisd 0xee8(%rip),%xmm0
ja     1146 <value2scale+0x46>
mov    $0x2,%eax
ucomisd 0xee1(%rip),%xmm0
ja     1146 <value2scale+0x46>
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @value2scale(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fmul double 1.000000e+02, %6
%8 = load double, double* %5
%9 = fdiv double %7, %8
store double %9, double* %4
%10 = load double, double* %4
%11 = fcmp ogt double %10, 7.500000e+01
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 4, i32* %3
br label %26
13: ; preds = %2
%14 = load double, double* %4
%15 = fcmp ogt double %14, 5.000000e+01
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 3, i32* %3
br label %26
17: ; preds = %13
%18 = load double, double* %4
%19 = fcmp ogt double %18, 2.500000e+01
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 2, i32* %3
br label %26
21: ; preds = %17
%22 = load double, double* %4
%23 = fcmp ogt double %22, 0.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 1, i32* %3
br label %26
25: ; preds = %21
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %20, %16, %12
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @value2scale(double %0, double %1) {
%3 = fmul double %0, 1.000000e+02
%4 = fdiv double %3, %1
%5 = fcmp ogt double %4, 7.500000e+01
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = fcmp ogt double %4, 5.000000e+01
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = fcmp ogt double %4, 2.500000e+01
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = fcmp ogt double %4, 0.000000e+00
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %8, %6, %2
%14 = phi i32 [ 4, %2 ], [ 3, %6 ], [ 2, %8 ], [ %12, %10 ]
ret i32 %14
}
int test_imm_1Dint16_reg(short val) {
  return ((val) & (0x1D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Dint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x1d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Dint16_reg>:
test   $0x1d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Dint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 29
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_1Dint16_reg(i16 signext %0) {
%2 = and i16 %0, 29
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct entry_list {
  int dummy;
};

/* Variables and functions */
int genlist_size(struct genlist const *);
int entry_list_size(const struct entry_list *tthis) {
  return genlist_size((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<entry_list_size>:
jmp    1030 <genlist_size@plt>

LLVM IR (-O0):
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define i32 @entry_list_size(%struct.entry_list* %0) {
%2 = alloca %struct.entry_list*
store %struct.entry_list* %0, %struct.entry_list** %2
%3 = load %struct.entry_list*, %struct.entry_list** %2
%4 = bitcast %struct.entry_list* %3 to %struct.genlist*
%5 = call i32 @genlist_size(%struct.genlist* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define i32 @entry_list_size(%struct.entry_list* %0) {
%2 = bitcast %struct.entry_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_size(%struct.genlist* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "usage: %s [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb] dbpath\n",
          prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"usage: %s [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb] dbpath\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"usage: %s [-V] [-f output] [-l] [-n] [-p] [-a|-s subdb] dbpath\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void gtk_window_set_skip_pager_hint() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_skip_pager_hint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ random();
int main() {
  int i, count = 99999999;
  for (i = 0; i < count; i += 1) {
    printf("%d\n", (int)random());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5f5e0ff,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116c <main+0x4c>
mov    $0x0,%al
call   1040 <random@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x5f5e0ff,%ebp
lea    0xed1(%rip),%rbx
nop
xor    %eax,%eax
call   1040 <random@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @random()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 99999999
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
unsigned short VIM_HIF_GetReg16(int);
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_HIF_SetModClkOn(unsigned short wVal) {
  unsigned short wClockSetting = 0;
  wClockSetting = VIM_HIF_GetReg16((0x1400 + 0x00A));
  wClockSetting &= ~wVal;
  VIM_HIF_SetReg8((0x1400 + 0x00A), (unsigned char)(wClockSetting));
  VIM_HIF_SetReg8((0x1400 + 0x00B), (unsigned char)(wClockSetting >> 8));
}


x86 assembly (clang, -O0):
<VIM_HIF_SetModClkOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
mov    $0x140a,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%ecx
xor    $0xffffffff,%ecx
movzwl -0x4(%rbp),%eax
and    %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    $0x140a,%edi
movzbl %al,%esi
call   1040 <VIM_HIF_SetReg8@plt>
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
mov    $0x140b,%edi
movzbl %al,%esi
call   1040 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_HIF_SetModClkOn>:
push   %rbx
mov    %edi,%ebx
mov    $0x140a,%edi
call   1030 <VIM_HIF_GetReg16@plt>
not    %ebx
and    %eax,%ebx
movzbl %bl,%esi
mov    $0x140a,%edi
call   1040 <VIM_HIF_SetReg8@plt>
movzbl %bh,%esi
mov    $0x140b,%edi
pop    %rbx
jmp    1040 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_HIF_SetModClkOn(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
store i16 0, i16* %3
%4 = call zeroext i16 @VIM_HIF_GetReg16(i32 5130)
store i16 %4, i16* %3
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = xor i32 %6, -1
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = and i32 %9, %7
%11 = trunc i32 %10 to i16
store i16 %11, i16* %3
%12 = load i16, i16* %3
%13 = trunc i16 %12 to i8
%14 = call i32 @VIM_HIF_SetReg8(i32 5130, i8 zeroext %13)
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
%17 = ashr i32 %16, 8
%18 = trunc i32 %17 to i8
%19 = call i32 @VIM_HIF_SetReg8(i32 5131, i8 zeroext %18)
ret void
}

LLVM IR (-O2):
define void @VIM_HIF_SetModClkOn(i16 zeroext %0) {
%2 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 5130)
%3 = xor i16 %0, -1
%4 = and i16 %2, %3
%5 = trunc i16 %4 to i8
%6 = tail call i32 @VIM_HIF_SetReg8(i32 5130, i8 zeroext %5)
%7 = lshr i16 %4, 8
%8 = trunc i16 %7 to i8
%9 = tail call i32 @VIM_HIF_SetReg8(i32 5131, i8 zeroext %8)
ret void
}
/* Variables and functions */
int rom_present(char *);
int ati18800_available(void) {
  return rom_present(L"roms/video/ati18800/vgaedge16.vbi");
}


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

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

LLVM IR (-O0):
@.str = [34 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 97, i32 116, i32 105, i32 49, i32 56, i32 56, i32 48, i32 48, i32 47, i32 118, i32 103, i32 97, i32 101, i32 100, i32 103, i32 101, i32 49, i32 54, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @ati18800_available() {
%1 = call i32 @rom_present(i8* bitcast ([34 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [34 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 97, i32 116, i32 105, i32 49, i32 56, i32 56, i32 48, i32 48, i32 47, i32 118, i32 103, i32 97, i32 101, i32 100, i32 103, i32 101, i32 49, i32 54, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @ati18800_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([34 x i32]* @.str to i8*))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *init_file_ptr(char *name, char *mode) {
  FILE *file = NULL;
  file = fopen(name, mode);
  if (file == NULL) {
    fprintf(stderr, "Initialisation of %s impossible\n\n", name);
    exit(EXIT_FAILURE);
  }
  return file;
}


x86 assembly (clang, -O0):
<init_file_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118b <init_file_ptr+0x5b>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Initialisation of %s impossible\0A\0A\00"
@EXIT_FAILURE = global i32 0
define i32* @init_file_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32* null, i32** %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
%18 = load i32*, i32** %5
ret i32* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Initialisation of %s impossible\0A\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i32* @init_file_ptr(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("\nusage: uc goal-node\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"\0Ausage: uc goal-node\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"\0Ausage: uc goal-node\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
int isLittleEndian() {
  int i = 1;
  return (*(unsigned char *)&i == 1);
}


x86 assembly (clang, -O0):
<isLittleEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movzbl -0x4(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isLittleEndian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isLittleEndian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ mmcau_sha256_hash_n(unsigned int *, int, unsigned int *);
void mmcau_sha256_hash(unsigned int input[], unsigned int output[]) {
  mmcau_sha256_hash_n(input, 1, output);
}


x86 assembly (clang, -O0):
<mmcau_sha256_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <mmcau_sha256_hash_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmcau_sha256_hash>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <mmcau_sha256_hash_n@plt>

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

LLVM IR (-O2):
define void @mmcau_sha256_hash(i32* %0, i32* %1) {
%3 = tail call i32 @mmcau_sha256_hash_n(i32* %0, i32 1, i32* %1)
ret void
}
int is_tree_qfmt(int fmt) { return fmt == 1 || fmt == 2; }


x86 assembly (clang, -O0):
<is_tree_qfmt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <is_tree_qfmt+0x20>
cmpl   $0x2,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_tree_qfmt>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_tree_qfmt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 2
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_tree_qfmt(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *getenv(char *);
const char *stringprep_locale_charset(void) {
  const char *charset = getenv("CHARSET");
  if (charset && *charset)
    return charset;
  return "ASCII";
}


x86 assembly (clang, -O0):
<stringprep_locale_charset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <stringprep_locale_charset+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <stringprep_locale_charset+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <stringprep_locale_charset+0x4b>
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringprep_locale_charset>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1129 <stringprep_locale_charset+0x19>
cmpb   $0x0,(%rax)
je     1129 <stringprep_locale_charset+0x19>
pop    %rcx
ret
lea    0xed8(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"CHARSET\00"
@.str.1 = [6 x i8] c"ASCII\00"
define i8* @stringprep_locale_charset() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = load i8*, i8** %2
store i8* %12, i8** %1
br label %14
13: ; preds = %6, %0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %14
14: ; preds = %13, %11
%15 = load i8*, i8** %1
ret i8* %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"CHARSET\00"
@.str.1 = [6 x i8] c"ASCII\00"
define i8* @stringprep_locale_charset() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %6 ], [ %1, %3 ]
ret i8* %8
}
unsigned int byteswap16(unsigned int x) { return __builtin_bswap16(x); }


x86 assembly (clang, -O0):
<byteswap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
rol    $0x8,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteswap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @byteswap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
%5 = call i16 @llvm.bswap.i16(i16 %4)
%6 = zext i16 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @byteswap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
int rsock_shutdown_how_to_int(const char *str, long len, int *valp) {
  switch (len) {
  case 2:
    return -1;
  case 4:
    return -1;
  case 7:
    return -1;
  case 9:
    return -1;
  default:
    if (!str || !valp) {
    }
    return -1;
  }
}


x86 assembly (clang, -O0):
<rsock_shutdown_how_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x28(%rbp)
sub    $0x7,%rax
ja     116a <rsock_shutdown_how_to_int+0x6a>
mov    -0x28(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <rsock_shutdown_how_to_int+0x8c>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <rsock_shutdown_how_to_int+0x8c>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <rsock_shutdown_how_to_int+0x8c>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <rsock_shutdown_how_to_int+0x8c>
cmpq   $0x0,-0x10(%rbp)
je     1180 <rsock_shutdown_how_to_int+0x80>
cmpq   $0x0,-0x20(%rbp)
jne    1185 <rsock_shutdown_how_to_int+0x85>
jmp    1185 <rsock_shutdown_how_to_int+0x85>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rsock_shutdown_how_to_int(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
ret i32 -1
}
void rop3_192_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T & S;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_192_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_192_0_0>:
and    %edx,%esi
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_192_0_0(i8* %0, i8 zeroext %1, i8 zeroext %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
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = and i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = load i8*, i8** %4
store i8 %14, i8* %15
ret void
}

LLVM IR (-O2):
define void @rop3_192_0_0(i8* nocapture writeonly %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
store i8 %4, i8* %0
ret void
}
void midi_uninit() {}


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

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

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

LLVM IR (-O2):
define void @midi_uninit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ parse_schema_aux(int, int /*<<< orphan*/ *);
void parse_schema(FILE *s) { parse_schema_aux(1, s); }


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

x86 assembly (clang, -O2):
<parse_schema>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <parse_schema_aux@plt>

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

LLVM IR (-O2):
define void @parse_schema(i32* %0) {
%2 = tail call i32 @parse_schema_aux(i32 1, i32* %0)
ret void
}
/* Variables and functions */
void write_edid_byte(unsigned char *edid, size_t byte,
                     const unsigned char value) {
  edid[0x7f] += edid[byte];
  edid[byte] = value;
  edid[0x7f] -= edid[byte];
}


x86 assembly (clang, -O0):
<write_edid_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x8(%rbp),%rax
movzbl 0x7f(%rax),%ecx
add    %edx,%ecx
mov    %cl,0x7f(%rax)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x8(%rbp),%rax
movzbl 0x7f(%rax),%ecx
sub    %edx,%ecx
mov    %cl,0x7f(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_edid_byte>:
mov    (%rdi,%rsi,1),%al
add    %al,0x7f(%rdi)
mov    %dl,(%rdi,%rsi,1)
sub    %dl,0x7f(%rdi)
ret

LLVM IR (-O0):
define void @write_edid_byte(i8* %0, i64 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 127
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = add nsw i32 %15, %11
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
%18 = load i8, i8* %6
%19 = load i8*, i8** %4
%20 = load i64, i64* %5
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8 %18, i8* %21
%22 = load i8*, i8** %4
%23 = load i64, i64* %5
%24 = getelementptr inbounds i8, i8* %22, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i64 127
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = sub nsw i32 %30, %26
%32 = trunc i32 %31 to i8
store i8 %32, i8* %28
ret void
}

LLVM IR (-O2):
define void @write_edid_byte(i8* nocapture %0, i64 %1, i8 zeroext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 127
%7 = load i8, i8* %6
%8 = add i8 %7, %5
store i8 %8, i8* %6
store i8 %2, i8* %4
%9 = load i8, i8* %6
%10 = sub i8 %9, %2
store i8 %10, i8* %6
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int rand();
int32_t getRandomBetween(int32_t lowBoundary, int32_t highBoundary) {
  return (rand() % (highBoundary - lowBoundary + 1) + lowBoundary);
}


x86 assembly (clang, -O0):
<getRandomBetween>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomBetween>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getRandomBetween(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @getRandomBetween(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int call_prom(char *, int, int, void *, char const *, void *, int);
int setprop(void *phandle, const char *name, void *buf, int buflen) {
  return call_prom("setprop", 4, 1, phandle, name, buf, buflen);
}


x86 assembly (clang, -O0):
<setprop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x1c(%rbp),%eax
lea    0xec3(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %eax,(%rsp)
call   1030 <call_prom@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setprop>:
push   %rax
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rax
mov    %ecx,(%rsp)
lea    0xedc(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <call_prom@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"setprop\00"
define i32 @setprop(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @call_prom(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i8* %9, i8* %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"setprop\00"
define i32 @setprop(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @call_prom(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i8* %0, i8* %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char const);
void print_uart0(const char *s) {
  while (*s != '\0') {
    uart_putc(*s);
    s++;
  }
}


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

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

LLVM IR (-O0):
define void @print_uart0(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 = load i8, i8* %9
%11 = call i32 @uart_putc(i8 signext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @print_uart0(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @uart_putc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int strlen(char *);
int foo(int nargs, int *args) {
  char *str = (char *)args[0];
  printf("foo called with \"%s\", length is %d, ", str, strlen(str));
  return strlen(str);
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rbx
movslq (%rsi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"foo called with \22%s\22, length is %d, \00"
define i32 @foo(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %5
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %13)
%15 = load i8*, i8** %5
%16 = call i32 @strlen(i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [37 x i8] c"foo called with \22%s\22, length is %d, \00"
define i32 @foo(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strlen(i8* %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = tail call i32 @strlen(i8* %5)
ret i32 %8
}