xunge/DecIR huggingface dataset:
/* Variables and functions */
int log_init_internal(char *, char *);
int log_init_reset(char *filename) { return log_init_internal(filename, "w"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @log_init_reset(i8* %0) {
%2 = tail call i32 @log_init_internal(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void make32bit(unsigned int in, unsigned char *p) {
  p[0] = (in >> 24) & 0xff;
  p[1] = (in >> 16) & 0xff;
  p[2] = (in >> 8) & 0xff;
  p[3] = in & 0xff;
}


x86 assembly (clang, -O0):
<make32bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<make32bit>:
bswap  %edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @make32bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = lshr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %3
%12 = lshr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = lshr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %3
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @make32bit(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %0, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %0 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
bool num_check(char c) {
  if (c >= '0' && c <= '9')
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<num_check>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <num_check+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <num_check+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <num_check+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_check>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @num_check(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @num_check(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool sancus_get_u32ll(long long v, uint32_t *out) {
  if ((v >= 0) && (v <= 0xffffffff)) {
    if (out != NULL)
      *out = (uint32_t)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_u32ll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1148 <sancus_get_u32ll+0x48>
mov    $0xffffffff,%eax
cmp    %rax,-0x10(%rbp)
jg     1148 <sancus_get_u32ll+0x48>
cmpq   $0x0,-0x18(%rbp)
je     113c <sancus_get_u32ll+0x3c>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    114f <sancus_get_u32ll+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_u32ll>:
xor    %eax,%eax
mov    %rdi,%rcx
shr    $0x20,%rcx
jne    1118 <sancus_get_u32ll+0x18>
mov    $0x1,%eax
test   %rsi,%rsi
je     1118 <sancus_get_u32ll+0x18>
mov    %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @sancus_get_u32ll(i64 %0, i64* writeonly %1) {
%3 = icmp ult i64 %0, 4294967296
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp eq i64* %1, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i64 %0, i64* %1
br label %7
7: ; preds = %2, %4, %6
%8 = phi i32 [ 1, %6 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
void drm_release_iommu_mapping(struct drm_device *drm_dev) {}


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define void @drm_release_iommu_mapping(%struct.drm_device* nocapture %0) {
ret void
}
/* Variables and functions */
void *j2(size_t);
void *k(size_t n) { return j2(n); }


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

x86 assembly (clang, -O2):
<k>:
jmp    1030 <j2@plt>

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

LLVM IR (-O2):
define i8* @k(i64 %0) {
%2 = tail call i8* @j2(i64 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ exp(double);
double log(scalar_t__);
double softplus(double x) { return log(1 + exp(x)); }


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

x86 assembly (clang, -O2):
<softplus>:
push   %rax
call   1030 <exp@plt>
lea    0x1(%rax),%rdi
pop    %rax
jmp    1040 <log@plt>

LLVM IR (-O0):
define double @softplus(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @exp(double %3)
%5 = add nsw i64 1, %4
%6 = call double @log(i64 %5)
ret double %6
}

LLVM IR (-O2):
define double @softplus(double %0) {
%2 = tail call i64 @exp(double %0)
%3 = add nsw i64 %2, 1
%4 = tail call double @log(i64 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
void print_time_diff(unsigned int start, unsigned int end) {
  unsigned int diff = end - start;
  printf("%u cc = %u µs = %u ms", diff, diff / 100, diff / 100000);
}


x86 assembly (clang, -O0):
<print_time_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x186a0,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time_diff>:
sub    %edi,%esi
imul   $0x51eb851f,%rsi,%rdx
shr    $0x25,%rdx
mov    %esi,%eax
shr    $0x5,%eax
imul   $0xa7c5ac5,%rax,%rcx
shr    $0x27,%rcx
lea    0xecc(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%u cc = %u \C2\B5s = %u ms\00"
define void @print_time_diff(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* %4
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %5
%11 = udiv i32 %10, 100
%12 = load i32, i32* %5
%13 = udiv i32 %12, 100000
%14 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%u cc = %u \C2\B5s = %u ms\00"
define void @print_time_diff(i32 %0, i32 %1) {
%3 = sub i32 %1, %0
%4 = udiv i32 %3, 100
%5 = udiv i32 %3, 100000
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
void *malloc(long);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, long);
void *pakman_malloc(long size) {
  void *b = malloc(size);
  if (b)
    memset(b, 0, size);
  return b;
}


x86 assembly (clang, -O0):
<pakman_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <pakman_malloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pakman_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <pakman_malloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @pakman_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
OP(fd, fa) {
  illegal_1();
  op_fa();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_fa@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_fa@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_fa()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 1;
  while (n <= 10) {
    printf("%d", n);
  }
  n++;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1144 <main+0x34>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ mapper_lua_ppu_a12_listener();
void mapper_ppu_a12_listener() { mapper_lua_ppu_a12_listener(); }


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

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

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

LLVM IR (-O2):
define void @mapper_ppu_a12_listener() {
%1 = tail call i32 (...) @mapper_lua_ppu_a12_listener()
ret void
}
/* Type definitions */
struct bucket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bucket *);
void bucket_free(struct bucket *bkt) {
  free(bkt);
  bkt = NULL;
}


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

x86 assembly (clang, -O2):
<bucket_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.bucket = type { i32 }
define void @bucket_free(%struct.bucket* nocapture %0) {
%2 = tail call i32 @free(%struct.bucket* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtsd_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cvtsd_ss(__m128 A, __m128d B) { return _mm_cvtsd_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cvtsd_ss>:
jmp    1030 <_mm_cvtsd_ss@plt>

LLVM IR (-O0):
define i32 @test_mm_cvtsd_ss(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 @_mm_cvtsd_ss(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cvtsd_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cvtsd_ss(i32 %0, i32 %1)
ret i32 %3
}
void _timer_int_handler() {}


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

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

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

LLVM IR (-O2):
define void @_timer_int_handler() {
ret void
}
/* Variables and functions */
char *isaac_skip_blanks(char *);
int /*<<< orphan*/ isaac_trim_blanks(char *);
char *isaac_strip(char *s) {
  s = isaac_skip_blanks(s);
  if (s)
    isaac_trim_blanks(s);
  return s;
}


x86 assembly (clang, -O0):
<isaac_strip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <isaac_skip_blanks@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114d <isaac_strip+0x2d>
mov    -0x8(%rbp),%rdi
call   1040 <isaac_trim_blanks@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isaac_strip>:
push   %rbx
call   1030 <isaac_skip_blanks@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1136 <isaac_strip+0x16>
mov    %rbx,%rdi
call   1040 <isaac_trim_blanks@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @isaac_strip(i8* %0) {
%2 = tail call i8* @isaac_skip_blanks(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @isaac_trim_blanks(i8* %2)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void element2CR() {}


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

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

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

LLVM IR (-O2):
define void @element2CR() {
ret void
}
long __syscall_error(void) {
  register int err_no __asm__("%rcx");
  __asm__("mov %rax, %rcx\n\t"
          "neg %rcx");
  __set_errno(err_no);
  return -1;
}


x86 assembly (clang, -O0):
<__syscall_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rax,%rcx
neg    %rcx
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <__set_errno@plt>
mov    $0xffffffffffffffff,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_error>:
push   %rax
mov    %rax,%rcx
neg    %rcx
xor    %eax,%eax
call   1030 <__set_errno@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @__syscall_error() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 (i32, ...) bitcast (i32 (...)* @__set_errno to i32 (i32, ...)*)(i32 %2)
ret i64 -1
}

LLVM IR (-O2):
define i64 @__syscall_error() {
tail call void asm sideeffect "mov %rax, %rcx\0A\09neg %rcx", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @__set_errno to i32 (i32, ...)*)(i32 undef)
ret i64 -1
}
/* Type definitions */
struct z_heap {
  int dummy;
};

/* Variables and functions */
int bytes_to_chunksz(struct z_heap *, int);
int min_chunk_size(struct z_heap *h) { return bytes_to_chunksz(h, 1); }


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

x86 assembly (clang, -O2):
<min_chunk_size>:
mov    $0x1,%esi
jmp    1030 <bytes_to_chunksz@plt>

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

LLVM IR (-O2):
%struct.z_heap = type { i32 }
define i32 @min_chunk_size(%struct.z_heap* %0) {
%2 = tail call i32 @bytes_to_chunksz(%struct.z_heap* %0, i32 1)
ret i32 %2
}
unsigned scale2x_generic_input_fmts(void) { return (1 << 1) | (1 << 0); }


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

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

LLVM IR (-O0):
define i32 @scale2x_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @scale2x_generic_input_fmts() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char text[100];
  if (fgets(text, 80, stdin) != NULL)
    printf("\033[1m%s\033[0m", text);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1160 <main+0x40>
lea    -0x70(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     114e <main+0x2e>
lea    0xeba(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [11 x i8] c"\1B[1m%s\1B[0m\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32* @fgets(i8* %3, i32 80, i32 %4)
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [11 x i8] c"\1B[1m%s\1B[0m\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32* @fgets(i8* %2, i32 80, i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %6, %0
ret i32 0
}
int char_strlen(char const *s, char c, int i) {
  int n;
  n = 0;
  while (s[i] != c && s[i] != '\0') {
    i++;
    n++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<char_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
je     114a <char_strlen+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    115a <char_strlen+0x5a>
jmp    1171 <char_strlen+0x71>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <char_strlen+0x18>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_strlen>:
movslq %edx,%rcx
lea    -0x1(%rcx),%eax
add    %rcx,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%ecx
add    $0x1,%eax
cmp    %sil,%cl
je     1123 <char_strlen+0x23>
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <char_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @char_strlen(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = sext i32 %2 to i64
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %12, %5 ], [ %4, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %1
%10 = icmp eq i8 %8, 0
%11 = or i1 %9, %10
%12 = add i64 %6, 1
br i1 %11, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %6 to i32
ret i32 %14
}
/* Type definitions */
struct gg_http {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ gg_debug(int, char *);
struct gg_http *gg_register(const char *email, const char *password,
                            int async) {
  gg_debug(16, "// gg_register() is obsolete. use gg_register3() instead!\n");
  errno = EINVAL;
  return NULL;
}


x86 assembly (clang, -O0):
<gg_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x10,%edi
lea    0xed1(%rip),%rsi
call   1030 <gg_debug@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9c(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gg_register>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x10,%edi
call   1030 <gg_debug@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    0x2eae(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.gg_http = type { i32 }
@.str = [59 x i8] c"// gg_register() is obsolete. use gg_register3() instead!\0A\00"
@EINVAL = global i32 0
@errno = global i32 0
define %struct.gg_http* @gg_register(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @gg_debug(i32 16, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EINVAL
store i32 %8, i32* @errno
ret %struct.gg_http* null
}

LLVM IR (-O2):
%struct.gg_http = type { i32 }
@.str = [59 x i8] c"// gg_register() is obsolete. use gg_register3() instead!\0A\00"
@EINVAL = global i32 0
@errno = global i32 0
define noalias %struct.gg_http* @gg_register(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @gg_debug(i32 16, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret %struct.gg_http* null
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ntohl(uint32_t val) {
  uint8_t *c = (uint8_t *)&val;
  return (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | (c[3]);
}


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

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

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

LLVM IR (-O2):
define i32 @ntohl(i32 %0) {
ret i32 poison
}
/* Variables and functions */
scalar_t__ isprint(int);
int c(int byte) { return isprint(byte) ? byte : '.'; }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
je     1138 <c+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <c+0x35>
mov    $0x2e,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <c+0x35>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
mov    %edi,%ebx
call   1030 <isprint@plt>
test   %rax,%rax
mov    $0x2e,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isprint(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i32 [ %7, %6 ], [ 46, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @c(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 46, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int *);
int smp_visit_array_elems(void *elem_) {
  int *elem = (int *)elem_;
  printf("%d      %p\n", *elem, elem);
  return (0);
}


x86 assembly (clang, -O0):
<smp_visit_array_elems>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_visit_array_elems>:
push   %rax
mov    %rdi,%rdx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d %p\0A\00"
define i32 @smp_visit_array_elems(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32* %2)
ret i32 0
}
/* Variables and functions */
int rand();
void vetor_rand(int v[], int n) {
  int x;
  for (x = 0; x < n; x++) {
    v[x] = rand();
  }
}


x86 assembly (clang, -O0):
<vetor_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <vetor_rand+0x44>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <vetor_rand+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vetor_rand>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <vetor_rand+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <vetor_rand+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @vetor_rand(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @vetor_rand(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call i32 (...) @rand()
%9 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %8, i32* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello C");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Hello C\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Hello C\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct ringbuffer {
  int dummy;
};
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ drain_cached_bytes(struct ringbuffer *, int /*<<< orphan*/ *,
                              scalar_t__, int, int /*<<< orphan*/ *);
int32_t rb_drop(struct ringbuffer *rb, int32_t size) {
  if (!rb || size <= 0) {
    return -1;
  }
  return drain_cached_bytes(rb, NULL, size, -1, NULL);
}


x86 assembly (clang, -O0):
<rb_drop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <rb_drop+0x26>
cmpq   $0x0,-0x18(%rbp)
jg     1143 <rb_drop+0x33>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1161 <rb_drop+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0xffffffff,%ecx
mov    %r8,%rsi
call   1030 <drain_cached_bytes@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_drop>:
test   %rdi,%rdi
je     112c <rb_drop+0x1c>
mov    %rsi,%rdx
test   %rsi,%rsi
jle    112c <rb_drop+0x1c>
xor    %esi,%esi
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
jmp    1030 <drain_cached_bytes@plt>
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
%struct.ringbuffer = type { i32 }
define i64 @rb_drop(%struct.ringbuffer* %0, i64 %1) {
%3 = icmp eq %struct.ringbuffer* %0, null
%4 = icmp slt i64 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i64 @drain_cached_bytes(%struct.ringbuffer* %0, i32* null, i64 %1, i32 -1, i32* null)
br label %8
8: ; preds = %2, %6
%9 = phi i64 [ %7, %6 ], [ -1, %2 ]
ret i64 %9
}
unsigned char is_hex_char(char c) {
  return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
          (c >= 'A' && c <= 'F'));
}


x86 assembly (clang, -O0):
<is_hex_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <is_hex_char+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_hex_char+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_hex_char+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_hex_char+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <is_hex_char+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_char>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %cl
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @is_hex_char(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, 48
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, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
%31 = trunc i32 %30 to i8
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @is_hex_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i8
ret i8 %8
}
int f(a, b)
int a;
{ return a; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_alloc_nosize__();
void *OBJ_dup(void *o) { __coverity_alloc_nosize__(); }


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

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

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

LLVM IR (-O2):
define noalias i8* @OBJ_dup(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @__coverity_alloc_nosize__()
ret i8* undef
}
/* Variables and functions */
int lib2fun();
int lib3fun();
int __attribute__((visibility("default"))) libfun(void) {
  return lib2fun() + lib3fun();
}


x86 assembly (clang, -O0):
<libfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <lib2fun@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lib3fun@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libfun>:
push   %rbx
xor    %eax,%eax
call   1040 <lib2fun@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <lib3fun@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @libfun() {
%1 = call i32 (...) @lib2fun()
%2 = call i32 (...) @lib3fun()
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @libfun() {
%1 = tail call i32 (...) @lib2fun()
%2 = tail call i32 (...) @lib3fun()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort(int *l, int low, int high) {
  if (low >= high)
    return;
  int middle;
  middle = partition(l, low, high);
  quicksort(l, low, middle - 1);
  quicksort(l, middle + 1, high);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <quicksort+0x23>
jmp    1179 <quicksort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void ls_cost_nm2_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_cost_nm2_decref() {
ret void
}
void RTSemEventWait(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventWait() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int select_one(void) {
  int retValue_acc;
  int choice = __VERIFIER_nondet_int();
  {
    retValue_acc = choice;
    return (retValue_acc);
    return (retValue_acc);
  }
}


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

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

LLVM IR (-O0):
define i32 @select_one() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @select_one() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ multiply_matrix(int);
int /*<<< orphan*/ start();
int /*<<< orphan*/ stop();
int main() {
  start();
  multiply_matrix(800);
  stop();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <start@plt>
mov    $0x320,%edi
call   1030 <multiply_matrix@plt>
xor    %eax,%eax
call   1040 <stop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @start()
%3 = call i32 @multiply_matrix(i32 800)
%4 = call i32 (...) @stop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start()
%2 = tail call i32 @multiply_matrix(i32 800)
%3 = tail call i32 (...) @stop()
ret i32 0
}
void foo_1_1_1_2_2_2_1_2_1() {}


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

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

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

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