xunge/DecIR huggingface dataset:
unsigned int w_int_hash(const void *p) {
  int i = (int)(long)p;
  return (unsigned int)i;
}


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

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

LLVM IR (-O0):
define i32 @w_int_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @w_int_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
int PyThread_create_key(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @PyThread_create_key() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @PyThread_create_key() {
ret i32 -1
}
void avformat_alloc_output_context2() {}


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

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

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

LLVM IR (-O2):
define void @avformat_alloc_output_context2() {
ret void
}
/* Variables and functions */
int atoi(char *);
int config_get_str(char const *, char const *, char const *, char *, int);
int config_get_int(const char *filename, const char *section, const char *name,
                   int *val) {
  char buf[64];
  int r;
  if ((r = config_get_str(filename, section, name, buf, 64)) != 0)
    return r;
  *val = atoi(buf);
  return 0;
}


x86 assembly (clang, -O0):
<config_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x70(%rbp),%rcx
mov    $0x40,%r8d
call   1030 <config_get_str@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
je     116d <config_get_int+0x4d>
mov    -0x74(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <config_get_int+0x65>
lea    -0x70(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_get_int>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
mov    %rcx,%rbx
mov    %rsp,%rcx
mov    $0x40,%r8d
call   1030 <config_get_str@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1147 <config_get_int+0x27>
mov    %rsp,%rdi
call   1040 <atoi@plt>
mov    %eax,(%rbx)
mov    %ebp,%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @config_get_int(i8* %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca [64 x i8]
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %10, i64 0, i64 0
%16 = call i32 @config_get_str(i8* %12, i8* %13, i8* %14, i8* %15, i32 64)
store i32 %16, i32* %11
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %4
%19 = load i32, i32* %11
store i32 %19, i32* %5
br label %24
20: ; preds = %4
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %10, i64 0, i64 0
%22 = call i32 @atoi(i8* %21)
%23 = load i32*, i32** %9
store i32 %22, i32* %23
store i32 0, i32* %5
br label %24
24: ; preds = %20, %18
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @config_get_int(i8* %0, i8* %1, i8* %2, i32* nocapture writeonly %3) {
%5 = alloca [64 x i8]
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = call i32 @config_get_str(i8* %0, i8* %1, i8* %2, i8* %6, i32 64)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = call i32 @atoi(i8* %6)
store i32 %10, i32* %3
br label %11
11: ; preds = %4, %9
ret i32 %7
}
void free_double(double _val) { return; }


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

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

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

LLVM IR (-O2):
define void @free_double(double %0) {
ret void
}
float extract(float a) {
  int b = a;
  return a - b;
}


x86 assembly (clang, -O0):
<extract>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @extract(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load float, float* %2
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
%9 = fsub float %6, %8
ret float %9
}

LLVM IR (-O2):
define float @extract(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fsub float %0, %3
ret float %4
}
/* Type definitions */
struct lh_table {
  int dummy;
};
struct lh_entry {
  int dummy;
};

/* Variables and functions */
int lh_table_delete_entry(struct lh_table *, struct lh_entry *);
struct lh_entry *lh_table_lookup_entry(struct lh_table *, void *);
int lh_table_delete(struct lh_table *t, void *k) {
  struct lh_entry *e = lh_table_lookup_entry(t, k);
  if (!e)
    return -1;
  return lh_table_delete_entry(t, e);
}


x86 assembly (clang, -O0):
<lh_table_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <lh_table_lookup_entry@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1158 <lh_table_delete+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <lh_table_delete+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <lh_table_delete_entry@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lh_table_delete>:
push   %rbx
mov    %rdi,%rbx
call   1030 <lh_table_lookup_entry@plt>
test   %rax,%rax
je     113a <lh_table_delete+0x1a>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <lh_table_delete_entry@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.lh_table = type { i32 }
%struct.lh_entry = type { i32 }
define i32 @lh_table_delete(%struct.lh_table* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.lh_table*
%5 = alloca i8*
%6 = alloca %struct.lh_entry*
store %struct.lh_table* %0, %struct.lh_table** %4
store i8* %1, i8** %5
%7 = load %struct.lh_table*, %struct.lh_table** %4
%8 = load i8*, i8** %5
%9 = call %struct.lh_entry* @lh_table_lookup_entry(%struct.lh_table* %7, i8* %8)
store %struct.lh_entry* %9, %struct.lh_entry** %6
%10 = load %struct.lh_entry*, %struct.lh_entry** %6
%11 = icmp ne %struct.lh_entry* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 -1, i32* %3
br label %17
13: ; preds = %2
%14 = load %struct.lh_table*, %struct.lh_table** %4
%15 = load %struct.lh_entry*, %struct.lh_entry** %6
%16 = call i32 @lh_table_delete_entry(%struct.lh_table* %14, %struct.lh_entry* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.lh_table = type { i32 }
%struct.lh_entry = type { i32 }
define i32 @lh_table_delete(%struct.lh_table* %0, i8* %1) {
%3 = tail call %struct.lh_entry* @lh_table_lookup_entry(%struct.lh_table* %0, i8* %1)
%4 = icmp eq %struct.lh_entry* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @lh_table_delete_entry(%struct.lh_table* %0, %struct.lh_entry* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ matriz(int **, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ teste_permutacao(int **, int);
int main(int argc, const char *argv[]) {
  int ordem;
  int M[100][100];
  scanf("%d", &ordem);
  matriz(M, ordem);
  teste_permutacao(M, ordem);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x9c60(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <matriz@plt>
lea    -0x9c60(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <teste_permutacao@plt>
xor    %eax,%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x9c50,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <matriz@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <teste_permutacao@plt>
xor    %eax,%eax
add    $0x9c50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [100 x [100 x i32]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%9 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %7, i64 0, i64 0
%10 = bitcast [100 x i32]* %9 to i32**
%11 = load i32, i32* %6
%12 = call i32 @matriz(i32** %10, i32 %11)
%13 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %7, i64 0, i64 0
%14 = bitcast [100 x i32]* %13 to i32**
%15 = load i32, i32* %6
%16 = call i32 @teste_permutacao(i32** %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [100 x [100 x i32]]
%5 = bitcast i32* %3 to i8*
%6 = bitcast [100 x [100 x i32]]* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = bitcast [100 x [100 x i32]]* %4 to i32**
%9 = load i32, i32* %3
%10 = call i32 @matriz(i32** %8, i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @teste_permutacao(i32** %8, i32 %11)
ret i32 0
}
int test_imm_B1uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xB1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B1uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xb1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B1uint64_lowword_mem>:
testb  $0xb1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B1uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 177
%6 = icmp ne i64 %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_B1uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 177
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ isinf(double);
int igraph_is_inf(double x) { return isinf(x) != 0; }


x86 assembly (clang, -O0):
<igraph_is_inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isinf@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<igraph_is_inf>:
push   %rax
call   1030 <isinf@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @igraph_is_inf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @isinf(double %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @igraph_is_inf(double %0) {
%2 = tail call i64 @isinf(double %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  printf("%d", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
bool have_hwcap2(unsigned long ftr2) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @have_hwcap2(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mspProcess();
void handleSerial(void) { mspProcess(); }


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

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

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

LLVM IR (-O2):
define void @handleSerial() {
%1 = tail call i32 (...) @mspProcess()
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  if (y >= 1) {
    while (x >= 0) {
      x = x - y;
    }
  }
  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    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     115f <main+0x4f>
jmp    1142 <main+0x32>
cmpl   $0x0,-0x8(%rbp)
jl     115a <main+0x4a>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x32>
jmp    115f <main+0x4f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jle    1134 <main+0x24>
test   %ebx,%ebx
js     1134 <main+0x24>
nopl   0x0(%rax)
sub    %eax,%ebx
jns    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sgt i32 %2, 0
%4 = icmp sgt i32 %1, -1
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %0, %6
%7 = phi i32 [ %8, %6 ], [ %1, %0 ]
%8 = sub nsw i32 %7, %2
%9 = icmp sgt i32 %8, -1
br i1 %9, label %6, label %10
10: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ bindtextdomain(char *, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ textdomain(char *);
void l10nInit() {
  setlocale(LC_ALL, "");
  bindtextdomain("CatChat_client", "po");
  textdomain("CatChat_client");
}


x86 assembly (clang, -O0):
<l10nInit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xeb0(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <bindtextdomain@plt>
lea    0xe9d(%rip),%rdi
call   1030 <textdomain@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<l10nInit>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xeb3(%rip),%rbx
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <bindtextdomain@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <textdomain@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [15 x i8] c"CatChat_client\00"
@.str.2 = [3 x i8] c"po\00"
define void @l10nInit() {
%1 = load i32, i32* @LC_ALL
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @bindtextdomain(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @textdomain(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [15 x i8] c"CatChat_client\00"
@.str.2 = [3 x i8] c"po\00"
define void @l10nInit() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @bindtextdomain(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @textdomain(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void my_put_char(char c) { fwrite(&c, sizeof(char), 1, stdout); }


x86 assembly (clang, -O0):
<my_put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
lea    -0x1(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_put_char>:
push   %rax
mov    %dil,0x7(%rsp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%ecx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @my_put_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fwrite(i8* %2, i32 1, i32 1, i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @my_put_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fwrite(i8* %2, i32 1, i32 1, i32 %3)
ret void
}
int bst_comp_long(void *data1, void *data2) {
  return *((long *)data1) - *((long *)data2);
}


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

x86 assembly (clang, -O2):
<bst_comp_long>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @bst_comp_long(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @bst_comp_long(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bswap16(uint16_t x) { return ((x & 0xFF) << 8) | (x >> 8); }


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

x86 assembly (clang, -O2):
<bswap16>:
mov    %edi,%eax
shl    $0x8,%eax
movzwl %ax,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bswap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bswap16(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, 65280
%4 = ashr i32 %0, 8
%5 = or i32 %3, %4
ret i32 %5
}
int pop3_is_ok(char *response) {
  if (response[0] == '+')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<pop3_is_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1124 <pop3_is_ok+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <pop3_is_ok+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop3_is_ok>:
xor    %eax,%eax
cmpb   $0x2b,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @pop3_is_ok(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 43
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *prog) {
  fprintf(stderr,
          "Usage: %s\n"
          "\n",
          prog);
  exit(0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Usage: %s\0A\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Usage: %s\0A\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double exp(double);
double log(double);
double sqrt(int);
double lognormalpdf(double x, double a, double b) {
  double z = (log(x) - a) / b;
  return exp(-z * z / 2) / (x * sqrt(2 * 3.1415926) * b);
}


x86 assembly (clang, -O0):
<lognormalpdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lognormalpdf>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1040 <log@plt>
subsd  (%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xe9f(%rip),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,(%rsp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @lognormalpdf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = call double @log(double %8)
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = load double, double* %6
%13 = fdiv double %11, %12
store double %13, double* %7
%14 = load double, double* %7
%15 = fneg double %14
%16 = load double, double* %7
%17 = fmul double %15, %16
%18 = fdiv double %17, 2.000000e+00
%19 = call double @exp(double %18)
%20 = load double, double* %4
%21 = call double @sqrt(i32 6)
%22 = fmul double %20, %21
%23 = load double, double* %6
%24 = fmul double %22, %23
%25 = fdiv double %19, %24
ret double %25
}

LLVM IR (-O2):
define double @lognormalpdf(double %0, double %1, double %2) {
%4 = tail call double @log(double %0)
%5 = fsub double %4, %1
%6 = fdiv double %5, %2
%7 = fneg double %6
%8 = fmul double %6, %7
%9 = fmul double %8, 5.000000e-01
%10 = tail call double @exp(double %9)
%11 = tail call double @sqrt(i32 6)
%12 = fmul double %11, %0
%13 = fmul double %12, %2
%14 = fdiv double %10, %13
ret double %14
}
int test_imm_0Bint16_reg(short val) {
  return ((val) & (0x0B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Bint16_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, 11
%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_0Bint16_reg(i16 signext %0) {
%2 = and i16 %0, 11
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct mdoc_node {
  int dummy;
};
struct mdoc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mdoc_node_unlink(struct mdoc *, struct mdoc_node *);
int node_append(struct mdoc *, struct mdoc_node *);
int mdoc_node_relink(struct mdoc *mdoc, struct mdoc_node *p) {
  mdoc_node_unlink(mdoc, p);
  return (node_append(mdoc, p));
}


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

x86 assembly (clang, -O2):
<mdoc_node_relink>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <mdoc_node_unlink@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <node_append@plt>

LLVM IR (-O0):
%struct.mdoc = type { i32 }
%struct.mdoc_node = type { i32 }
define i32 @mdoc_node_relink(%struct.mdoc* %0, %struct.mdoc_node* %1) {
%3 = alloca %struct.mdoc*
%4 = alloca %struct.mdoc_node*
store %struct.mdoc* %0, %struct.mdoc** %3
store %struct.mdoc_node* %1, %struct.mdoc_node** %4
%5 = load %struct.mdoc*, %struct.mdoc** %3
%6 = load %struct.mdoc_node*, %struct.mdoc_node** %4
%7 = call i32 @mdoc_node_unlink(%struct.mdoc* %5, %struct.mdoc_node* %6)
%8 = load %struct.mdoc*, %struct.mdoc** %3
%9 = load %struct.mdoc_node*, %struct.mdoc_node** %4
%10 = call i32 @node_append(%struct.mdoc* %8, %struct.mdoc_node* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.mdoc = type { i32 }
%struct.mdoc_node = type { i32 }
define i32 @mdoc_node_relink(%struct.mdoc* %0, %struct.mdoc_node* %1) {
%3 = tail call i32 @mdoc_node_unlink(%struct.mdoc* %0, %struct.mdoc_node* %1)
%4 = tail call i32 @node_append(%struct.mdoc* %0, %struct.mdoc_node* %1)
ret i32 %4
}
/* Variables and functions */
double exp(double);
double Double_exp(double x) { return exp(x); }


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

x86 assembly (clang, -O2):
<Double_exp>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @Double_exp(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
void *memrchr(const void *buffer, int c, size_t size) {
  const char *data = buffer;
  while (size)
    if (data[--size] == c)
      return (void *)(data + size);
  return 0;
}


x86 assembly (clang, -O0):
<memrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <memrchr+0x59>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x20(%rbp)
movsbl -0x1(%rax,%rcx,1),%eax
cmp    -0x14(%rbp),%eax
jne    1154 <memrchr+0x54>
mov    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <memrchr+0x61>
jmp    1117 <memrchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memrchr>:
xor    %eax,%eax
mov    %rdx,%rcx
cs nopw 0x0(%rax,%rax,1)
nop
sub    $0x1,%rcx
jb     112a <memrchr+0x2a>
movsbl -0x1(%rdi,%rdx,1),%r8d
mov    %rcx,%rdx
cmp    %esi,%r8d
jne    1110 <memrchr+0x10>
add    %rcx,%rdi
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @memrchr(i8* %0, i32 %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = phi i64 [ %2, %3 ], [ %8, %7 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %4
%8 = add i64 %5, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %0, i64 %8
br label %15
15: ; preds = %4, %13
%16 = phi i8* [ %14, %13 ], [ null, %4 ]
ret i8* %16
}
int dec_ctrl(int c) {
  if (c == 0xff)
    c = 11;
  else if (c == 0)
    c = 0xff;
  else
    c--;
  return c;
}


x86 assembly (clang, -O0):
<dec_ctrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jne    1120 <dec_ctrl+0x20>
movl   $0xb,-0x4(%rbp)
jmp    1144 <dec_ctrl+0x44>
cmpl   $0x0,-0x4(%rbp)
jne    1136 <dec_ctrl+0x36>
movl   $0xff,-0x4(%rbp)
jmp    113f <dec_ctrl+0x3f>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <dec_ctrl+0x44>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_ctrl>:
cmp    $0xff,%edi
je     1114 <dec_ctrl+0x14>
mov    %edi,%eax
test   %edi,%edi
jne    111a <dec_ctrl+0x1a>
mov    $0xff,%eax
ret
mov    $0xb,%eax
ret
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @dec_ctrl(i32 %0) {
switch i32 %0, label %3 [
i32 255, label %5
i32 0, label %2
]
2: ; preds = %1
br label %5
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %5
5: ; preds = %1, %2, %3
%6 = phi i32 [ 255, %2 ], [ %4, %3 ], [ 11, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *trenutnoVreme() {
  time_t mytime;
  mytime = time(NULL);
  struct tm *timeInfo;
  timeInfo = localtime(&mytime);
  timeInfo->tm_year += 1900;
  return timeInfo;
}


x86 assembly (clang, -O0):
<trenutnoVreme>:
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 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x76c,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @trenutnoVreme() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1900
store i32 %8, i32* %6
%9 = load %struct.tm*, %struct.tm** %2
ret %struct.tm* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @trenutnoVreme() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1900
store i32 %7, i32* %5
ret %struct.tm* %4
}
int chroma_super_implemented(int mode) {
  switch (mode) {
  case 0:
  case 3:
    return 1;
  case 1:
  case 2:
  case 4:
  case 5:
  case 7:
  case 6:
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<chroma_super_implemented>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1153 <chroma_super_implemented+0x53>
jmp    111a <chroma_super_implemented+0x1a>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     115f <chroma_super_implemented+0x5f>
jmp    112e <chroma_super_implemented+0x2e>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1153 <chroma_super_implemented+0x53>
jmp    113f <chroma_super_implemented+0x3f>
mov    -0xc(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x4,%eax
jb     115f <chroma_super_implemented+0x5f>
jmp    1164 <chroma_super_implemented+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <chroma_super_implemented+0x6b>
jmp    1164 <chroma_super_implemented+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chroma_super_implemented>:
test   %edi,%edi
sete   %al
cmp    $0x3,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @chroma_super_implemented(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 3, label %5
i32 1, label %6
i32 2, label %6
i32 4, label %6
i32 5, label %6
i32 7, label %6
i32 6, label %6
]
5: ; preds = %1, %1
store i32 1, i32* %2
br label %8
6: ; preds = %1, %1, %1, %1, %1, %1
br label %7
7: ; preds = %1, %6
store i32 0, i32* %2
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @chroma_super_implemented(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp eq i32 %0, 3
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
char *skip_blank(char *s) {
  while (*s == ' ' || *s == '\t')
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_blank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_blank+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_blank+0x3d>
jmp    114e <skip_blank+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_blank+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_blank>:
mov    %rdi,%rax
jmp    1114 <skip_blank+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_blank+0x10>
cmp    $0x9,%cl
je     1110 <skip_blank+0x10>
ret

LLVM IR (-O0):
define i8* @skip_blank(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_blank(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
int test3u(unsigned char x) { return x / 100 < 3; }


x86 assembly (clang, -O0):
<test3u>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test3u(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = icmp slt i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test3u(i8 zeroext %0) {
ret i32 1
}
/* Variables and functions */
int get4BE(unsigned char const *);
int computeInstanceDumpLen(const unsigned char *origBuf, int len) {
  int extraCount = get4BE(origBuf + 4 * 2 + 4);
  return 4 * 2 + 8 + extraCount;
}


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

x86 assembly (clang, -O2):
<computeInstanceDumpLen>:
push   %rax
add    $0xc,%rdi
call   1030 <get4BE@plt>
add    $0x10,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @computeInstanceDumpLen(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 = getelementptr inbounds i8, i8* %6, i64 8
%8 = getelementptr inbounds i8, i8* %7, i64 4
%9 = call i32 @get4BE(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = add nsw i32 16, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @computeInstanceDumpLen(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 12
%4 = tail call i32 @get4BE(i8* %3)
%5 = add nsw i32 %4, 16
ret i32 %5
}
/* Variables and functions */
int nameConvTranslate(char const *, size_t, char *, size_t);
int convertName(const char *fromName, size_t fromNameLen, char *toName,
                size_t toNameBufSz) {
  int rs = nameConvTranslate(fromName, fromNameLen, toName, toNameBufSz);
  return rs;
}


x86 assembly (clang, -O0):
<convertName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <nameConvTranslate@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertName>:
jmp    1030 <nameConvTranslate@plt>

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

LLVM IR (-O2):
define i32 @convertName(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @nameConvTranslate(i8* %0, i64 %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
scalar_t__ __SEEK(long long *, int, long long, int);
long long _SEEK(int fd, long long o, int p) {
  long long l;
  if (__SEEK(&l, fd, o, p) < 0)
    l = -1;
  return l;
}


x86 assembly (clang, -O0):
<_SEEK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    -0x20(%rbp),%rdi
call   1030 <__SEEK@plt>
cmp    $0x0,%rax
jge    1147 <_SEEK+0x37>
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_SEEK>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    %rsp,%rdi
call   1030 <__SEEK@plt>
mov    %rax,%rcx
mov    $0xffffffffffffffff,%rax
test   %rcx,%rcx
js     1133 <_SEEK+0x23>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @_SEEK(i32 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i64 @__SEEK(i64* %4, i32 %0, i64 %1, i32 %2)
%7 = load i64, i64* %4
%8 = icmp sgt i64 %6, -1
%9 = select i1 %8, i64 %7, i64 -1
ret i64 %9
}
jumpc(n) {
  xwrite('f ');
  xwrite('1f');
  xwrite('+');
  number(n);
  xwrite('\n');
}


x86 assembly (clang, -O0):
<jumpc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x6620,%edi
mov    $0x0,%al
call   1030 <xwrite@plt>
mov    $0x3166,%edi
mov    $0x0,%al
call   1030 <xwrite@plt>
mov    $0x2b,%edi
mov    $0x0,%al
call   1030 <xwrite@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <number@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <xwrite@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jumpc>:
push   %rbx
mov    %edi,%ebx
mov    $0x6620,%edi
xor    %eax,%eax
call   1030 <xwrite@plt>
mov    $0x3166,%edi
xor    %eax,%eax
call   1030 <xwrite@plt>
mov    $0x2b,%edi
xor    %eax,%eax
call   1030 <xwrite@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <number@plt>
mov    $0xa,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <xwrite@plt>

LLVM IR (-O0):
define i32 @jumpc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 26144)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 12646)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 43)
%7 = load i32, i32* %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @number to i32 (i32, ...)*)(i32 %7)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 10)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @jumpc(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 26144)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 12646)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 43)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @number to i32 (i32, ...)*)(i32 %0)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, ...)*)(i32 10)
ret i32 undef
}