xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void close_alt_screen(void) {
  fputs("\x1B[?1049l", stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<close_alt_screen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_alt_screen>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[?1049l\00"
@stdout = global i32 0
define void @close_alt_screen() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[?1049l\00"
@stdout = global i32 0
define void @close_alt_screen() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t mp2vseqx_get_vbvbuffer(const uint8_t *p_mp2vseqx) {
  return p_mp2vseqx[8];
}


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

x86 assembly (clang, -O2):
<mp2vseqx_get_vbvbuffer>:
mov    0x20(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @mp2vseqx_get_vbvbuffer(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
double rangk12(double *, long, long, long);
double dmedian(double a[], long n) {
  double value = 0.0;
  long k1 = (n - 1) / 2;
  long k2 = n / 2;
  if (a && (n > 0)) {
    value = rangk12(a, n, k1, k2);
  }
  return (value);
}


x86 assembly (clang, -O0):
<dmedian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1180 <dmedian+0x70>
cmpq   $0x0,-0x10(%rbp)
jle    1180 <dmedian+0x70>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <rangk12@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmedian>:
test   %rdi,%rdi
je     112c <dmedian+0x1c>
test   %rsi,%rsi
jle    112c <dmedian+0x1c>
mov    %rsi,%rcx
shr    %rcx
lea    -0x1(%rsi),%rdx
shr    %rdx
jmp    1030 <rangk12@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dmedian(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca double
%6 = alloca i64
%7 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
store double 0.000000e+00, double* %5
%8 = load i64, i64* %4
%9 = sub nsw i64 %8, 1
%10 = sdiv i64 %9, 2
store i64 %10, i64* %6
%11 = load i64, i64* %4
%12 = sdiv i64 %11, 2
store i64 %12, i64* %7
%13 = load double*, double** %3
%14 = icmp ne double* %13, null
br i1 %14, label %15, label %24
15: ; preds = %2
%16 = load i64, i64* %4
%17 = icmp sgt i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = load double*, double** %3
%20 = load i64, i64* %4
%21 = load i64, i64* %6
%22 = load i64, i64* %7
%23 = call double @rangk12(double* %19, i64 %20, i64 %21, i64 %22)
store double %23, double* %5
br label %24
24: ; preds = %18, %15, %2
%25 = load double, double* %5
ret double %25
}

LLVM IR (-O2):
define double @dmedian(double* %0, i64 %1) {
%3 = icmp ne double* %0, null
%4 = icmp sgt i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = lshr i64 %1, 1
%8 = add nsw i64 %1, -1
%9 = lshr i64 %8, 1
%10 = tail call double @rangk12(double* %0, i64 %1, i64 %9, i64 %7)
br label %11
11: ; preds = %6, %2
%12 = phi double [ %10, %6 ], [ 0.000000e+00, %2 ]
ret double %12
}
cbuf4(f, n) { return (cbuf(f, n, 4)); }


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

x86 assembly (clang, -O2):
<cbuf4>:
mov    $0x4,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf4(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 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 4)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf4(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 4)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putMessage(unsigned char *, int);
void nrf_settx() {
  unsigned char cmd;
  cmd = 0x12;
  putMessage(&cmd, 1);
}


x86 assembly (clang, -O0):
<nrf_settx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x12,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <putMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_settx>:
push   %rax
movb   $0x12,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <putMessage@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @nrf_settx() {
%1 = alloca i8
store i8 18, i8* %1
%2 = call i32 @putMessage(i8* %1, i32 1)
ret void
}

LLVM IR (-O2):
define void @nrf_settx() {
%1 = alloca i8
store i8 18, i8* %1
%2 = call i32 @putMessage(i8* %1, i32 1)
ret void
}
void sensor_mgr_remove_threshold(struct device *dev,
                                 struct threshold_info *thresh_inp) {}


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

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

LLVM IR (-O0):
%struct.device = type opaque
%struct.threshold_info = type opaque
define void @sensor_mgr_remove_threshold(%struct.device* %0, %struct.threshold_info* %1) {
%3 = alloca %struct.device*
%4 = alloca %struct.threshold_info*
store %struct.device* %0, %struct.device** %3
store %struct.threshold_info* %1, %struct.threshold_info** %4
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
%struct.threshold_info = type opaque
define void @sensor_mgr_remove_threshold(%struct.device* nocapture %0, %struct.threshold_info* nocapture %1) {
ret void
}
void func(int *arg1) {
  printf("%d =>", arg1);
  printf("%d\n", *arg1);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xed8(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d =>\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @func(i32* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = load i32, i32* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
void cia_destroy() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct xqueue_item *);
int xqueue_item_destroy(struct xqueue_item *item) {
  free(item);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.xqueue_item = type { i32 }
define i32 @xqueue_item_destroy(%struct.xqueue_item* nocapture %0) {
%2 = tail call i32 @free(%struct.xqueue_item* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
void putstr(const char *s) {
  while (*s) {
    putchar(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <putstr+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @putstr(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 @putchar(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 open(char const *, int);
int xopen2(const char *pathname, int flags) {
  int fd = open(pathname, flags);
  if (fd < 0) {
    ;
  }
  return fd;
}


x86 assembly (clang, -O0):
<xopen2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    113d <xopen2+0x2d>
jmp    113d <xopen2+0x2d>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xopen2>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @xopen2(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_store_pd1(double *, int /*<<< orphan*/);
void test_mm_store_pd1(double *x, __m128d y) { _mm_store_pd1(x, y); }


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

x86 assembly (clang, -O2):
<test_mm_store_pd1>:
jmp    1030 <_mm_store_pd1@plt>

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

LLVM IR (-O2):
define void @test_mm_store_pd1(double* %0, i32 %1) {
%3 = tail call i32 @_mm_store_pd1(double* %0, i32 %1)
ret void
}
extern void NotifyRadioPacketSent() {}


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

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

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

LLVM IR (-O2):
define void @NotifyRadioPacketSent() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i * i > 9) {
    if (i < 0) {
      i = i - 1;
    } else {
      i = i + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    $0x9,%eax
jle    115f <main+0x4f>
cmpl   $0x0,-0x8(%rbp)
jge    1151 <main+0x41>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <main+0x4a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
const char *tst_to_str(int mode) {
  switch (mode) {
  case 0:
    return "Unsynchronized";
  case 1:
    return "Synchronized";
  case 2:
    return "Physical clock stopped";
  default:
    return "unknown";
  }
}


x86 assembly (clang, -O0):
<tst_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <tst_to_str+0x3c>
jmp    111a <tst_to_str+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <tst_to_str+0x4c>
jmp    112b <tst_to_str+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <tst_to_str+0x5c>
jmp    116c <tst_to_str+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <tst_to_str+0x77>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <tst_to_str+0x77>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <tst_to_str+0x77>
lea    0xec0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_to_str>:
cmp    $0x2,%edi
ja     1117 <tst_to_str+0x17>
movslq %edi,%rax
lea    0xf2d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf15(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Unsynchronized\00"
@.str.1 = [13 x i8] c"Synchronized\00"
@.str.2 = [23 x i8] c"Physical clock stopped\00"
@.str.3 = [8 x i8] c"unknown\00"
define i8* @tst_to_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [15 x i8] c"Unsynchronized\00"
@.str.1 = [13 x i8] c"Synchronized\00"
@.str.2 = [23 x i8] c"Physical clock stopped\00"
@.str.3 = [8 x i8] c"unknown\00"
@reltable.tst_to_str = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.tst_to_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.tst_to_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.tst_to_str to i64)) to i32)]
define i8* @tst_to_str(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.tst_to_str to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcomplex4array(void *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 4));
}


x86 assembly (clang, -O0):
<popcomplex4array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcomplex4array>:
shl    $0x2,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popcomplex4array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 4
%8 = call i32 @popNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @popcomplex4array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_ull(int, size_t);
int strlen(char const *);
int /*<<< orphan*/ writen(int, char const *, size_t);
void send_str(int chan, const char *s) {
  size_t len = strlen(s) + 1;
  send_ull(chan, len);
  writen(chan, s, len);
}


x86 assembly (clang, -O0):
<send_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <send_ull@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <writen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <send_ull@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <writen@plt>

LLVM IR (-O0):
define void @send_str(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %5
%10 = load i32, i32* %3
%11 = load i64, i64* %5
%12 = call i32 @send_ull(i32 %10, i64 %11)
%13 = load i32, i32* %3
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = call i32 @writen(i32 %13, i8* %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @send_str(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = tail call i32 @send_ull(i32 %0, i64 %5)
%7 = tail call i32 @writen(i32 %0, i8* %1, i64 %5)
ret void
}
char *langRomTypeKanji() { return "Kanji"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Kanji\00"
define i8* @langRomTypeKanji() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ getCacheHome(char **);
int /*<<< orphan*/ strmcat(char **, char *);
void getCacheApp(char **path, char *app_name) {
  getCacheHome(path);
  if (*path) {
    strmcat(path, "/");
    strmcat(path, app_name);
  }
}


x86 assembly (clang, -O0):
<getCacheApp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getCacheHome@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1164 <getCacheApp+0x44>
mov    -0x8(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <strmcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strmcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCacheApp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <getCacheHome@plt>
cmpq   $0x0,(%rbx)
je     1156 <getCacheApp+0x36>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strmcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strmcat@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @getCacheApp(i8** %0, i8* %1) {
%3 = tail call i32 @getCacheHome(i8** %0)
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @strmcat(i8** %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @strmcat(i8** %0, i8* %1)
br label %9
9: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CPROVER_assume(int);
int main() {
  unsigned x;
  int i;
  int a[100];
  if (x < 100 && a[x]) {
    i++;
  }
  __CPROVER_assume(i < 100);
  if (i >= 0 && a[i]) {
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x8(%rbp)
jae    1146 <main+0x36>
mov    -0x8(%rbp),%eax
cmpl   $0x0,-0x1a0(%rbp,%rax,4)
je     1146 <main+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
cmpl   $0x0,-0xc(%rbp)
jl     117c <main+0x6c>
movslq -0xc(%rbp),%rax
cmpl   $0x0,-0x1a0(%rbp,%rax,4)
je     117c <main+0x6c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i32]
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 100
br i1 %6, label %7, label %16
7: ; preds = %0
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %7, %0
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 100
%19 = zext i1 %18 to i32
%20 = call i32 @__CPROVER_assume(i32 %19)
%21 = load i32, i32* %3
%22 = icmp sge i32 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %16
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %32
32: ; preds = %29, %23, %16
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__CPROVER_assume(i32 0)
ret i32 0
}
char key_1() { return (((*(volatile unsigned long *)0x7F008834) & (1 << 0))); }


x86 assembly (clang, -O0):
<key_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008834,%eax
mov    (%rax),%rax
and    $0x1,%rax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_1>:
mov    0x7f008834,%rax
7f
and    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @key_1() {
%1 = load volatile i64, i64* inttoptr (i64 2130741300 to i64*)
%2 = and i64 %1, 1
%3 = trunc i64 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @key_1() {
%1 = load volatile i64, i64* inttoptr (i64 2130741300 to i64*)
%2 = trunc i64 %1 to i8
%3 = and i8 %2, 1
ret i8 %3
}
const char *dlopen_simgen_longdesc() {
  return "Dynamically open a shared library plugin\n"
         "Seed: <dynamic library filename[,seed for dlopen plugin]>";
}


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

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

LLVM IR (-O0):
@.str = [99 x i8] c"Dynamically open a shared library plugin\0ASeed: <dynamic library filename[,seed for dlopen plugin]>\00"
define i8* @dlopen_simgen_longdesc() {
ret i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [99 x i8] c"Dynamically open a shared library plugin\0ASeed: <dynamic library filename[,seed for dlopen plugin]>\00"
define i8* @dlopen_simgen_longdesc() {
ret i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ bswap64(scalar_t__);
void minipack_pack_uint64(void *ptr, uint64_t value, size_t *sz) {
  *sz = 9;
  *((uint8_t *)ptr) = 0xCF;
  *((uint64_t *)(ptr + 1)) = (uint64_t)bswap64(value);
}


x86 assembly (clang, -O0):
<minipack_pack_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x9,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xcf,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <bswap64@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x1(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_uint64>:
push   %rbx
mov    %rdi,%rbx
movq   $0x9,(%rdx)
movl   $0xcf,(%rdi)
mov    %rsi,%rdi
call   1030 <bswap64@plt>
mov    %rax,0x1(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @minipack_pack_uint64(i8* %0, i64 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 9, i64* %7
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32 207, i32* %9
%10 = load i64, i64* %5
%11 = call i64 @bswap64(i64 %10)
%12 = load i8*, i8** %4
%13 = getelementptr i8, i8* %12, i64 1
%14 = bitcast i8* %13 to i64*
store i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @minipack_pack_uint64(i8* nocapture writeonly %0, i64 %1, i64* nocapture writeonly %2) {
store i64 9, i64* %2
%4 = bitcast i8* %0 to i32*
store i32 207, i32* %4
%5 = tail call i64 @bswap64(i64 %1)
%6 = getelementptr i8, i8* %0, i64 1
%7 = bitcast i8* %6 to i64*
store i64 %5, i64* %7
ret void
}
void g_type_check_instance_is_a() {}


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

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

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

LLVM IR (-O2):
define void @g_type_check_instance_is_a() {
ret void
}
void init_rlimit(void) {}


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

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

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

LLVM IR (-O2):
define void @init_rlimit() {
ret void
}
int IsUpper(char C) { return (C >= 'A' && C <= 'Z'); }


x86 assembly (clang, -O0):
<IsUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <IsUpper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsUpper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsUpper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsUpper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
double manage_exp(const char *str) {}


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

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

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

LLVM IR (-O2):
define double @manage_exp(i8* nocapture readnone %0) {
ret double undef
}
void QQ() {}


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

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

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

LLVM IR (-O2):
define void @QQ() {
ret void
}
unsigned getval_159() { return 3225995913U; }


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

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

LLVM IR (-O0):
define i32 @getval_159() {
ret i32 -1068971383
}

LLVM IR (-O2):
define i32 @getval_159() {
ret i32 -1068971383
}
int toupper(int c) {
  int ch = c;
  if ((unsigned int)(ch - 'a') < 26u)
    ch += 'A' - 'a';
  return ch;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
cmp    $0x1a,%eax
jae    1125 <toupper+0x25>
mov    -0x8(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add nsw i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UINT16_MAX;
uint32_t clk_val_to_reg_val(uint32_t val) {
  return (val & UINT16_MAX) | ((val & UINT16_MAX) << 16);
}


x86 assembly (clang, -O0):
<clk_val_to_reg_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecf(%rip),%rcx
and    (%rcx),%eax
mov    -0x4(%rbp),%ecx
mov    0x2ec3(%rip),%rdx
and    (%rdx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_val_to_reg_val>:
mov    0x2ed9(%rip),%rax
and    (%rax),%edi
mov    %edi,%eax
shl    $0x10,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
@UINT16_MAX = global i32 0
define i32 @clk_val_to_reg_val(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @UINT16_MAX
%5 = and i32 %3, %4
%6 = load i32, i32* %2
%7 = load i32, i32* @UINT16_MAX
%8 = and i32 %6, %7
%9 = shl i32 %8, 16
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
@UINT16_MAX = global i32 0
define i32 @clk_val_to_reg_val(i32 %0) {
%2 = load i32, i32* @UINT16_MAX
%3 = and i32 %2, %0
%4 = shl i32 %3, 16
%5 = or i32 %4, %3
ret i32 %5
}
int Q_align(int value, int align) {
  int mod = value % align;
  return mod ? value + align - mod : value;
}


x86 assembly (clang, -O0):
<Q_align>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112f <Q_align+0x2f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <Q_align+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_align>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rsi,%rdi,1),%eax
sub    %edx,%eax
test   %edx,%edx
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Q_align(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = add nsw i32 %1, %0
%6 = sub i32 %5, %3
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, int);
int stat(char *, struct stat *);
int main() {
  struct stat s;
  int ret = stat("in.c", &s);
  assert(ret == 0);
  printf("%d\n", s.st_mode);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <stat@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <stat@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    (%rsp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [5 x i8] c"in.c\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [5 x i8] c"in.c\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int p_wm_set() { return -142; }


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

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

LLVM IR (-O0):
define i32 @p_wm_set() {
ret i32 -142
}

LLVM IR (-O2):
define i32 @p_wm_set() {
ret i32 -142
}
/* Variables and functions */
int function1();
int main() { return function1(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @function1()
ret i32 %1
}
void gdp_io_thread_assure_wsa_once() {}


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

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

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

LLVM IR (-O2):
define void @gdp_io_thread_assure_wsa_once() {
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
char *calloc(scalar_t__, int);
int /*<<< orphan*/ flu64_do_decode(char *, scalar_t__, char *);
scalar_t__ strlen(char *);
char *flu64_decode(char *in, ssize_t l) {
  if ((int)l == -1)
    l = strlen(in);
  char *out = calloc(l, sizeof(char));
  flu64_do_decode(in, l, out);
  return out;
}


x86 assembly (clang, -O0):
<flu64_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    $0xffffffff,%eax
jne    115a <flu64_decode+0x2a>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <flu64_do_decode@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu64_decode>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
cmp    $0xffffffff,%ebx
jne    114b <flu64_decode+0x1b>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <flu64_do_decode@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @flu64_decode(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 i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %4
br label %12
12: ; preds = %9, %2
%13 = load i64, i64* %4
%14 = call i8* @calloc(i64 %13, i32 1)
store i8* %14, i8** %5
%15 = load i8*, i8** %3
%16 = load i64, i64* %4
%17 = load i8*, i8** %5
%18 = call i32 @flu64_do_decode(i8* %15, i64 %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @flu64_decode(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %7
7: ; preds = %5, %2
%8 = phi i64 [ %6, %5 ], [ %1, %2 ]
%9 = tail call i8* @calloc(i64 %8, i32 1)
%10 = tail call i32 @flu64_do_decode(i8* %0, i64 %8, i8* %9)
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int mbtowc(int /*<<< orphan*/ *, char const *, size_t);
int mblen(const char *src, size_t max) {
  wchar_t temp;
  return mbtowc(&temp, src, max);
}


x86 assembly (clang, -O0):
<mblen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rdi
call   1030 <mbtowc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mblen>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
call   1030 <mbtowc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mblen(i8* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @mbtowc(i32* %3, i8* %0, i64 %1)
ret i32 %5
}
/* Variables and functions */
char *make_scalar(char *, char *);
char *sum(char *field) { return make_scalar("SUM", field); }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <make_scalar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <make_scalar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"SUM\00"
define i8* @sum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @make_scalar(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"SUM\00"
define i8* @sum(i8* %0) {
%2 = tail call i8* @make_scalar(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
unsigned long usecs(struct timeval *start, struct timeval *end) {
  return (end->tv_sec - start->tv_sec) * 1000000 +
         (end->tv_usec - start->tv_usec);
}


x86 assembly (clang, -O0):
<usecs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
cltq
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    -0x8(%rbp),%rdx
sub    0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usecs>:
movslq (%rsi),%rax
movslq (%rdi),%rcx
sub    %rcx,%rax
imul   $0xf4240,%rax,%rcx
mov    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @usecs(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000
%13 = sext i32 %12 to i64
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub i64 %16, %19
%21 = add i64 %13, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @usecs(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add i64 %14, %9
ret i64 %15
}
void rop3_128_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk1 = *D & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_128_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,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%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_128_0_0>:
and    %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_128_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_128_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}