xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int height_inc;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_height_inc(void *_p, int _v) {
  ((XSizeHints *)_p)->height_inc = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XSizeHints_height_inc>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XSizeHints_height_inc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XSizeHints_height_inc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void dj_set_auto_mix(char flag) {}


x86 assembly (clang, -O0):
<dj_set_auto_mix>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dj_set_auto_mix(i8 signext %0) {
ret void
}
/* Variables and functions */
scalar_t__ COND_VC();
int /*<<< orphan*/ EA_AY_DI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_svc_8_di(void) {
  m68ki_write_8(EA_AY_DI_8(), COND_VC() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_svc_8_di>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_DI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_VC@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_svc_8_di>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_DI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_VC@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_svc_8_di() {
%1 = call i32 (...) @EA_AY_DI_8()
%2 = call i64 (...) @COND_VC()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_svc_8_di() {
%1 = tail call i32 (...) @EA_AY_DI_8()
%2 = tail call i64 (...) @COND_VC()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void rtcp_xr_set_bt(uint8_t *p_rtcp_xr_b, uint8_t bt) { p_rtcp_xr_b[0] = bt; }


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

x86 assembly (clang, -O2):
<rtcp_xr_set_bt>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @rtcp_xr_set_bt(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @rtcp_xr_set_bt(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
void timeR_name_bin_anonfunc(unsigned int bin_id, const char *file,
                             unsigned int line, unsigned int pos) {}


x86 assembly (clang, -O0):
<timeR_name_bin_anonfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @timeR_name_bin_anonfunc(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @timeR_name_bin_anonfunc(i32 %0, i8* nocapture %1, i32 %2, i32 %3) {
ret void
}
void f(void) {
  "foo"[0] = 0;
  "foo"[0]++;
  "foo"[0]--;
  ++"foo"[0];
  --"foo"[0];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,0xef5(%rip)
mov    0xeef(%rip),%al
add    $0x1,%al
mov    %al,0xee7(%rip)
mov    0xee1(%rip),%al
add    $0xff,%al
mov    %al,0xed9(%rip)
mov    0xed3(%rip),%al
add    $0x1,%al
mov    %al,0xecb(%rip)
mov    0xec5(%rip),%al
add    $0xff,%al
mov    %al,0xebd(%rip)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define void @f() {
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%1 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%2 = add i8 %1, 1
store i8 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%3 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%4 = add i8 %3, -1
store i8 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%5 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%6 = add i8 %5, 1
store i8 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%7 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%8 = add i8 %7, -1
store i8 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
void split_nr(char parts[], char nr_to_split) {
  int dig = 2;
  while (dig--) {
    parts[dig] = nr_to_split % 10;
    nr_to_split /= 10;
  }
}


x86 assembly (clang, -O0):
<split_nr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1154 <split_nr+0x54>
movsbl -0x9(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x9(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %al,-0x9(%rbp)
jmp    1115 <split_nr+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_nr>:
imul   $0x67,%esi,%eax
movzwl %ax,%ecx
shr    $0xa,%eax
shr    $0xf,%ecx
add    %al,%cl
movzbl %cl,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%sil
mov    %sil,0x1(%rdi)
movsbl %al,%ecx
imul   $0x67,%ecx,%ecx
movzwl %cx,%edx
shr    $0xa,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @split_nr(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 2, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = add nsw i32 %7, -1
store i32 %8, i32* %5
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = srem i32 %12, 10
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%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 i8, i8* %4
%20 = sext i8 %19 to i32
%21 = sdiv i32 %20, 10
%22 = trunc i32 %21 to i8
store i8 %22, i8* %4
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @split_nr(i8* nocapture writeonly %0, i8 signext %1) {
%3 = srem i8 %1, 10
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %4
%5 = sdiv i8 %1, 10
%6 = srem i8 %5, 10
store i8 %6, i8* %0
ret void
}
void crc32init(unsigned long *crcvar) {
  if (!crcvar)
    return;
  *crcvar = 0xffffffffl;
}


x86 assembly (clang, -O0):
<crc32init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <crc32init+0x18>
jmp    1124 <crc32init+0x24>
mov    -0x8(%rbp),%rax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32init>:
test   %rdi,%rdi
je     110d <crc32init+0xd>
mov    $0xffffffff,%eax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @crc32init(i64* writeonly %0) {
%2 = icmp eq i64* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i64 4294967295, i64* %0
br label %4
4: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t isNumber(char c) { return c >= '0' && c <= '9'; }


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

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

LLVM IR (-O0):
define i32 @isNumber(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 label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isNumber(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
const char *_nl_language_preferences_default(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @_nl_language_preferences_default() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_nl_language_preferences_default() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
void error(char *why) {
  Printf("%s errno=%d\n", why, errno);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
lea    0xec0(%rip),%rdi
call   1030 <Printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
lea    0xecc(%rip),%rdi
call   1030 <Printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s errno=%d\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @Printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s errno=%d\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @Printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t heap_allocated();
size_t talloc_allocated() { return heap_allocated(); }


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

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

LLVM IR (-O0):
define i64 @talloc_allocated() {
%1 = call i64 (...) @heap_allocated()
ret i64 %1
}

LLVM IR (-O2):
define i64 @talloc_allocated() {
%1 = tail call i64 (...) @heap_allocated()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getgroups(int, int /*<<< orphan*/ *);
void test(void) {
  gid_t grouplist[20];
  int gidsetsize;
  int result;
  gidsetsize = 20;
  result = getgroups(gidsetsize, grouplist);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x14,-0x54(%rbp)
mov    -0x54(%rbp),%edi
lea    -0x50(%rbp),%rsi
call   1030 <getgroups@plt>
mov    %eax,-0x58(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x58,%rsp
mov    %rsp,%rsi
mov    $0x14,%edi
call   1030 <getgroups@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca [20 x i32]
%2 = alloca i32
%3 = alloca i32
store i32 20, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%6 = call i32 @getgroups(i32 %4, i32* %5)
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @getgroups(i32 20, i32* %3)
ret void
}
/* Variables and functions */
double exp(double);
double pow(double, double);
double myfunc(double y) {
  if (y >= 0.0) {
    return pow(y, 5.0) * exp(-y);
  } else {
    return 0.0;
  }
}


x86 assembly (clang, -O0):
<myfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     118d <myfunc+0x6d>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1195 <myfunc+0x75>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfunc>:
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     116c <myfunc+0x4c>
sub    $0x28,%rsp
movsd  0xec6(%rip),%xmm1
movapd %xmm2,%xmm0
movapd %xmm2,0x10(%rsp)
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
xorpd  0xeb3(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @myfunc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @pow(double %7, double 5.000000e+00)
%9 = load double, double* %3
%10 = fneg double %9
%11 = call double @exp(double %10)
%12 = fmul double %8, %11
store double %12, double* %2
br label %14
13: ; preds = %1
store double 0.000000e+00, double* %2
br label %14
14: ; preds = %13, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @myfunc(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call double @pow(double %0, double 5.000000e+00)
%5 = fneg double %0
%6 = tail call double @exp(double %5)
%7 = fmul double %4, %6
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ 0.000000e+00, %1 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *new (size_t size) {
  void *result = malloc(size);
  if (result == NULL)
    fatal("\rOut of memory");
  return result;
}


x86 assembly (clang, -O0):
<new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <new+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <new+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0DOut of memory\00"
define i8* @new(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 eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0DOut of memory\00"
define noalias i8* @new(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M587_f(char *s) {
  debug("M587_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M587_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M587_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M587_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M587_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M587_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M587_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msim_printSouthWallEmpty() { printf("   "); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
define void @msim_printSouthWallEmpty() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
int t() {
  int y = 0;
  int x = 1;
  int z = 0;
  for (int x = 0; x < 10; x++) {
    int x = 9;
    if (x == 9)
      return x / y;
    else
      return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1156 <t+0x56>
movl   $0x9,-0x18(%rbp)
cmpl   $0x9,-0x18(%rbp)
jne    114a <t+0x4a>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    115d <t+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    115d <t+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @t() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %2
store i32 1, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %18, %0
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %21
10: ; preds = %7
store i32 9, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 9
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %6
%15 = load i32, i32* %2
%16 = sdiv i32 %14, %15
store i32 %16, i32* %1
br label %22
17: ; preds = %10
store i32 0, i32* %1
br label %22
18: ; No predecessors!
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %7
21: ; preds = %7
store i32 0, i32* %1
br label %22
22: ; preds = %21, %17, %13
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @t() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x_root;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
void set_XPointerMovedEvent_x_root(void *_p, int _v) {
  ((XPointerMovedEvent *)_p)->x_root = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XPointerMovedEvent_x_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XPointerMovedEvent_x_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XPointerMovedEvent_x_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(char *, size_t);
scalar_t__ malloc(int);
char *ft_strnew(size_t size) {
  char *str;
  str = (char *)malloc(sizeof(char) * (size + 1));
  if (!str)
    return (NULL);
  ft_bzero(str, size + 1);
  return (str);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115b <ft_strnew+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1174 <ft_strnew+0x54>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %ebx,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1147 <ft_strnew+0x27>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <ft_bzero@plt>
jmp    114a <ft_strnew+0x2a>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strnew(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add i64 %5, 1
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %1
store i8* null, i8** %2
br label %20
14: ; preds = %1
%15 = load i8*, i8** %4
%16 = load i64, i64* %3
%17 = add i64 %16, 1
%18 = call i32 @ft_bzero(i8* %15, i64 %17)
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %14, %13
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = trunc i64 %2 to i32
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @ft_bzero(i8* %5, i64 %2)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int k = __VERIFIER_nondet_int();
  int a[1048];
  if (k >= 0 && k < 1048) {
    if (a[0] == 23 && a[k] == 42) {
      int x = __VERIFIER_nondet_int();
      while (x >= 0) {
        x = x - k;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1080,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     119a <main+0x8a>
cmpl   $0x418,-0x8(%rbp)
jge    119a <main+0x8a>
cmpl   $0x17,-0x1070(%rbp)
jne    1195 <main+0x85>
movslq -0x8(%rbp),%rax
cmpl   $0x2a,-0x1070(%rbp,%rax,4)
2a
jne    1195 <main+0x85>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x1074(%rbp)
cmpl   $0x0,-0x1074(%rbp)
jl     1190 <main+0x80>
mov    -0x1074(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x1074(%rbp)
jmp    116f <main+0x5f>
jmp    1195 <main+0x85>
jmp    119a <main+0x8a>
xor    %eax,%eax
add    $0x1080,%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 [1048 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %32
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 1048
br i1 %10, label %11, label %32
11: ; preds = %8
%12 = getelementptr inbounds [1048 x i32], [1048 x i32]* %3, i64 0, i64 0
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 23
br i1 %14, label %15, label %31
15: ; preds = %11
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [1048 x i32], [1048 x i32]* %3, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 42
br i1 %20, label %21, label %31
21: ; preds = %15
%22 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %22, i32* %4
br label %23
23: ; preds = %26, %21
%24 = load i32, i32* %4
%25 = icmp sge i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = load i32, i32* %4
%28 = load i32, i32* %2
%29 = sub nsw i32 %27, %28
store i32 %29, i32* %4
br label %23
30: ; preds = %23
br label %31
31: ; preds = %30, %15, %11
br label %32
32: ; preds = %31, %8, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ service_fona_hang_up();
int /*<<< orphan*/ stop_this_activity();
void refuse_guide_call_menu_item_selection_handler_in_main_loop() {
  service_fona_hang_up();
  stop_this_activity();
}


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

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

LLVM IR (-O0):
define void @refuse_guide_call_menu_item_selection_handler_in_main_loop() {
%1 = call i32 (...) @service_fona_hang_up()
%2 = call i32 (...) @stop_this_activity()
ret void
}

LLVM IR (-O2):
define void @refuse_guide_call_menu_item_selection_handler_in_main_loop() {
%1 = tail call i32 (...) @service_fona_hang_up()
%2 = tail call i32 (...) @stop_this_activity()
ret void
}
/* Variables and functions */
int call_cpp_add_double(double, double);
int call_cpp_add_int(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("2 + 4 = %d\n", call_cpp_add_int(2, 4));
  printf("2.1 + 4.5 = %lf\n", call_cpp_add_double(2.1, 4.5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x4,%esi
call   1050 <call_cpp_add_int@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe9c(%rip),%xmm0
movsd  0xe9c(%rip),%xmm1
call   1030 <call_cpp_add_double@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x4,%esi
call   1050 <call_cpp_add_int@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movsd  0xeaa(%rip),%xmm0
movsd  0xeaa(%rip),%xmm1
call   1030 <call_cpp_add_double@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"2 + 4 = %d\0A\00"
@.str.1 = [17 x i8] c"2.1 + 4.5 = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @call_cpp_add_int(i32 2, i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @call_cpp_add_double(double 2.100000e+00, double 4.500000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"2 + 4 = %d\0A\00"
@.str.1 = [17 x i8] c"2.1 + 4.5 = %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @call_cpp_add_int(i32 2, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @call_cpp_add_double(double 2.100000e+00, double 4.500000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
unsigned char *calloc(int, int);
int /*<<< orphan*/ sscanf(char *, char *, unsigned char *, unsigned char *,
                          unsigned char *, unsigned char *);
unsigned char *parse_ip_addr(char *ip_str) {
  unsigned char *bytes = calloc(4, sizeof(unsigned char));
  sscanf(ip_str, "%hhd.%hhd.%hhd.%hhd", bytes, bytes + 1, bytes + 2, bytes + 3);
  return bytes;
}


x86 assembly (clang, -O0):
<parse_ip_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%r8
add    $0x2,%r8
mov    -0x10(%rbp),%r9
add    $0x3,%r9
lea    0xe9a(%rip),%rsi
call   1040 <sscanf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_ip_addr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
lea    0x1(%rax),%rcx
lea    0x2(%rax),%r8
lea    0x3(%rax),%r9
lea    0xeb4(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
call   1040 <sscanf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%hhd.%hhd.%hhd.%hhd\00"
define i8* @parse_ip_addr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @calloc(i32 4, i32 1)
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 3
%13 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8, i8* %10, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [20 x i8] c"%hhd.%hhd.%hhd.%hhd\00"
define i8* @parse_ip_addr(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(4) i8* @calloc(i32 4, i32 1)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = getelementptr inbounds i8, i8* %2, i64 2
%5 = getelementptr inbounds i8, i8* %2, i64 3
%6 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %4, i8* %5)
ret i8* %2
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
struct timespec tsFromMicrosec(unsigned long long microseconds) {
  struct timespec retval;
  retval.tv_sec = (int)(microseconds / 1000000);
  retval.tv_nsec = (int)(microseconds % 1000000) * 1000;
  return retval;
}


x86 assembly (clang, -O0):
<tsFromMicrosec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsFromMicrosec>:
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
mul    %rcx
shr    $0x12,%rdx
imul   $0xf4240,%rdx,%rax
sub    %rax,%rdi
movabs $0x3e800000000,%rcx
imul   %rdi,%rcx
mov    %edx,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @tsFromMicrosec(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = udiv i64 %4, 1000000
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i64, i64* %3
%9 = urem i64 %8, 1000000
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, 1000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 %11, i32* %12
%13 = bitcast %struct.timespec* %2 to i64*
%14 = load i64, i64* %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @tsFromMicrosec(i64 %0) {
%2 = udiv i64 %0, 1000000
%3 = urem i64 %0, 1000000
%4 = mul nuw nsw i64 %3, 4294967296000
%5 = and i64 %2, 4294967295
%6 = or i64 %4, %5
ret i64 %6
}
void ble_rsp_system_aes_decrypt(
    const struct ble_msg_system_aes_decrypt_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_aes_decrypt_rsp_t = type opaque
define void @ble_rsp_system_aes_decrypt(%struct.ble_msg_system_aes_decrypt_rsp_t* nocapture %0) {
ret void
}
unsigned long int cast_char_ulong(char x) { return (unsigned long int)x; }


x86 assembly (clang, -O0):
<cast_char_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_char_ulong>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @cast_char_ulong(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_char_ulong(i8 signext %0) {
%2 = sext i8 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int error(char *msg) {
  perror(msg);
  return 1;
}


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

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret i32 1
}
void kill_litter_super(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<kill_litter_super>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_litter_super>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.kill_litter_super = [18 x i8] c"kill_litter_super\00"
define void @kill_litter_super() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.kill_litter_super, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.kill_litter_super = [18 x i8] c"kill_litter_super\00"
define void @kill_litter_super() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.kill_litter_super, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Edge {
  int dummy;
};

/* Variables and functions */
struct Edge *edge_oNext(struct Edge *);
struct Edge *edge_sym(struct Edge *);
struct Edge *edge_dNext(struct Edge *edge) {
  return edge_sym(edge_oNext(edge_sym(edge)));
}


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

x86 assembly (clang, -O2):
<edge_dNext>:
push   %rax
call   1040 <edge_sym@plt>
mov    %rax,%rdi
call   1030 <edge_oNext@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <edge_sym@plt>

LLVM IR (-O0):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_dNext(%struct.Edge* %0) {
%2 = alloca %struct.Edge*
store %struct.Edge* %0, %struct.Edge** %2
%3 = load %struct.Edge*, %struct.Edge** %2
%4 = call %struct.Edge* @edge_sym(%struct.Edge* %3)
%5 = call %struct.Edge* @edge_oNext(%struct.Edge* %4)
%6 = call %struct.Edge* @edge_sym(%struct.Edge* %5)
ret %struct.Edge* %6
}

LLVM IR (-O2):
%struct.Edge = type { i32 }
define %struct.Edge* @edge_dNext(%struct.Edge* %0) {
%2 = tail call %struct.Edge* @edge_sym(%struct.Edge* %0)
%3 = tail call %struct.Edge* @edge_oNext(%struct.Edge* %2)
%4 = tail call %struct.Edge* @edge_sym(%struct.Edge* %3)
ret %struct.Edge* %4
}
/* Variables and functions */
int chama(int *);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int idade;
  int idade2;
  idade2 = chama(&idade);
  printf("%d, %d \n", idade, idade2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <chama@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <chama@plt>
mov    0x4(%rsp),%esi
lea    0xeca(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d, %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @chama(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %3)
ret i32 0
}
/* Variables and functions */
double const HUGE_VAL;
bool stdlib_base_is_infinite(const double x) {
  return (x == HUGE_VAL || x == -HUGE_VAL);
}


x86 assembly (clang, -O0):
<stdlib_base_is_infinite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
mov    0x2ed1(%rip),%rcx
ucomisd (%rcx),%xmm0
mov    %al,-0x9(%rbp)
jne    112f <stdlib_base_is_infinite+0x2f>
jp     112f <stdlib_base_is_infinite+0x2f>
jmp    1165 <stdlib_base_is_infinite+0x65>
movsd  -0x8(%rbp),%xmm0
mov    0x2ead(%rip),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_is_infinite>:
xorpd  %xmm1,%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
@HUGE_VAL = constant double 0.000000e+00
define i32 @stdlib_base_is_infinite(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @HUGE_VAL
%5 = fcmp oeq double %3, %4
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load double, double* %2
%8 = load double, double* @HUGE_VAL
%9 = fneg double %8
%10 = fcmp oeq double %7, %9
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@HUGE_VAL = constant double 0.000000e+00
define i32 @stdlib_base_is_infinite(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int bl_uart_read_reg(int);
int /*<<< orphan*/ bl_uart_write_reg(int, int);
void bl_uart_put_byte(uint8_t data) {
  volatile uint16_t lsr;
  while (1) {
    lsr = bl_uart_read_reg((0xa00f0000 + 0x14));
    if (lsr & 0x0020) {
      bl_uart_write_reg((0xa00f0000 + 0x0), (uint16_t)data);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<bl_uart_put_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa00f0014,%edi
call   1030 <bl_uart_read_reg@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     115d <bl_uart_put_byte+0x3d>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    $0xa00f0000,%edi
call   1040 <bl_uart_write_reg@plt>
jmp    1162 <bl_uart_put_byte+0x42>
jmp    112c <bl_uart_put_byte+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bl_uart_put_byte>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    $0xa00f0014,%edi
call   1030 <bl_uart_read_reg@plt>
mov    %eax,0xc(%rsp)
testl  $0x20,0xc(%rsp)
je     1130 <bl_uart_put_byte+0x10>
mov    $0xa00f0000,%edi
mov    %ebx,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <bl_uart_write_reg@plt>

LLVM IR (-O0):
define void @bl_uart_put_byte(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
br label %4
4: ; preds = %1, %13
%5 = call i32 @bl_uart_read_reg(i32 -1609629676)
store volatile i32 %5, i32* %3
%6 = load volatile i32, i32* %3
%7 = and i32 %6, 32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i64, i64* %2
%11 = trunc i64 %10 to i32
%12 = call i32 @bl_uart_write_reg(i32 -1609629696, i32 %11)
br label %14
13: ; preds = %4
br label %4
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @bl_uart_put_byte(i64 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @bl_uart_read_reg(i32 -1609629676)
store volatile i32 %5, i32* %2
%6 = load volatile i32, i32* %2
%7 = and i32 %6, 32
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4
%10 = trunc i64 %0 to i32
%11 = tail call i32 @bl_uart_write_reg(i32 -1609629696, i32 %10)
ret void
}
void ab8500_regulator_debug_restore(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ab8500_regulator_debug_restore() {
ret void
}
void cont() {
  asm volatile("popq %%rax\n\t"
               "pushq (%%rax)\n\t" ::
                   :);
}


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

x86 assembly (clang, -O2):
<cont>:
pop    %rax
push   (%rax)
ret

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

LLVM IR (-O2):
define void @cont() {
tail call void asm sideeffect "popq %rax\0A\09pushq (%rax)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i, sum, upToVal;
  upToVal = 10000;
  sum = 0;
  for (i = 1; i <= upToVal; i++) {
    sum = sum + i;
  }
  printf("\nSum is %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2710,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     115e <main+0x4e>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <main+0x2b>
mov    -0x18(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"\0ASum is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 50005000)
ret i32 0
}
int f91(int x) {
  if (x <= 100)
    return f91(f91(x + 11));
  else
    return x - 10;
}


x86 assembly (clang, -O0):
<f91>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     113f <f91+0x2f>
mov    -0x8(%rbp),%edi
add    $0xb,%edi
call   1030 <f91@plt>
mov    %eax,%edi
call   1030 <f91@plt>
mov    %eax,-0x4(%rbp)
jmp    1148 <f91+0x38>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f91>:
push   %rax
mov    %edi,%eax
cmp    $0x64,%edi
jg     112f <f91+0x1f>
nopl   0x0(%rax,%rax,1)
add    $0xb,%eax
mov    %eax,%edi
call   1030 <f91@plt>
cmp    $0x65,%eax
jb     1120 <f91+0x10>
add    $0xfffffff6,%eax
pop    %rcx
ret

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

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