xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ big_delay();
int /*<<< orphan*/ delay();
int /*<<< orphan*/ led_off();
int /*<<< orphan*/ led_on();
void my_blink(void) {
  int i;
  for (;;) {
    for (i = 0; i < 2; i++) {
      led_on();
      delay();
      led_off();
      delay();
    }
    big_delay();
  }
}


x86 assembly (clang, -O0):
<my_blink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1183 <my_blink+0x43>
mov    $0x0,%al
call   1060 <led_on@plt>
mov    $0x0,%al
call   1050 <delay@plt>
mov    $0x0,%al
call   1030 <led_off@plt>
mov    $0x0,%al
call   1050 <delay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <my_blink+0xf>
mov    $0x0,%al
call   1040 <big_delay@plt>
jmp    1148 <my_blink+0x8>

x86 assembly (clang, -O2):
<my_blink>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <led_on@plt>
xor    %eax,%eax
call   1050 <delay@plt>
xor    %eax,%eax
call   1030 <led_off@plt>
xor    %eax,%eax
call   1050 <delay@plt>
xor    %eax,%eax
call   1060 <led_on@plt>
xor    %eax,%eax
call   1050 <delay@plt>
xor    %eax,%eax
call   1030 <led_off@plt>
xor    %eax,%eax
call   1050 <delay@plt>
xor    %eax,%eax
call   1040 <big_delay@plt>
jmp    1150 <my_blink+0x10>

LLVM IR (-O0):
define void @my_blink() {
%1 = alloca i32
br label %2
2: ; preds = %14, %0
store i32 0, i32* %1
br label %3
3: ; preds = %11, %2
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = call i32 (...) @led_on()
%8 = call i32 (...) @delay()
%9 = call i32 (...) @led_off()
%10 = call i32 (...) @delay()
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
%15 = call i32 (...) @big_delay()
br label %2
}

