xunge/DecIR huggingface dataset:
void matsu_a(int ii) {
  printf("%s -- start\n", __func__);
  printf("%s -- exit\n", __func__);
  return;
}


x86 assembly (clang, -O0):
<matsu_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.matsu_a = [8 x i8] c"matsu_a\00"
@.str.1 = [12 x i8] c"%s -- exit\0A\00"
define void @matsu_a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_a, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_a, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.matsu_a = [8 x i8] c"matsu_a\00"
@.str.1 = [12 x i8] c"%s -- exit\0A\00"
define void @matsu_a(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_a, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.matsu_a, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_del(void *, int);
void event_del_once(void *data) { event_del(data, 1); }


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

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

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

LLVM IR (-O2):
define void @event_del_once(i8* %0) {
%2 = tail call i32 @event_del(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nl();
int /*<<< orphan*/ outstr(char *);
void trailer(void) {
  nl();
  outstr("; --- End of Compilation ---\n");
}


x86 assembly (clang, -O0):
<trailer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nl@plt>
lea    0xece(%rip),%rdi
call   1040 <outstr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailer>:
push   %rax
xor    %eax,%eax
call   1030 <nl@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <outstr@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"; --- End of Compilation ---\0A\00"
define void @trailer() {
%1 = call i32 (...) @nl()
%2 = call i32 @outstr(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"; --- End of Compilation ---\0A\00"
define void @trailer() {
%1 = tail call i32 (...) @nl()
%2 = tail call i32 @outstr(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ boo(int /*<<< orphan*/, int);
int /*<<< orphan*/ doo(int);
int foo(int /*<<< orphan*/, int);
int main() {
  int x = 2;
  int y = 3;
  int z = 4;
  return foo(boo(doo(x), y), z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <doo@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1050 <boo@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%esi
call   1040 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <doo@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1050 <boo@plt>
mov    %eax,%edi
mov    $0x4,%esi
pop    %rax
jmp    1040 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @doo(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @boo(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @foo(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @doo(i32 2)
%2 = tail call i32 @boo(i32 %1, i32 3)
%3 = tail call i32 @foo(i32 %2, i32 4)
ret i32 %3
}
void v3s(vec) short vec[3];
{
  float v[3];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  vcall(v, 3);
}


x86 assembly (clang, -O0):
<v3s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x2(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x4(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3s>:
sub    $0x18,%rsp
movswl (%rdi),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
movswl 0x2(%rdi),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x10(%rsp)
movswl 0x4(%rdi),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x14(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v3s(i16* %0) {
%2 = alloca i16*
%3 = alloca [3 x float]
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i64 0
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load i16*, i16** %2
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = sitofp i16 %11 to float
%13 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load i16*, i16** %2
%15 = getelementptr inbounds i16, i16* %14, i64 2
%16 = load i16, i16* %15
%17 = sitofp i16 %16 to float
%18 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%20 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %19, i32 3)
ret void
}

LLVM IR (-O2):
define void @v3s(i16* nocapture %0) {
%2 = alloca [3 x float]
%3 = bitcast [3 x float]* %2 to i8*
%4 = load i16, i16* %0
%5 = sitofp i16 %4 to float
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
store float %5, float* %6
%7 = getelementptr inbounds i16, i16* %0, i64 1
%8 = load i16, i16* %7
%9 = sitofp i16 %8 to float
%10 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
store float %9, float* %10
%11 = getelementptr inbounds i16, i16* %0, i64 2
%12 = load i16, i16* %11
%13 = sitofp i16 %12 to float
%14 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
store float %13, float* %14
%15 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %6, i32 3)
ret void
}
/* Type definitions */
struct tex_parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ tex_input_buf(struct tex_parser *, char *, char *,
                                 int /*<<< orphan*/);
void tex_input_str(struct tex_parser *p, char *name, char *input) {
  tex_input_buf(p, name, input, strlen(input));
}


x86 assembly (clang, -O0):
<tex_input_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <tex_input_buf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tex_input_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <tex_input_buf@plt>

LLVM IR (-O0):
%struct.tex_parser = type { i32 }
define void @tex_input_str(%struct.tex_parser* %0, i8* %1, i8* %2) {
%4 = alloca %struct.tex_parser*
%5 = alloca i8*
%6 = alloca i8*
store %struct.tex_parser* %0, %struct.tex_parser** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.tex_parser*, %struct.tex_parser** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @tex_input_buf(%struct.tex_parser* %7, i8* %8, i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.tex_parser = type { i32 }
define void @tex_input_str(%struct.tex_parser* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @tex_input_buf(%struct.tex_parser* %0, i8* %1, i8* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetCurrentPosition(long *);
void yyGetPos(long *r_result) { GetCurrentPosition(r_result); }


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

x86 assembly (clang, -O2):
<yyGetPos>:
jmp    1030 <GetCurrentPosition@plt>

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

LLVM IR (-O2):
define void @yyGetPos(i64* %0) {
%2 = tail call i32 @GetCurrentPosition(i64* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void pluscconlylb(unsigned long a, unsigned long b) {
  unsigned long sum = a + b;
  if (sum < b)
    abort();
}


x86 assembly (clang, -O0):
<pluscconlylb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1141 <pluscconlylb+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluscconlylb>:
add    %rsi,%rdi
jb     1116 <pluscconlylb+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @pluscconlylb(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @pluscconlylb(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = icmp ult i64 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
/* Type definitions */
struct wiphy {
  int dummy;
};
struct brcmf_cfg80211_priv {
  int dummy;
};

/* Variables and functions */
scalar_t__ wiphy_priv(struct wiphy *);
struct brcmf_cfg80211_priv *wiphy_to_cfg(struct wiphy *w) {
  return (struct brcmf_cfg80211_priv *)(wiphy_priv(w));
}


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

x86 assembly (clang, -O2):
<wiphy_to_cfg>:
jmp    1030 <wiphy_priv@plt>

LLVM IR (-O0):
%struct.brcmf_cfg80211_priv = type { i32 }
%struct.wiphy = type { i32 }
define %struct.brcmf_cfg80211_priv* @wiphy_to_cfg(%struct.wiphy* %0) {
%2 = alloca %struct.wiphy*
store %struct.wiphy* %0, %struct.wiphy** %2
%3 = load %struct.wiphy*, %struct.wiphy** %2
%4 = call i64 @wiphy_priv(%struct.wiphy* %3)
%5 = inttoptr i64 %4 to %struct.brcmf_cfg80211_priv*
ret %struct.brcmf_cfg80211_priv* %5
}

LLVM IR (-O2):
%struct.brcmf_cfg80211_priv = type { i32 }
%struct.wiphy = type { i32 }
define %struct.brcmf_cfg80211_priv* @wiphy_to_cfg(%struct.wiphy* %0) {
%2 = tail call i64 @wiphy_priv(%struct.wiphy* %0)
%3 = inttoptr i64 %2 to %struct.brcmf_cfg80211_priv*
ret %struct.brcmf_cfg80211_priv* %3
}
/* Type definitions */
struct ft_cxt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ft_prop(struct ft_cxt *, char const *, char const *,
                           scalar_t__);
scalar_t__ strlen(char const *);
void ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str) {
  ft_prop(cxt, name, str, strlen(str) + 1);
}


x86 assembly (clang, -O0):
<ft_prop_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
add    $0x1,%rcx
call   1040 <ft_prop@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_prop_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <ft_prop@plt>

LLVM IR (-O0):
%struct.ft_cxt = type { i32 }
define void @ft_prop_str(%struct.ft_cxt* %0, i8* %1, i8* %2) {
%4 = alloca %struct.ft_cxt*
%5 = alloca i8*
%6 = alloca i8*
store %struct.ft_cxt* %0, %struct.ft_cxt** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.ft_cxt*, %struct.ft_cxt** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @ft_prop(%struct.ft_cxt* %7, i8* %8, i8* %9, i64 %12)
ret void
}

LLVM IR (-O2):
%struct.ft_cxt = type { i32 }
define void @ft_prop_str(%struct.ft_cxt* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @ft_prop(%struct.ft_cxt* %0, i8* %1, i8* %2, i64 %5)
ret void
}
long long zzus() { return 0x000000007fffffffLL; }


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

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

LLVM IR (-O0):
define i64 @zzus() {
ret i64 2147483647
}

LLVM IR (-O2):
define i64 @zzus() {
ret i64 2147483647
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ mg_get_key(char *);
int msgget(int /*<<< orphan*/, int);
int mg_open(char *path) {
  int qid;
  key_t key = mg_get_key(path);
  qid = msgget(key, IPC_CREAT | 0666);
  assert(qid > -1);
  return qid;
}


x86 assembly (clang, -O0):
<mg_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mg_get_key@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
or     $0x1b6,%esi
call   1030 <msgget@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_open>:
push   %rbx
call   1050 <mg_get_key@plt>
mov    0x2ea3(%rip),%rcx
mov    $0x1b6,%esi
or     (%rcx),%esi
mov    %eax,%edi
call   1030 <msgget@plt>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @mg_open(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @mg_get_key(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* @IPC_CREAT
%9 = or i32 %8, 438
%10 = call i32 @msgget(i32 %7, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, -1
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @mg_open(i8* %0) {
%2 = tail call i32 @mg_get_key(i8* %0)
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 438
%5 = tail call i32 @msgget(i32 %2, i32 %4)
%6 = xor i32 %5, -1
%7 = lshr i32 %6, 31
%8 = tail call i32 @assert(i32 %7)
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rol(uint64_t x, int s) { return (x << s) | (x >> (64 - s)); }


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int workman(char layout[][96], int i) {
  strncpy(layout[i],
          " 1234567890-=qdrwbjfup;[]\\ashtgyneoi'zxmcvkl,./"
          "!@#$%^&*()_+QDRWBJFUP:{}\ASHTGYNEOI\"ZXMCVKL<>?",
          96);
  return 85;
}


x86 assembly (clang, -O0):
<workman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
imul   $0x60,%rax,%rax
add    %rax,%rdi
lea    0xecb(%rip),%rsi
mov    $0x60,%edx
call   1030 <strncpy@plt>
mov    $0x55,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workman>:
push   %rax
movslq %esi,%rax
lea    (%rax,%rax,2),%rax
shl    $0x5,%rax
add    %rax,%rdi
lea    0xeda(%rip),%rsi
mov    $0x60,%edx
call   1030 <strncpy@plt>
mov    $0x55,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [93 x i8] c" 1234567890-=qdrwbjfup;[]\\ashtgyneoi'zxmcvkl,./!@#$%^&*()_+QDRWBJFUP:{}ASHTGYNEOI\22ZXMCVKL<>?\00"
define i32 @workman([96 x i8]* %0, i32 %1) {
%3 = alloca [96 x i8]*
%4 = alloca i32
store [96 x i8]* %0, [96 x i8]** %3
store i32 %1, i32* %4
%5 = load [96 x i8]*, [96 x i8]** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [96 x i8], [96 x i8]* %5, i64 %7
%9 = getelementptr inbounds [96 x i8], [96 x i8]* %8, i64 0, i64 0
%10 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i32 96)
ret i32 85
}

LLVM IR (-O2):
@.str = [93 x i8] c" 1234567890-=qdrwbjfup;[]\\ashtgyneoi'zxmcvkl,./!@#$%^&*()_+QDRWBJFUP:{}ASHTGYNEOI\22ZXMCVKL<>?\00"
define i32 @workman([96 x i8]* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [96 x i8], [96 x i8]* %0, i64 %3, i64 0
%5 = tail call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i32 96)
ret i32 85
}
int pop(int a[], int *top) {
  int t = a[*top];
  (*top)--;
  return t;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
movslq (%rsi),%rcx
mov    (%rdi,%rcx,4),%eax
add    $0xffffffff,%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define i32 @pop(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %6, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %5
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = add nsw i32 %13, -1
store i32 %14, i32* %12
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @pop(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = add nsw i32 %3, -1
store i32 %7, i32* %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  while (1) {
    printf("hello world\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %1
}
double cilk_ticks_to_seconds(unsigned long long ticks) {
  return ticks * 1.0e-6;
}


x86 assembly (clang, -O0):
<cilk_ticks_to_seconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movaps 0xf01(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xf00(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cilk_ticks_to_seconds>:
movq   %rdi,%xmm1
punpckldq 0xef3(%rip),%xmm1
subpd  0xefb(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xef7(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @cilk_ticks_to_seconds(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fmul double %2, 0x3EB0C6F7A0B5ED8D
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ int_test();
int /*<<< orphan*/ struct_test();
int main() {
  int_test();
  struct_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @int_test()
%2 = tail call i32 (...) @struct_test()
ret i32 0
}
int cairo_code_draw_envAttackLabel_get_width() { return 7; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envAttackLabel_get_width() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envAttackLabel_get_width() {
ret i32 7
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;

/* Variables and functions */
int ENOSYS;
int posix_spawnattr_getschedpolicy(const posix_spawnattr_t *restrict attr,
                                   int *restrict policy) {
  return ENOSYS;
}


x86 assembly (clang, -O0):
<posix_spawnattr_getschedpolicy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnattr_getschedpolicy>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @posix_spawnattr_getschedpolicy(i32* noalias %0, i32* noalias %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @ENOSYS
ret i32 %5
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @posix_spawnattr_getschedpolicy(i32* noalias nocapture readnone %0, i32* noalias nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
ret i32 %3
}
void rop3_136_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D & S;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_136_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_136_0_0>:
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_136_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
store i8 %5, i8* %0
ret void
}
int gca_cmp_ptr(const void *aa, const void *bb) {
  const void *const a = *(const void *const *)aa;
  const void *const b = *(const void *const *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
cmp    -0x18(%rbp),%rcx
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp_ptr>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = icmp ugt i8* %13, %14
%16 = zext i1 %15 to i32
%17 = load i8*, i8** %6
%18 = load i8*, i8** %5
%19 = icmp ugt i8* %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_cmp_ptr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = icmp ugt i8* %4, %6
%8 = zext i1 %7 to i32
%9 = icmp ugt i8* %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int main() {
  int k = (3) + (3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_menu() {
  printf("-- Menu ----------------------\n"
         "1. Make coolguy\n"
         "2. Make a_person\n"
         "3. Delete coolguy\n"
         "4. Delete a_person\n"
         "5. Print coolguy message\n"
         "6. Print person info\n"
         "7. Quit\n"
         "Enter Choice: ");
}


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

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

LLVM IR (-O0):
@.str = [170 x i8] c"-- Menu ----------------------\0A1. Make coolguy\0A2. Make a_person\0A3. Delete coolguy\0A4. Delete a_person\0A5. Print coolguy message\0A6. Print person info\0A7. Quit\0AEnter Choice: \00"
define void @print_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [170 x i8] c"-- Menu ----------------------\0A1. Make coolguy\0A2. Make a_person\0A3. Delete coolguy\0A4. Delete a_person\0A5. Print coolguy message\0A6. Print person info\0A7. Quit\0AEnter Choice: \00"
define void @print_menu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ purger();
char *strchr(char *, char);
void clean(char *chaine) {
  char *p = strchr(chaine, '\n');
  if (p) {
    *p = 0;
  } else {
    purger();
  }
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <clean+0x35>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    115c <clean+0x3c>
mov    $0x0,%al
call   1040 <purger@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1135 <clean+0x15>
movb   $0x0,(%rax)
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <purger@plt>

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

LLVM IR (-O2):
define void @clean(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @purger()
br label %7
7: ; preds = %5, %4
ret void
}
unsigned long long get_cycles(void) {
  unsigned long long low, high;
  asm volatile("rdtsc" : "=a"(low), "=d"(high));
  return (unsigned long long)(high << 32 | low);
}


x86 assembly (clang, -O0):
<get_cycles>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cycles>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @get_cycles() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = shl i64 %6, 32
%8 = load i64, i64* %1
%9 = or i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @get_cycles() {
%1 = tail call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = or i64 %4, %2
ret i64 %5
}
char mins(short a, short b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<mins>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    112e <mins+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <mins+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mins>:
mov    %esi,%eax
cmp    %ax,%di
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @mins(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 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @mins(i16 signext %0, i16 signext %1) {
%3 = icmp slt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
%5 = trunc i16 %4 to i8
ret i8 %5
}
double dsq(double x0, double y0, double x1, double y1) {
  return (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);
}


x86 assembly (clang, -O0):
<dsq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsq>:
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm3
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dsq(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = load double, double* %7
%13 = load double, double* %5
%14 = fsub double %12, %13
%15 = load double, double* %8
%16 = load double, double* %6
%17 = fsub double %15, %16
%18 = load double, double* %8
%19 = load double, double* %6
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = call double @llvm.fmuladd.f64(double %11, double %14, double %21)
ret double %22
}

LLVM IR (-O2):
define double @dsq(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = fsub double %3, %1
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
ret double %8
}
void clock_init() {
  (*((volatile unsigned long *)0xE0100200)) = 0x0;
  (*((volatile unsigned long *)0xE0100000)) = 0x0000FFFF;
  (*((volatile unsigned long *)0xE0100008)) = 0x0000FFFF;
  (*((volatile unsigned long *)0xE0100300)) = 0x14131440;
  (*((volatile unsigned long *)0xE0100100)) =
      (1 << 31 | 0x7d << 16 | 0x3 << 8 | 0x1);
  (*((volatile unsigned long *)0xE0100108)) =
      (1 << 31 | 0x29b << 16 | 0xc << 8 | 0x1);
  (*((volatile unsigned long *)0xE0100200)) = 0x10001111;
}


x86 assembly (clang, -O0):
<clock_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0100200,%eax
movq   $0x0,(%rax)
mov    $0xe0100000,%eax
movq   $0xffff,(%rax)
mov    $0xe0100008,%eax
movq   $0xffff,(%rax)
mov    $0xe0100300,%eax
movq   $0x14131440,(%rax)
mov    $0xe0100100,%eax
movq   $0xffffffff807d0301,(%rax)
mov    $0xe0100108,%eax
movq   $0xffffffff829b0c01,(%rax)
mov    $0xe0100200,%eax
movq   $0x10001111,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_init>:
mov    $0xe0100200,%eax
movq   $0x0,(%rax)
movq   $0xffff,-0x200(%rax)
movq   $0xffff,-0x1f8(%rax)
movq   $0x14131440,0x100(%rax)
40 14 13 14
movq   $0xffffffff807d0301,-0x100(%rax)
01 03 7d 80
movq   $0xffffffff829b0c01,-0xf8(%rax)
01 0c 9b 82
movq   $0x10001111,(%rax)
ret

LLVM IR (-O0):
define void @clock_init() {
store volatile i64 0, i64* inttoptr (i64 3759145472 to i64*)
store volatile i64 65535, i64* inttoptr (i64 3759144960 to i64*)
store volatile i64 65535, i64* inttoptr (i64 3759144968 to i64*)
store volatile i64 336794688, i64* inttoptr (i64 3759145728 to i64*)
store volatile i64 -2139290879, i64* inttoptr (i64 3759145216 to i64*)
store volatile i64 -2103768063, i64* inttoptr (i64 3759145224 to i64*)
store volatile i64 268439825, i64* inttoptr (i64 3759145472 to i64*)
ret void
}

LLVM IR (-O2):
define void @clock_init() {
store volatile i64 0, i64* inttoptr (i64 3759145472 to i64*)
store volatile i64 65535, i64* inttoptr (i64 3759144960 to i64*)
store volatile i64 65535, i64* inttoptr (i64 3759144968 to i64*)
store volatile i64 336794688, i64* inttoptr (i64 3759145728 to i64*)
store volatile i64 -2139290879, i64* inttoptr (i64 3759145216 to i64*)
store volatile i64 -2103768063, i64* inttoptr (i64 3759145224 to i64*)
store volatile i64 268439825, i64* inttoptr (i64 3759145472 to i64*)
ret void
}
int max_path_length() { return 260; }


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

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

LLVM IR (-O0):
define i32 @max_path_length() {
ret i32 260
}

LLVM IR (-O2):
define i32 @max_path_length() {
ret i32 260
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d\n", fib(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fib@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 = call i32 @fib(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 = call i32 @fib(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_221() {
  Assert_real((isqrt(221) == 14),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1110, ("Integer square root of 221 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_221>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdd,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x456,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_221>:
push   %rax
mov    $0xdd,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x456,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 221 should be 14\00"
define void @t_sqrt_221() {
%1 = call i32 @isqrt(i32 221)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1110, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 221 should be 14\00"
define void @t_sqrt_221() {
%1 = tail call i32 @isqrt(i32 221)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1110, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int *foo(int **a, int *b, int *c) {
  return __sync_val_compare_and_swap(a, b, c);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i32* @foo(i32** %0, i32* %1, i32* %2) {
%4 = alloca i32**
%5 = alloca i32*
%6 = alloca i32*
store i32** %0, i32*** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32**, i32*** %4
%8 = bitcast i32** %7 to i64*
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = cmpxchg i64* %8, i64 %10, i64 %12 seq_cst seq_cst
%14 = extractvalue { i64, i1 } %13, 0
%15 = inttoptr i64 %14 to i32*
ret i32* %15
}

LLVM IR (-O2):
define i32* @foo(i32** nocapture %0, i32* %1, i32* %2) {
%4 = bitcast i32** %0 to i64*
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = cmpxchg i64* %4, i64 %5, i64 %6 seq_cst seq_cst
%8 = extractvalue { i64, i1 } %7, 0
%9 = inttoptr i64 %8 to i32*
ret i32* %9
}
/* Variables and functions */
int system(char *);
int main(void) { return system("xvic.exe -sounddev dummy"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"xvic.exe -sounddev dummy\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [25 x i8] c"xvic.exe -sounddev dummy\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ xfree(void *);
void free_el(void **el) {
  xfree(*el);
  *el = NULL;
}


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

x86 assembly (clang, -O2):
<free_el>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <xfree@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @free_el(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @xfree(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @free_el(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @xfree(i8* %2)
store i8* null, i8** %0
ret void
}
void foo_1_1_1_1_2_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_2_1_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *mensaje = "Hola a %s";
  printf(mensaje, "todos\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Hola a %s\00"
@.str.1 = [7 x i8] c"todos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hola a %s\00"
@.str.1 = [7 x i8] c"todos\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo3(unsigned char c) {
  if (c & 4)
    bar();
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1135 <foo3+0x25>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
test   $0x4,%dil
jne    1117 <foo3+0x7>
ret
xor    %eax,%eax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo3(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @bar()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @foo3(i8 zeroext %0) {
%2 = and i8 %0, 4
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @bar()
br label %6
6: ; preds = %4, %1
ret void
}