xunge/DecIR huggingface dataset:
int f(int a, int *y) {
  int x = a;
  if (a == 0)
    return *y;
  return f(a - 1, &x);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113d <f+0x2d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <f+0x3f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
lea    -0x14(%rbp),%rsi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    %edi,0x4(%rsp)
test   %edi,%edi
je     1128 <f+0x18>
add    $0xffffffff,%edi
lea    0x4(%rsp),%rsi
call   1030 <f@plt>
pop    %rcx
ret
mov    (%rsi),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 %0, i32* %3
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load i32, i32* %1
br label %11
8: ; preds = %2
%9 = add nsw i32 %0, -1
%10 = call i32 @f(i32 %9, i32* %3)
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ %7, %6 ], [ %10, %8 ]
ret i32 %12
}
__attribute__((no)) void func_5(void) {}


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

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

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

LLVM IR (-O2):
define void @func_5() {
ret void
}
/* Variables and functions */
long round(double value) {
  long intpart;
  intpart = value;
  value = value - intpart;
  if (value >= 0.5)
    intpart++;
  return intpart;
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     114a <round+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xeea(%rip),%xmm0
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @round(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load double, double* %2
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = fsub double %6, %8
store double %9, double* %2
%10 = load double, double* %2
%11 = fcmp oge double %10, 5.000000e-01
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @round(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fcmp oge double %4, 5.000000e-01
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void start_log() { openlog("zaplib", LOG_PID, LOG_USER); }


x86 assembly (clang, -O0):
<start_log>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
lea    0xed3(%rip),%rdi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_log>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
lea    0xed7(%rip),%rdi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"zaplib\00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
define void @start_log() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_USER
%3 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"zaplib\00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
define void @start_log() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_USER
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
void put_str(unsigned short *dst, const char *str) {
  static char i;
  while (1) {
    i = *str++;
    if (!i)
      return;
    *dst++ = (0x0100 | (((0) & 7) << 10) | 0x2000) + i - 32;
  }
}


x86 assembly (clang, -O0):
<put_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,0x2efe(%rip)
cmpb   $0x0,0x2ef7(%rip)
jne    1132 <put_str+0x32>
pop    %rbp
ret
movsbl 0x2ee8(%rip),%eax
add    $0x2100,%eax
sub    $0x20,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x2,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cx,(%rax)
jmp    110c <put_str+0xc>

x86 assembly (clang, -O2):
<put_str>:
mov    (%rsi),%cl
test   %cl,%cl
je     112a <put_str+0x2a>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
add    $0x20e0,%ecx
mov    %cx,(%rdi,%rax,2)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <put_str+0x10>
ret

LLVM IR (-O0):
@put_str.i = internal global i8 0
define void @put_str(i16* %0, i8* %1) {
%3 = alloca i16*
%4 = alloca i8*
store i16* %0, i16** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %2, %12
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
store i8 %8, i8* @put_str.i
%9 = load i8, i8* @put_str.i
%10 = icmp ne i8 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %5
ret void
12: ; preds = %5
%13 = load i8, i8* @put_str.i
%14 = sext i8 %13 to i32
%15 = add nsw i32 8448, %14
%16 = sub nsw i32 %15, 32
%17 = trunc i32 %16 to i16
%18 = load i16*, i16** %3
%19 = getelementptr inbounds i16, i16* %18, i32 1
store i16* %19, i16** %3
store i16 %17, i16* %18
br label %5
}

LLVM IR (-O2):
define void @put_str(i16* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i8 [ %14, %6 ], [ %3, %2 ]
%8 = phi i8* [ %10, %6 ], [ %1, %2 ]
%9 = phi i16* [ %13, %6 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %7 to i16
%12 = add nsw i16 %11, 8416
%13 = getelementptr inbounds i16, i16* %9, i64 1
store i16 %12, i16* %9
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %5, label %6
}
void usb_pm_unlock(struct usb_device *udev) {}


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

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

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

LLVM IR (-O2):
%struct.usb_device = type opaque
define void @usb_pm_unlock(%struct.usb_device* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ munmap(int /*<<< orphan*/, int /*<<< orphan*/ const);
void tt_aligned_free(caddr_t a, const ssize_t size) { munmap(a, size); }


x86 assembly (clang, -O0):
<tt_aligned_free>:
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 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tt_aligned_free>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @tt_aligned_free(i32 %0, i32 %1) {
%3 = tail call i32 @munmap(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
short __hsign(short, short);
short intr_wrap_467(short p1, short p2) { return __hsign(p1, p2); }


x86 assembly (clang, -O0):
<intr_wrap_467>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
movswl -0x4(%rbp),%esi
call   1030 <__hsign@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_467>:
jmp    1030 <__hsign@plt>

LLVM IR (-O0):
define signext i16 @intr_wrap_467(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = call signext i16 @__hsign(i16 signext %5, i16 signext %6)
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @intr_wrap_467(i16 signext %0, i16 signext %1) {
%3 = tail call signext i16 @__hsign(i16 signext %0, i16 signext %1)
ret i16 %3
}
void xfree(string) void *string;
{
  if (string)
    free(string);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @free(i8* %0)
br label %4
4: ; preds = %3, %1
ret void
}
void foo400(int p) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @foo400(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HF_strcpy(char *, char const *, uintptr_t);
void __sanitizer_weak_hook_strcpy(uintptr_t pc, char *dest, const char *src,
                                  char *result __attribute__((unused))) {
  HF_strcpy(dest, src, pc);
}


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

x86 assembly (clang, -O2):
<__sanitizer_weak_hook_strcpy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <HF_strcpy@plt>

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

LLVM IR (-O2):
define void @__sanitizer_weak_hook_strcpy(i64 %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @HF_strcpy(i8* %1, i8* %2, i64 %0)
ret void
}
int mock_cache_get(struct da_cloud_cache_cfg *cfg, const char *key,
                   char **value) {
  (void)cfg;
  (void)key;
  (void)value;
  return (0);
}


x86 assembly (clang, -O0):
<mock_cache_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.da_cloud_cache_cfg = type opaque
define i32 @mock_cache_get(%struct.da_cloud_cache_cfg* %0, i8* %1, i8** %2) {
%4 = alloca %struct.da_cloud_cache_cfg*
%5 = alloca i8*
%6 = alloca i8**
store %struct.da_cloud_cache_cfg* %0, %struct.da_cloud_cache_cfg** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load %struct.da_cloud_cache_cfg*, %struct.da_cloud_cache_cfg** %4
%8 = load i8*, i8** %5
%9 = load i8**, i8*** %6
ret i32 0
}

LLVM IR (-O2):
%struct.da_cloud_cache_cfg = type opaque
define i32 @mock_cache_get(%struct.da_cloud_cache_cfg* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 0
}
double fsquare(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<fsquare>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @fsquare(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int rand();
int sortear(void) {
  int x;
  x = rand() % 6;
  return x;
}


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

x86 assembly (clang, -O2):
<sortear>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sortear() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 6
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @sortear() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
ret i32 %2
}
int test_imm_59int16_mem(short *val) {
  return ((*val) & (-0x59 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_59int16_mem>:
movzwl (%rdi),%eax
test   $0xffa7,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_59int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -89
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: uart_irm start [-d <devicename>]\n"
                  "       uart_irm stop\n"
                  "       uart_irm status\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [85 x i8] c"usage: uart_irm start [-d <devicename>]\0A uart_irm stop\0A uart_irm status\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [85 x i8] c"usage: uart_irm start [-d <devicename>]\0A uart_irm stop\0A uart_irm status\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void early_exits() {
  int i = 0;
  if (i) {
  }
  while (i < 100) {
    i++;
    if (i > 50)
      break;
    if (i % 2)
      continue;
  }
  if (i) {
  }
  do {
    if (i > 75)
      return;
    else
      i++;
  } while (i < 100);
  if (i) {
  }
}


x86 assembly (clang, -O0):
<early_exits>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111a <early_exits+0x1a>
jmp    111a <early_exits+0x1a>
jmp    111f <early_exits+0x1f>
cmpl   $0x64,-0x4(%rbp)
jge    115f <early_exits+0x5f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jle    1141 <early_exits+0x41>
jmp    115f <early_exits+0x5f>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     115a <early_exits+0x5a>
jmp    111f <early_exits+0x1f>
jmp    111f <early_exits+0x1f>
cmpl   $0x0,-0x4(%rbp)
je     116e <early_exits+0x6e>
jmp    116e <early_exits+0x6e>
jmp    1173 <early_exits+0x73>
cmpl   $0x4b,-0x4(%rbp)
jle    1182 <early_exits+0x82>
jmp    11a9 <early_exits+0xa9>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <early_exits+0x90>
cmpl   $0x64,-0x4(%rbp)
jl     1173 <early_exits+0x73>
cmpl   $0x0,-0x4(%rbp)
je     11a9 <early_exits+0xa9>
jmp    11a9 <early_exits+0xa9>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @early_exits() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %5
5: ; preds = %4, %0
br label %6
6: ; preds = %20, %19, %5
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 50
br i1 %13, label %14, label %15
14: ; preds = %9
br label %21
15: ; preds = %9
%16 = load i32, i32* %1
%17 = srem i32 %16, 2
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
br label %6
20: ; preds = %15
br label %6
21: ; preds = %14, %6
%22 = load i32, i32* %1
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21
br label %25
25: ; preds = %24, %21
br label %26
26: ; preds = %34, %25
%27 = load i32, i32* %1
%28 = icmp sgt i32 %27, 75
br i1 %28, label %29, label %30
29: ; preds = %26
br label %41
30: ; preds = %26
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
br label %33
33: ; preds = %30
br label %34
34: ; preds = %33
%35 = load i32, i32* %1
%36 = icmp slt i32 %35, 100
br i1 %36, label %26, label %37
37: ; preds = %34
%38 = load i32, i32* %1
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %37
br label %41
41: ; preds = %29, %40, %37
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @Sys_EventLoop() {
ret void
}
/* Variables and functions */
int pow(double, int);
double f(double v) { return 70 * pow(v, 3) - 3 * pow(v, 2) + 4 * v - 16; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
imul   $0x46,%eax,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0x3,%ecx,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xeac(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe94(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
imul   $0x46,%eax,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
cvtsi2sd %ebx,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xeb1(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xead(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 3)
%5 = mul nsw i32 70, %4
%6 = load double, double* %2
%7 = call i32 @pow(double %6, i32 2)
%8 = mul nsw i32 3, %7
%9 = sub nsw i32 %5, %8
%10 = sitofp i32 %9 to double
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %11, double %10)
%13 = fsub double %12, 1.600000e+01
ret double %13
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call i32 @pow(double %0, i32 3)
%3 = mul nsw i32 %2, 70
%4 = tail call i32 @pow(double %0, i32 2)
%5 = mul i32 %4, -3
%6 = add i32 %5, %3
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %0, double 4.000000e+00, double %7)
%9 = fadd double %8, -1.600000e+01
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ call_ddv();
int main(void) {
  {
    { call_ddv(); }
    return (0);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @call_ddv()
ret i32 0
}
/* Variables and functions */
unsigned long gfx_pci_config_read(int);
unsigned long gu2_get_vid_register_base(void) {
  return gfx_pci_config_read(0x8000091C);
}


x86 assembly (clang, -O0):
<gu2_get_vid_register_base>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8000091c,%edi
call   1030 <gfx_pci_config_read@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu2_get_vid_register_base>:
mov    $0x8000091c,%edi
jmp    1030 <gfx_pci_config_read@plt>

LLVM IR (-O0):
define i64 @gu2_get_vid_register_base() {
%1 = call i64 @gfx_pci_config_read(i32 -2147481316)
ret i64 %1
}

LLVM IR (-O2):
define i64 @gu2_get_vid_register_base() {
%1 = tail call i64 @gfx_pci_config_read(i32 -2147481316)
ret i64 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap32(uint32_t x) {
  return (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24);
}


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

x86 assembly (clang, -O2):
<swap32>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = and i32 %5, 65280
%7 = shl i32 %6, 8
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 16711680
%11 = ashr i32 %10, 8
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @swap32(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = or i32 %3, %4
ret i32 %5
}
/* Type definitions */
struct RNAMemory {
  int dummy;
};

/* Variables and functions */
struct RNAMemory *process_single_file(char *);
struct RNAMemory *RNAProfiles(char *fileName) {
  return process_single_file(fileName);
}


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

x86 assembly (clang, -O2):
<RNAProfiles>:
jmp    1030 <process_single_file@plt>

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

LLVM IR (-O2):
%struct.RNAMemory = type { i32 }
define %struct.RNAMemory* @RNAProfiles(i8* %0) {
%2 = tail call %struct.RNAMemory* @process_single_file(i8* %0)
ret %struct.RNAMemory* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void *malloc(int);
void *constructor(void) { return malloc(sizeof(uint64_t)); }


x86 assembly (clang, -O0):
<constructor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<constructor>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @constructor() {
%1 = call i8* @malloc(i32 4)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @constructor() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char t = 50;
  char *z1 = &t;
  void *z2 = z1;
  unsigned int *pi = z2;
  printf("pi = %u\n", *pi);
  if (((char)*pi) != 50) {
    printf("UNSAFE\n");
    goto ERROR;
  }
  printf("SAFE\n");
  return (0);
ERROR:
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x32,-0x5(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
movsbl %al,%eax
cmp    $0x32,%eax
je     1174 <main+0x64>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118e <main+0x7e>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1195 <main+0x85>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"pi = %u\0A\00"
@.str.1 = [8 x i8] c"UNSAFE\0A\00"
@.str.2 = [6 x i8] c"SAFE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i32 0, i32* %1
store i8 50, i8* %2
store i8* %2, i8** %3
%6 = load i8*, i8** %3
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = trunc i32 %13 to i8
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 50
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %21
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %22
21: ; preds = %17
store i32 -1, i32* %1
br label %22
22: ; preds = %21, %19
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [9 x i8] c"pi = %u\0A\00"
@str = [5 x i8] c"SAFE\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 50)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d", (1 << n) - n - 1);
  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
call   1040 <scanf@plt>
mov    -0x8(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
sub    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
not    %ecx
add    %eax,%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = shl nuw i32 1, %4
%6 = xor i32 %4, -1
%7 = add i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = 23;
  while (x >= y) {
    x = x - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x17,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     114a <main+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
unsigned char MmioUtil_Read8(void *base, const unsigned long offset) {
  return *(volatile unsigned char *)(void *)((char *)(base) + (offset));
}


x86 assembly (clang, -O0):
<MmioUtil_Read8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MmioUtil_Read8>:
mov    (%rdi,%rsi,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @MmioUtil_Read8(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load volatile i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @MmioUtil_Read8(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load volatile i8, i8* %3
ret i8 %4
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ validptr(char **);
int dealwithargs(int argc, char **__attribute__((array)) argv) {
  int level;
  {
    if (argc > 1) {
      validptr(argv + 1);
      level = atoi(*(argv + 1));
    } else {
      level = 1024;
    }
    return (level);
  }
}


x86 assembly (clang, -O0):
<dealwithargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    115b <dealwithargs+0x3b>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1040 <validptr@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1162 <dealwithargs+0x42>
movl   $0x400,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealwithargs>:
cmp    $0x2,%edi
jl     113c <dealwithargs+0x1c>
push   %rbx
mov    %rsi,%rbx
lea    0x8(%rsi),%rdi
call   1040 <validptr@plt>
mov    0x8(%rbx),%rdi
pop    %rbx
jmp    1030 <atoi@plt>
mov    $0x400,%eax
ret

LLVM IR (-O0):
define i32 @dealwithargs(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = call i32 @validptr(i8** %10)
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %5
br label %17
16: ; preds = %2
store i32 1024, i32* %5
br label %17
17: ; preds = %16, %8
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @dealwithargs(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = tail call i32 @validptr(i8** %5)
%7 = load i8*, i8** %5
%8 = tail call i32 @atoi(i8* %7)
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 1024, %2 ]
ret i32 %10
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ft_putstr(char *);
int ft_die(char *reason) {
  ft_putstr(reason);
  exit(EXIT_FAILURE);
  return (EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<ft_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ft_putstr@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ft_die>:
push   %rax
call   1030 <ft_putstr@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @ft_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ft_putstr(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @ft_die(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void initZero(int vetor[]) {
  int i;
  for (i = 0; i < 10; i++)
    vetor[i] = 0;
}


x86 assembly (clang, -O0):
<initZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1136 <initZero+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <initZero+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initZero>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movq   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @initZero(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _sys_rawwrite(char);
void _sys_write_tty(char c) {
  _sys_rawwrite(c);
  if (c == '\n')
    _sys_rawwrite('\r');
}


x86 assembly (clang, -O0):
<_sys_write_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <_sys_rawwrite@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    113e <_sys_write_tty+0x2e>
mov    $0xd,%edi
call   1030 <_sys_rawwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sys_write_tty>:
push   %rbx
mov    %edi,%ebx
call   1030 <_sys_rawwrite@plt>
cmp    $0xa,%bl
jne    1128 <_sys_write_tty+0x18>
mov    $0xd,%edi
pop    %rbx
jmp    1030 <_sys_rawwrite@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @_sys_write_tty(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @_sys_rawwrite(i8 signext %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @_sys_rawwrite(i8 signext 13)
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @_sys_write_tty(i8 signext %0) {
%2 = tail call i32 @_sys_rawwrite(i8 signext %0)
%3 = icmp eq i8 %0, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @_sys_rawwrite(i8 signext 13)
br label %6
6: ; preds = %4, %1
ret void
}
int uninit() {
  int x;
  return x + 2;
}


x86 assembly (clang, -O0):
<uninit>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
add    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @uninit() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 2
ret i32 %3
}

LLVM IR (-O2):
define i32 @uninit() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(void *, void *);
unsigned int str_equ(void *key1, void *key2) { return !strcmp(key1, key2); }


x86 assembly (clang, -O0):
<str_equ>:
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 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @str_equ(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 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @str_equ(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int counter(int a, int b) { return a + 1; }


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

x86 assembly (clang, -O2):
<counter>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @counter(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 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @counter(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
ret i32 %3
}
void ff_hevc_put_hevc_bi_w_qpel_hv16_12_sse4() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void emit_h_file_header(FILE *fp) {
  fprintf(fp, "#include <stdint.h>\n"
              "#include <stdbool.h>\n"
              "\n"
              "#include \"libqrtr.h\"\n"
              "\n");
}


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

x86 assembly (clang, -O2):
<emit_h_file_header>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x40,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"#include <stdint.h>\0A#include <stdbool.h>\0A\0A#include \22libqrtr.h\22\0A\0A\00"
define void @emit_h_file_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"#include <stdint.h>\0A#include <stdbool.h>\0A\0A#include \22libqrtr.h\22\0A\0A\00"
define void @emit_h_file_header(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i64 64, i64 1, i32* %0)
ret void
}
void GPIOPinTypeGPIOOutput(unsigned long i, unsigned long j) {}


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

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

LLVM IR (-O0):
define void @GPIOPinTypeGPIOOutput(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeGPIOOutput(i64 %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
void read_line(FILE *fr, char *line) {
  int i;
  const int MAX_LEN = 100;
  char c_int;
  i = 0;
  while ((c_int = getc(fr)) != '\n') {
    line[i] = c_int;
    if (i < MAX_LEN) {
      ++i;
    }
  }
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %al,-0x19(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     116c <read_line+0x5c>
mov    -0x19(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
cmpl   $0x64,-0x14(%rbp)
jge    1167 <read_line+0x57>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <read_line+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <getc@plt>
cmp    $0xa,%al
je     1148 <read_line+0x38>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%ecx
mov    %al,(%r14,%rcx,1)
cmp    $0x64,%ebp
adc    $0x0,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%al
jne    1130 <read_line+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @read_line(i32* nocapture %0, i8* nocapture writeonly %1) {
%3 = tail call signext i8 @getc(i32* %0)
%4 = icmp eq i8 %3, 10
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 %6, i8* %9
%10 = icmp ult i32 %7, 100
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = tail call signext i8 @getc(i32* %0)
%14 = icmp eq i8 %13, 10
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mount(char const *, int /*<<< orphan*/);
void mount_command(const char *dev) { mount(dev, 0); }


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

x86 assembly (clang, -O2):
<mount_command>:
xor    %esi,%esi
jmp    1030 <mount@plt>

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

LLVM IR (-O2):
define void @mount_command(i8* %0) {
%2 = tail call i32 @mount(i8* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void reset_state(unsigned char hash_counter[4096]) {
  memset(hash_counter, 0, 4096);
}


x86 assembly (clang, -O0):
<reset_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_state>:
xor    %esi,%esi
mov    $0x1000,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @reset_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memset(i8* %3, i32 0, i32 4096)
ret void
}

LLVM IR (-O2):
define void @reset_state(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 4096)
ret void
}