LLVM IR (-O2):
define void @my_blink() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @led_on()
%3 = tail call i32 (...) @delay()
%4 = tail call i32 (...) @led_off()
%5 = tail call i32 (...) @delay()
%6 = tail call i32 (...) @led_on()
%7 = tail call i32 (...) @delay()
%8 = tail call i32 (...) @led_off()
%9 = tail call i32 (...) @delay()
%10 = tail call i32 (...) @big_delay()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int a, b, i;
  a = 5000000;
  b = 41832;
  printf("%d %d\n", a, b);
  for (i = 1; i <= a; i++) {
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4c4b40,-0x8(%rbp)
movl   $0xa368,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1173 <main+0x63>
mov    -0x10(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <main+0x38>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
mov    $0x4c4b40,%esi
mov    $0xa368,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebx
lea    0xecb(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x4c4b41,%ebx
jne    1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5000000, i32 41832)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 5000001
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *rfcdown_realloc(void *ptr, size_t size) {
  void *ret = realloc(ptr, size);
  if (!ret) {
    fprintf(stderr, "Allocation failed.\n");
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<rfcdown_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1178 <rfcdown_realloc+0x48>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfcdown_realloc>:
push   %rax
call   1050 <realloc@plt>
test   %rax,%rax
je     113d <rfcdown_realloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Allocation failed.\0A\00"
define i8* @rfcdown_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Allocation failed.\0A\00"
define noalias i8* @rfcdown_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort_clients();
void sig_int(int sig) { abort_clients(); }


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

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

LLVM IR (-O0):
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort_clients()
ret void
}

LLVM IR (-O2):
define void @sig_int(i32 %0) {
%2 = tail call i32 (...) @abort_clients()
ret void
}
void imx53_pm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @imx53_pm_init() {
ret void
}
/* Type definitions */
struct ll {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ll *);
int /*<<< orphan*/ llclean(struct ll *);
scalar_t__ lllen(struct ll *);
void lldestroy(struct ll *p) {
  if (!p)
    return;
  if (lllen(p))
    llclean(p);
  free(p);
}


x86 assembly (clang, -O0):
<lldestroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <lldestroy+0x1c>
jmp    1171 <lldestroy+0x41>
mov    -0x8(%rbp),%rdi
call   1050 <lllen@plt>
cmp    $0x0,%rax
je     1168 <lldestroy+0x38>
mov    -0x8(%rbp),%rdi
call   1040 <llclean@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lldestroy>:
test   %rdi,%rdi
je     1154 <lldestroy+0x24>
push   %rbx
mov    %rdi,%rbx
call   1050 <lllen@plt>
test   %rax,%rax
je     114b <lldestroy+0x1b>
mov    %rbx,%rdi
call   1040 <llclean@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.ll = type { i32 }
define void @lldestroy(%struct.ll* %0) {
%2 = alloca %struct.ll*
store %struct.ll* %0, %struct.ll** %2
%3 = load %struct.ll*, %struct.ll** %2
%4 = icmp ne %struct.ll* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %16
6: ; preds = %1
%7 = load %struct.ll*, %struct.ll** %2
%8 = call i64 @lllen(%struct.ll* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load %struct.ll*, %struct.ll** %2
%12 = call i32 @llclean(%struct.ll* %11)
br label %13
13: ; preds = %10, %6
%14 = load %struct.ll*, %struct.ll** %2
%15 = call i32 @free(%struct.ll* %14)
br label %16
16: ; preds = %13, %5
ret void
}

LLVM IR (-O2):
%struct.ll = type { i32 }
define void @lldestroy(%struct.ll* %0) {
%2 = icmp eq %struct.ll* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @lllen(%struct.ll* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @llclean(%struct.ll* %0)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @free(%struct.ll* %0)
br label %10
10: ; preds = %1, %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ mp2vstart_init(int /*<<< orphan*/ *, int);
void mp2vend_init(uint8_t *p_mp2vend) { mp2vstart_init(p_mp2vend, 0xb7); }


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

x86 assembly (clang, -O2):
<mp2vend_init>:
mov    $0xb7,%esi
jmp    1030 <mp2vstart_init@plt>

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

LLVM IR (-O2):
define void @mp2vend_init(i32* %0) {
%2 = tail call i32 @mp2vstart_init(i32* %0, i32 183)
ret void
}
/* Variables and functions */
double ceil(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double a;
  printf("Input a real number:");
  scanf("%lf", &a);
  printf("\tInteger:%f\n", ceil(a));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1030 <ceil@plt>
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c"\09Integer:%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @llvm.ceil.f64(double %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c"\09Integer:%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @llvm.ceil.f64(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello from clean-build!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"hello from clean-build!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"hello from clean-build!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double M_PI;
double degrees2radians(double degrees) { return degrees * M_PI / 180; }


x86 assembly (clang, -O0):
<degrees2radians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degrees2radians>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @degrees2radians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @degrees2radians(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
int f1() {
  unsigned long x, y = 1;
  x = ((y * 8192) - 216) % 16;
  return x;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0xd,%rax
sub    $0xd8,%rax
and    $0xf,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f1() {
%1 = alloca i64
%2 = alloca i64
store i64 1, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 8192
%5 = sub i64 %4, 216
%6 = urem i64 %5, 16
store i64 %6, i64* %1
%7 = load i64, i64* %1
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f1() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("\n*** Unit tests disabled in this build\n*** Use ./configure "
       "--enable-check to enable them\n");
  return 77;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4d,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [90 x i8] c"\0A*** Unit tests disabled in this build\0A*** Use ./configure --enable-check to enable them\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
ret i32 77
}

LLVM IR (-O2):
@.str = [90 x i8] c"\0A*** Unit tests disabled in this build\0A*** Use ./configure --enable-check to enable them\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
ret i32 77
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t sg_get_unaligned_be32(const void *p) {
  return ((const uint8_t *)p)[0] << 24 | ((const uint8_t *)p)[1] << 16 |
         ((const uint8_t *)p)[2] << 8 | ((const uint8_t *)p)[3];
}


x86 assembly (clang, -O0):
<sg_get_unaligned_be32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_get_unaligned_be32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sg_get_unaligned_be32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 8
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 12
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
scalar_t__ malloc(int);
char *gu_parsenum(char *numstr) {
  char *number;
  number = (char *)malloc(10 * sizeof(char));
  number[0] = '\0';
  return number;
}


x86 assembly (clang, -O0):
<gu_parsenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu_parsenum>:
push   %rax
mov    $0xa,%edi
call   1030 <malloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @gu_parsenum(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 0, i8* %7
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @gu_parsenum(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8 0, i8* %3
ret i8* %3
}
int test_imm_D6int16_reg(short val) {
  return ((val) & (0xD6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D6int16_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, 214
%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_D6int16_reg(i16 signext %0) {
%2 = and i16 %0, 214
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ new_address();
int /*<<< orphan*/ new_ip();
int /*<<< orphan*/ old_address();
int /*<<< orphan*/ old_ip();
int main() {
  old_ip();
  new_ip();
  old_address();
  new_address();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <old_ip@plt>
mov    $0x0,%al
call   1060 <new_ip@plt>
mov    $0x0,%al
call   1040 <old_address@plt>
mov    $0x0,%al
call   1050 <new_address@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <old_ip@plt>
xor    %eax,%eax
call   1060 <new_ip@plt>
xor    %eax,%eax
call   1040 <old_address@plt>
xor    %eax,%eax
call   1050 <new_address@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @old_ip()
%3 = call i32 (...) @new_ip()
%4 = call i32 (...) @old_address()
%5 = call i32 (...) @new_address()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @old_ip()
%2 = tail call i32 (...) @new_ip()
%3 = tail call i32 (...) @old_address()
%4 = tail call i32 (...) @new_address()
%5 = tail call i32 @exit(i32 0)
unreachable
}
void SystraceBegin(const char *name) { (void)name; }


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

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

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

LLVM IR (-O2):
define void @SystraceBegin(i8* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned char VIM_HIF_GetReg8(int);
unsigned char VIM_DISP_GetDecodeSpecial(void) {
  unsigned char byMode;
  byMode = VIM_HIF_GetReg8((0x2800 + 0x0e9));
  return (byMode >> 5) & 1;
}


x86 assembly (clang, -O0):
<VIM_DISP_GetDecodeSpecial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x28e9,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x5,%eax
and    $0x1,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_DISP_GetDecodeSpecial>:
push   %rax
mov    $0x28e9,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shr    $0x5,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @VIM_DISP_GetDecodeSpecial() {
%1 = alloca i8
%2 = call zeroext i8 @VIM_HIF_GetReg8(i32 10473)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 5
%6 = and i32 %5, 1
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @VIM_DISP_GetDecodeSpecial() {
%1 = tail call zeroext i8 @VIM_HIF_GetReg8(i32 10473)
%2 = lshr i8 %1, 5
%3 = and i8 %2, 1
ret i8 %3
}
/* Variables and functions */
bool isPowerOfTwo2(int n) {
  if (n < 1)
    return false;
  int count = 0;
  while (n) {
    if (n & 1)
      count++;
    n >>= 1;
  }
  return count > 1 ? false : true;
}


x86 assembly (clang, -O0):
<isPowerOfTwo2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <isPowerOfTwo2+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1167 <isPowerOfTwo2+0x67>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1154 <isPowerOfTwo2+0x54>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1146 <isPowerOfTwo2+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <isPowerOfTwo2+0x24>
mov    -0xc(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo2>:
test   %edi,%edi
jle    1129 <isPowerOfTwo2+0x29>
xor    %ecx,%ecx
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%ecx
sar    %eax
cmp    $0x1,%edi
mov    %eax,%edi
ja     1110 <isPowerOfTwo2+0x10>
xor    %eax,%eax
cmp    $0x2,%ecx
setb   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfTwo2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %27
8: ; preds = %1
store i32 0, i32* %4
br label %9
9: ; preds = %19, %8
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i32, i32* %3
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %12
%20 = load i32, i32* %3
%21 = ashr i32 %20, 1
store i32 %21, i32* %3
br label %9
22: ; preds = %9
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 1
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 0, i32 1
store i32 %26, i32* %2
br label %27
27: ; preds = %22, %7
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @isPowerOfTwo2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = ashr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = icmp ult i32 %7, 2
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %1, %10
%14 = phi i32 [ %12, %10 ], [ 0, %1 ]
ret i32 %14
}
int f1(int dummy) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
ret i32 1
}
void foo_1_2_2_2_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_1_2_1_1_1() {
ret void
}
int test_21(int x) { return x >= 0 ? 0xFFFFFFFF : 0; }


x86 assembly (clang, -O0):
<test_21>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_21>:
mov    %edi,%eax
sar    $0x1f,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @test_21(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 -1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_21(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ convert_bits();
int /*<<< orphan*/ rftx();
int /*<<< orphan*/ waitForTx();
void doTx() {
  waitForTx();
  convert_bits();
  rftx();
}


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

x86 assembly (clang, -O2):
<doTx>:
push   %rax
xor    %eax,%eax
call   1030 <waitForTx@plt>
xor    %eax,%eax
call   1050 <convert_bits@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <rftx@plt>

LLVM IR (-O0):
define void @doTx() {
%1 = call i32 (...) @waitForTx()
%2 = call i32 (...) @convert_bits()
%3 = call i32 (...) @rftx()
ret void
}

LLVM IR (-O2):
define void @doTx() {
%1 = tail call i32 (...) @waitForTx()
%2 = tail call i32 (...) @convert_bits()
%3 = tail call i32 (...) @rftx()
ret void
}
float radians2degree_double(const double *radians) {
  return *radians * 180 / 3.14159265;
}


x86 assembly (clang, -O0):
<radians2degree_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xef4(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radians2degree_double>:
movsd  (%rdi),%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @radians2degree_double(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = fmul double %4, 1.800000e+02
%6 = fdiv double %5, 0x400921FB53C8D4F1
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @radians2degree_double(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, 1.800000e+02
%4 = fdiv double %3, 0x400921FB53C8D4F1
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ delete ();
int /*<<< orphan*/ is_empty();
void destroy_queue(void) {
  while (!is_empty())
    delete ();
}


x86 assembly (clang, -O0):
<destroy_queue>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <destroy_queue+0x9>
mov    $0x0,%al
call   1030 <is_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <destroy_queue+0x25>
jmp    1151 <destroy_queue+0x31>
mov    $0x0,%al
call   1040 <delete@plt>
jmp    1129 <destroy_queue+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_queue>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <is_empty@plt>
test   %eax,%eax
jne    1144 <destroy_queue+0x24>
xor    %eax,%eax
call   1040 <delete@plt>
jmp    1130 <destroy_queue+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @destroy_queue() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @is_empty()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @delete()
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @destroy_queue() {
%1 = tail call i32 (...) @is_empty()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @delete()
%5 = tail call i32 (...) @is_empty()
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
ret void
}
int sys$dassgn(unsigned short int chan) {
  return ({
    unsigned long resultvar;
    register long int _a1 asm("rdi") = (long)(chan);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(31), "r"(_a1)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$dassgn>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1f,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$dassgn>:
mov    %edi,%edi
mov    $0x1f,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$dassgn"(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i16 %0, i16* %2
%6 = load i16, i16* %2
%7 = zext i16 %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 31, i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @"sys$dassgn"(i16 zeroext %0) {
%2 = zext i16 %0 to i64
%3 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 31, i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ md5(unsigned char *, int, unsigned char *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, unsigned char *, int);
int64_t dbase_kid(char *str, int len) {
  int64_t kid = 0;
  unsigned char digest[16];
  md5((unsigned char *)str, len, digest);
  memcpy(&kid, digest, sizeof(int64_t));
  return kid;
}


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

x86 assembly (clang, -O2):
<dbase_kid>:
push   %rbx
sub    $0x20,%rsp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdx
call   1040 <md5@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dbase_kid(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [16 x i8]
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%7 = call i32 @md5(i8* %0, i32 %1, i8* %6)
%8 = call i32 @memcpy(i32* %3, i8* %6, i32 4)
%9 = load i32, i32* %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: bootlogd [-v] [-r] [-d] [-p pidfile] [-l logfile]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: bootlogd [-v] [-r] [-d] [-p pidfile] [-l logfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: bootlogd [-v] [-r] [-d] [-p pidfile] [-l logfile]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned int bar();
void foo20x1f(void) {
  unsigned int a = bar();
  if (a > 0x1f)
    bar();
}


x86 assembly (clang, -O0):
<foo20x1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1f,-0x4(%rbp)
jbe    1133 <foo20x1f+0x23>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo20x1f>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
cmp    $0x20,%eax
jb     1125 <foo20x1f+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @foo20x1f() {
%1 = alloca i32
%2 = call i32 (...) @bar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ugt i32 %3, 31
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @bar()
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @foo20x1f() {
%1 = tail call i32 (...) @bar()
%2 = icmp ugt i32 %1, 31
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int Func1(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int x = 0;
  int y = 0;
  y = x;
  y = Func1(1);
  printf("y=%d\n", y);
  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)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x1,%edi
call   1040 <Func1@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <Func1@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"y=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @Func1(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ num;

/* Variables and functions */
int /*<<< orphan*/ SwapWord(char *, int);
unsigned int big2littleui(unsigned int num) {
  SwapWord((char *)&num, sizeof(num));
  return num;
}


x86 assembly (clang, -O0):
<big2littleui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <SwapWord@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big2littleui>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <SwapWord@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @big2littleui(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @big2littleui(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *getTime() {
  time_t current_time = time(NULL);
  return ctime(&current_time);
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @getTime() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i8* @ctime(i32* %1)
ret i8* %3
}

LLVM IR (-O2):
define i8* @getTime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
ret i8* %4
}
/* Variables and functions */
int detectPresence(char *);
int whiptailPresentOnly() {
  static int lWhiptailPresent = -1;
  if (lWhiptailPresent < 0) {
    lWhiptailPresent = detectPresence("whiptail");
  }
  return lWhiptailPresent;
}


x86 assembly (clang, -O0):
<whiptailPresentOnly>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
jge    1133 <whiptailPresentOnly+0x23>
lea    0xed8(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef5(%rip)
mov    0x2eef(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<whiptailPresentOnly>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
js     111d <whiptailPresentOnly+0xd>
pop    %rcx
ret
lea    0xedc(%rip),%rdi
call   1030 <detectPresence@plt>
mov    %eax,0x2ef9(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@whiptailPresentOnly.lWhiptailPresent = internal global i32 -1
@.str = [9 x i8] c"whiptail\00"
define i32 @whiptailPresentOnly() {
%1 = load i32, i32* @whiptailPresentOnly.lWhiptailPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @whiptailPresentOnly.lWhiptailPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @whiptailPresentOnly.lWhiptailPresent
ret i32 %6
}

LLVM IR (-O2):
@whiptailPresentOnly.lWhiptailPresent = internal unnamed_addr global i32 -1
@.str = [9 x i8] c"whiptail\00"
define i32 @whiptailPresentOnly() {
%1 = load i32, i32* @whiptailPresentOnly.lWhiptailPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @whiptailPresentOnly.lWhiptailPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void my_cleanup_module(void) { printk("bye\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"bye\0A\00"
define void @my_cleanup_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"bye\0A\00"
define void @my_cleanup_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_i2c_busses(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr, "Syntax: i2cset [-y] I2CBUS CHIP-ADDRESS DATA-ADDRESS "
                  "VALUE [MODE] [MASK]\n"
                  "        i2cset -V\n"
                  "  MODE is 'b[yte]' or 'w[ord]' (default b)\n"
                  "  Append 'p' to MODE for PEC checking\n"
                  "  I2CBUS is an integer\n");
  print_i2c_busses(0);
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <print_i2c_busses@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <print_i2c_busses@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [196 x i8] c"Syntax: i2cset [-y] I2CBUS CHIP-ADDRESS DATA-ADDRESS VALUE [MODE] [MASK]\0A i2cset -V\0A MODE is 'b[yte]' or 'w[ord]' (default b)\0A Append 'p' to MODE for PEC checking\0A I2CBUS is an integer\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @print_i2c_busses(i32 0)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [196 x i8] c"Syntax: i2cset [-y] I2CBUS CHIP-ADDRESS DATA-ADDRESS VALUE [MODE] [MASK]\0A i2cset -V\0A MODE is 'b[yte]' or 'w[ord]' (default b)\0A Append 'p' to MODE for PEC checking\0A I2CBUS is an integer\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_i2c_busses(i32 0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ assert(int);
int msgctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
void mg_release(int qid) {
  int res;
  res = msgctl(qid, IPC_RMID, NULL);
  assert(res > -1);
}


x86 assembly (clang, -O0):
<mg_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <msgctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_release>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <msgctl@plt>
not    %eax
shr    $0x1f,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define void @mg_release(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @IPC_RMID
%6 = call i32 @msgctl(i32 %4, i32 %5, i32* null)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, -1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define void @mg_release(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @msgctl(i32 %0, i32 %2, i32* null)
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
%6 = tail call i32 @assert(i32 %5)
ret void
}