xunge/DecIR huggingface dataset:
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
struct tree *find_tree_node(char const *, int);
struct tree *find_node(const char *name, struct tree *subtree) {
  return (find_tree_node(name, -1));
}


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

x86 assembly (clang, -O2):
<find_node>:
mov    $0xffffffff,%esi
jmp    1030 <find_tree_node@plt>

LLVM IR (-O0):
%struct.tree = type { i32 }
define %struct.tree* @find_node(i8* %0, %struct.tree* %1) {
%3 = alloca i8*
%4 = alloca %struct.tree*
store i8* %0, i8** %3
store %struct.tree* %1, %struct.tree** %4
%5 = load i8*, i8** %3
%6 = call %struct.tree* @find_tree_node(i8* %5, i32 -1)
ret %struct.tree* %6
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define %struct.tree* @find_node(i8* %0, %struct.tree* nocapture readnone %1) {
%3 = tail call %struct.tree* @find_tree_node(i8* %0, i32 -1)
ret %struct.tree* %3
}
unsigned short int f37(unsigned short int x, int y) {
  return (x >> y) | (x << ((-y) & (8 * 2 - 1)));
}


x86 assembly (clang, -O0):
<f37>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0xf,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f37>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0xf,%cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f37(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = and i32 %12, 15
%14 = shl i32 %10, %13
%15 = or i32 %8, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @f37(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = lshr i32 %3, %1
%5 = sub nsw i32 0, %1
%6 = and i32 %5, 15
%7 = shl nuw nsw i32 %3, %6
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ DWB();
void writel(unsigned val, unsigned addr) {
  DWB();
  (*(volatile unsigned *)(addr)) = (val);
  DWB();
}


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

x86 assembly (clang, -O2):
<writel>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <DWB@plt>
mov    %ebx,%eax
mov    %ebp,(%rax)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <DWB@plt>

LLVM IR (-O0):
define void @writel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @DWB()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %6, i32* %9
%10 = call i32 (...) @DWB()
ret void
}

LLVM IR (-O2):
define void @writel(i32 %0, i32 %1) {
%3 = tail call i32 (...) @DWB()
%4 = zext i32 %1 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %0, i32* %5
%6 = tail call i32 (...) @DWB()
ret void
}
/* Variables and functions */
void *zalloc(size_t);
void *calloc(size_t nmemb, size_t size) { return zalloc(size * nmemb); }


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

x86 assembly (clang, -O2):
<calloc>:
imul   %rsi,%rdi
jmp    1030 <zalloc@plt>

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = mul i64 %5, %6
%8 = call i8* @zalloc(i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @zalloc(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(int *);
int *x_calloc(int, int);
void calloc_test(void) {
  int *p = x_calloc(100, sizeof(int));
  assert(p != NULL);
  for (size_t i = 0; i < 100; i++)
    assert(p[i] == 0);
  free(p);
}


x86 assembly (clang, -O0):
<calloc_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
mov    $0x4,%esi
call   1050 <x_calloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x64,-0x10(%rbp)
jae    119a <calloc_test+0x6a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1165 <calloc_test+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc_test>:
push   %r14
push   %rbx
push   %rax
mov    $0x64,%edi
mov    $0x4,%esi
call   1050 <x_calloc@plt>
mov    %rax,%r14
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
cmpl   $0x0,(%r14,%rbx,4)
sete   %dil
call   1040 <assert@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1160 <calloc_test+0x30>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @calloc_test() {
%1 = alloca i32*
%2 = alloca i64
%3 = call i32* @x_calloc(i32 100, i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
store i64 0, i64* %2
br label %8
8: ; preds = %19, %0
%9 = load i64, i64* %2
%10 = icmp ult i64 %9, 100
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32*, i32** %1
%13 = load i64, i64* %2
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
br label %19
19: ; preds = %11
%20 = load i64, i64* %2
%21 = add i64 %20, 1
store i64 %21, i64* %2
br label %8
22: ; preds = %8
%23 = load i32*, i32** %1
%24 = call i32 @free(i32* %23)
ret void
}

LLVM IR (-O2):
define void @calloc_test() {
%1 = tail call i32* @x_calloc(i32 100, i32 4)
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
br label %7
5: ; preds = %7
%6 = tail call i32 @free(i32* %1)
ret void
7: ; preds = %0, %7
%8 = phi i64 [ 0, %0 ], [ %14, %7 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, 100
br i1 %15, label %5, label %7
}
unsigned int ndigits(unsigned long long val) {
  unsigned int len = 0;
  do {
    val /= 10;
    len++;
  } while (val);
  return len;
}


x86 assembly (clang, -O0):
<ndigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    110f <ndigits+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndigits>:
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopl   0x0(%rax)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1110 <ndigits+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ndigits(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %5, %2 ]
%4 = phi i32 [ 0, %1 ], [ %6, %2 ]
%5 = udiv i64 %3, 10
%6 = add i32 %4, 1
%7 = icmp ult i64 %3, 10
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %6
}
/* Variables and functions */
int memcmp(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
int strcmp(char *str1, char *str2) {
  return memcmp(str1, str2, strlen(str1) + 1);
}


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

x86 assembly (clang, -O2):
<strcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcmp@plt>

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @memcmp(i8* %5, i8* %6, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %4)
ret i32 %5
}
void XSharpGetRegionRect(void *region, int index, void *rect) {}


x86 assembly (clang, -O0):
<XSharpGetRegionRect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @XSharpGetRegionRect(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int dwarf_get_FRAME_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_FRAME_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_FRAME_name(val_in, &v);
  return ellipname(res, val_in, v, "FRAME", printonerr);
}


x86 assembly (clang, -O0):
<get_FRAME_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <dwarf_get_FRAME_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1030 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_FRAME_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1040 <dwarf_get_FRAME_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1030 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"FRAME\00"
define i8* @get_FRAME_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_FRAME_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"FRAME\00"
define i8* @get_FRAME_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_FRAME_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int ksft_exit_xfail(void) { exit(2); }


x86 assembly (clang, -O0):
<ksft_exit_xfail>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<ksft_exit_xfail>:
push   %rax
mov    $0x2,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @ksft_exit_xfail() {
%1 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define i32 @ksft_exit_xfail() {
%1 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void itoa_len(char *buf, int val, int len) {
  char fmt[32];
  char tmp[32];
  sprintf(fmt, "%%0%dd", len);
  sprintf(tmp, fmt, val);
  memcpy(buf, tmp, len);
}


x86 assembly (clang, -O0):
<itoa_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%edx
lea    0xec0(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa_len>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xec6(%rip),%rsi
lea    0x20(%rsp),%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %rsp,%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%%0%dd\00"
define void @itoa_len(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [32 x i8]
%8 = alloca [32 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%10 = load i32, i32* %6
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%14 = load i32, i32* %5
%15 = call i32 @sprintf(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %4
%17 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%18 = load i32, i32* %6
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%%0%dd\00"
define void @itoa_len(i8* %0, i32 %1, i32 %2) {
%4 = alloca [32 x i8]
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%8 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
%9 = call i32 @sprintf(i8* %7, i8* %6, i32 %1)
%10 = call i32 @memcpy(i8* %0, i8* %7, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ relprime(long, long);
long euler(long n) {
  long length, i;
  length = 0;
  for (i = 1; i < n; i++)
    if (relprime(n, i))
      length++;
  return length;
}


x86 assembly (clang, -O0):
<euler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1173 <euler+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <relprime@plt>
cmp    $0x0,%rax
je     115d <euler+0x4d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1162 <euler+0x52>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <euler+0x1c>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euler>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%rdi
jl     114e <euler+0x3e>
mov    %rdi,%r14
mov    $0x1,%ebx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <relprime@plt>
cmp    $0x1,%rax
sbb    $0xffffffffffffffff,%r15
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <euler+0x20>
jmp    1151 <euler+0x41>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @euler(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 1, i64* %4
br label %5
5: ; preds = %18, %1
%6 = load i64, i64* %4
%7 = load i64, i64* %2
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i64, i64* %2
%11 = load i64, i64* %4
%12 = call i64 @relprime(i64 %10, i64 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i64, i64* %3
%16 = add nsw i64 %15, 1
store i64 %16, i64* %3
br label %17
17: ; preds = %14, %9
br label %18
18: ; preds = %17
%19 = load i64, i64* %4
%20 = add nsw i64 %19, 1
store i64 %20, i64* %4
br label %5
21: ; preds = %5
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @euler(i64 %0) {
%2 = icmp sgt i64 %0, 1
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i64 [ %10, %3 ], [ 1, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = tail call i64 @relprime(i64 %0, i64 %4)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = add nuw nsw i64 %5, %8
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, %0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i64 [ 0, %1 ], [ %9, %3 ]
ret i64 %13
}
/* Type definitions */
struct SmazBranch {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct SmazBranch *);
void smaz_free_trie(struct SmazBranch *t) { free(t); }


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

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

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

LLVM IR (-O2):
%struct.SmazBranch = type { i32 }
define void @smaz_free_trie(%struct.SmazBranch* nocapture %0) {
%2 = tail call i32 @free(%struct.SmazBranch* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f2(int);
int /*<<< orphan*/ func2();
__attribute__((no)) int bozo(void) {
  f2(3);
  func2();
}


x86 assembly (clang, -O0):
<bozo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <f2@plt>
mov    $0x0,%al
call   1040 <func2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bozo>:
push   %rax
mov    $0x3,%edi
call   1030 <f2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <func2@plt>

LLVM IR (-O0):
define i32 @bozo() {
%1 = alloca i32
%2 = call i32 @f2(i32 3)
%3 = call i32 (...) @func2()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @bozo() {
%1 = tail call i32 @f2(i32 3)
%2 = tail call i32 (...) @func2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ printf(char *);
int semctl(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  if (semctl(0, 0, IPC_RMID) != -1) {
    printf("ok\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <semctl@plt>
cmp    $0xffffffff,%eax
je     1156 <main+0x36>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <semctl@plt>
cmp    $0xffffffff,%eax
je     1144 <main+0x24>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [4 x i8] c"ok\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @IPC_RMID
%3 = call i32 @semctl(i32 0, i32 0, i32 %2)
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@str = [3 x i8] c"ok\00"
define i32 @main() {
%1 = load i32, i32* @IPC_RMID
%2 = tail call i32 @semctl(i32 0, i32 0, i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g(int);
void h() {
  f();
  g(42);
  g(42);
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x2a,%edi
call   1040 <g@plt>
mov    $0x2a,%edi
call   1040 <g@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
mov    $0x2a,%edi
call   1040 <g@plt>
mov    $0x2a,%edi
pop    %rax
jmp    1040 <g@plt>

LLVM IR (-O0):
define void @h() {
%1 = call i32 (...) @f()
%2 = call i32 @g(i32 42)
%3 = call i32 @g(i32 42)
ret void
}

LLVM IR (-O2):
define void @h() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @g(i32 42)
%3 = tail call i32 @g(i32 42)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ parambinder_free(void *);
void *unpack_anary(void *code, void *f, void *arg) {
  if (code) {
    *(uint32_t *)arg = *(uint32_t *)((uint32_t)code + 1);
    *(uint32_t *)f =
        *(uint32_t *)((uint32_t)code + 6) + ((uint32_t)code + 6 + 4);
    parambinder_free(code);
  }
  return 0;
}


x86 assembly (clang, -O0):
<unpack_anary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <unpack_anary+0x55>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x6(%rax),%rcx
mov    -0x8(%rbp),%rax
add    $0x6,%rax
add    $0x4,%rax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <parambinder_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_anary>:
test   %rdi,%rdi
je     1134 <unpack_anary+0x24>
push   %rax
mov    0x1(%rdi),%rax
mov    %rax,(%rdx)
mov    0x6(%rdi),%rax
add    %rdi,%rax
add    $0xa,%rax
mov    %rax,(%rsi)
call   1030 <parambinder_free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @unpack_anary(i8* %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = ptrtoint i8* %0 to i64
%7 = add nsw i64 %6, 1
%8 = inttoptr i64 %7 to i64*
%9 = load i64, i64* %8
%10 = bitcast i8* %2 to i64*
store i64 %9, i64* %10
%11 = add nsw i64 %6, 6
%12 = inttoptr i64 %11 to i64*
%13 = load i64, i64* %12
%14 = add nsw i64 %6, 10
%15 = add nsw i64 %14, %13
%16 = bitcast i8* %1 to i64*
store i64 %15, i64* %16
%17 = tail call i32 @parambinder_free(i8* %0)
br label %18
18: ; preds = %5, %3
ret i8* null
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ colormap;
};
typedef TYPE_1__ XWindowAttributes;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int XDestroyWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XFreeColormap(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XGetWindowAttributes(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, TYPE_1__ *);
int destroy_window(Display *display, Window window) {
  XWindowAttributes wa;
  (void)XGetWindowAttributes(display, window, &wa);
  (void)XFreeColormap(display, wa.colormap);
  return XDestroyWindow(display, window);
}


x86 assembly (clang, -O0):
<destroy_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1050 <XGetWindowAttributes@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <XFreeColormap@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <XDestroyWindow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_window>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rsp,%rdx
call   1050 <XGetWindowAttributes@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
call   1030 <XFreeColormap@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <XDestroyWindow@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @destroy_window(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %struct.TYPE_3__
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @XGetWindowAttributes(i32* %6, i32 %7, %struct.TYPE_3__* %5)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @XFreeColormap(i32* %9, i32 %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = call i32 @XDestroyWindow(i32* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @destroy_window(i32* %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = bitcast %struct.TYPE_3__* %3 to i8*
%5 = call i32 @XGetWindowAttributes(i32* %0, i32 %1, %struct.TYPE_3__* %3)
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @XFreeColormap(i32* %0, i32 %7)
%9 = call i32 @XDestroyWindow(i32* %0, i32 %1)
ret i32 %9
}
__attribute__((unused)) unsigned MEM_64bits(void) {
  return sizeof(void *) == 8;
}


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

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

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

LLVM IR (-O2):
define i32 @MEM_64bits() {
ret i32 1
}
void debug_print(const char *c) {}


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

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

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

LLVM IR (-O2):
define void @debug_print(i8* nocapture %0) {
ret void
}
void rop3_204_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  *D = (S & S) | (S & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_204_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0x9(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_204_0_1>:
mov    %esi,%eax
not    %al
and    %dl,%al
and    (%rdi),%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_204_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = and i32 %8, %10
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = and i32 %13, %16
%18 = or i32 %11, %17
%19 = load i8, i8* %6
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = and i32 %24, %27
%29 = or i32 %18, %28
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_204_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = and i8 %5, %6
%8 = or i8 %7, %1
store i8 %8, i8* %0
ret void
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ geteuid();
int /*<<< orphan*/ stderr;
void refuse_to_run_as_root(const char *programname) {
  uid_t id;
  id = geteuid();
  if (id == 0) {
    fprintf(stderr, "%s: You're running this as root?  I don't think so.\n",
            programname);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<refuse_to_run_as_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <geteuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <refuse_to_run_as_root+0x45>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refuse_to_run_as_root>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <geteuid@plt>
test   %rax,%rax
je     1142 <refuse_to_run_as_root+0x12>
pop    %rbx
ret
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"%s: You're running this as root? I don't think so.\0A\00"
define void @refuse_to_run_as_root(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = call i64 (...) @geteuid()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"%s: You're running this as root? I don't think so.\0A\00"
define void @refuse_to_run_as_root(i8* %0) {
%2 = tail call i64 (...) @geteuid()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
void gdk_selection_property_get() {}


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

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

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

LLVM IR (-O2):
define void @gdk_selection_property_get() {
ret void
}
int __attribute__((no)) foo(int arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ ide_do_packet_command_pio(char *, char *, int);
int ide_read_something() {
  char cmd[12] = {0x12, 0, 0, 0, 0x0a, 0, 0, 0, 0, 0, 0, 0};
  char result[10];
  ide_do_packet_command_pio(cmd, result, 10);
  return 0;
}


x86 assembly (clang, -O0):
<ide_read_something>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x16(%rbp),%rsi
mov    $0xa,%edx
call   1030 <ide_do_packet_command_pio@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_read_something>:
sub    $0x18,%rsp
movabs $0xa00000012,%rax
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
mov    %rsp,%rdi
lea    0xe(%rsp),%rsi
mov    $0xa,%edx
call   1030 <ide_do_packet_command_pio@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.ide_read_something.cmd = [12 x i8] c"\12\00\00\00\0A\00\00\00\00\00\00\00"
define i32 @ide_read_something() {
%1 = alloca [12 x i8]
%2 = alloca [10 x i8]
%3 = bitcast [12 x i8]* %1 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @ide_do_packet_command_pio(i8* %4, i8* %5, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.ide_read_something.cmd = [12 x i8] c"\12\00\00\00\0A\00\00\00\00\00\00\00"
define i32 @ide_read_something() {
%1 = alloca [12 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @ide_do_packet_command_pio(i8* %3, i8* %4, i32 10)
ret i32 0
}
/* Variables and functions */
__attribute__((weak)) char *get_cpu_str(void) { return NULL; }


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

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

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

LLVM IR (-O2):
define weak i8* @get_cpu_str() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ print_ground();
int /*<<< orphan*/ print_title();
int /*<<< orphan*/ resize_ground(int);
void title_redraw(void) {
  resize_ground(1);
  print_ground();
  print_title();
}


x86 assembly (clang, -O0):
<title_redraw>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <resize_ground@plt>
mov    $0x0,%al
call   1030 <print_ground@plt>
mov    $0x0,%al
call   1050 <print_title@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<title_redraw>:
push   %rax
mov    $0x1,%edi
call   1040 <resize_ground@plt>
xor    %eax,%eax
call   1030 <print_ground@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <print_title@plt>

LLVM IR (-O0):
define void @title_redraw() {
%1 = call i32 @resize_ground(i32 1)
%2 = call i32 (...) @print_ground()
%3 = call i32 (...) @print_title()
ret void
}

LLVM IR (-O2):
define void @title_redraw() {
%1 = tail call i32 @resize_ground(i32 1)
%2 = tail call i32 (...) @print_ground()
%3 = tail call i32 (...) @print_title()
ret void
}
int ffsll(long long int mask) { return __builtin_ffsll(mask); }


x86 assembly (clang, -O0):
<ffsll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
bsf    %rdx,%rax
add    $0x1,%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsll>:
bsf    %rdi,%rcx
add    $0x1,%ecx
xor    %eax,%eax
test   %rdi,%rdi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ffsll(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = add i64 %4, 1
%6 = icmp eq i64 %3, 0
%7 = select i1 %6, i64 0, i64 %5
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ffsll(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = icmp eq i64 %0, 0
%4 = trunc i64 %2 to i32
%5 = add nuw nsw i32 %4, 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
int sort_compare_ints_desc(const void *a, const void *b) {
  return *(const int *)b - *(const int *)a;
}


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

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

LLVM IR (-O0):
define i32 @sort_compare_ints_desc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @sort_compare_ints_desc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
unsigned int readTimer(void) {
  volatile unsigned int *timerData = (unsigned int *)((0x20400000) + 8);
  return (*timerData);
}


x86 assembly (clang, -O0):
<readTimer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20400008,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readTimer>:
mov    0x20400008,%eax
ret

LLVM IR (-O0):
define i32 @readTimer() {
%1 = alloca i32*
store i32* inttoptr (i64 541065224 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load volatile i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @readTimer() {
%1 = load volatile i32, i32* inttoptr (i64 541065224 to i32*)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int block_signal(int signum) {
  sigset_t set, oset;
  sigemptyset(&set);
  sigaddset(&set, signum);
  return sigprocmask(SIG_BLOCK, &set, &oset);
}


x86 assembly (clang, -O0):
<block_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_signal>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
mov    %r14,%rsi
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @block_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @sigemptyset(i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @sigaddset(i32* %3, i32 %6)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %3, i32* %4)
ret i32 %9
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @block_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @sigemptyset(i32* %2)
%7 = call i32 @sigaddset(i32* %2, i32 %0)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32* %3)
ret i32 %9
}
cbuf23(f, n) { return (cbuf(f, n, 23)); }


x86 assembly (clang, -O0):
<cbuf23>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x17,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf23>:
mov    $0x17,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf23(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 23)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf23(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 23)
ret i32 %3
}
/* Variables and functions */
size_t mf__mem_size(void *);
size_t mem_size(void *ptr) {
  size_t r_size_t = 0;
  ;
  r_size_t = mf__mem_size(ptr);
  ;
  return (r_size_t);
}


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

x86 assembly (clang, -O2):
<mem_size>:
jmp    1030 <mf__mem_size@plt>

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

LLVM IR (-O2):
define i64 @mem_size(i8* %0) {
%2 = tail call i64 @mf__mem_size(i8* %0)
ret i64 %2
}
void load_voice_samples(char *path) {}


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

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

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

LLVM IR (-O2):
define void @load_voice_samples(i8* nocapture %0) {
ret void
}
int tag_reg(void *p, void *q) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tag_reg(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void delay(int n) {
  volatile int i;
  for (i = 0; i < n; ++i)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <delay+0x2d>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jge    111f <delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <delay+0x10>
ret

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp slt i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writemem65816(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ zeropage();
void stzZp8(void) { writemem65816(zeropage(), 0); }


x86 assembly (clang, -O0):
<stzZp8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <zeropage@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <writemem65816@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stzZp8>:
push   %rax
xor    %eax,%eax
call   1030 <zeropage@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <writemem65816@plt>

LLVM IR (-O0):
define void @stzZp8() {
%1 = call i32 (...) @zeropage()
%2 = call i32 @writemem65816(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @stzZp8() {
%1 = tail call i32 (...) @zeropage()
%2 = tail call i32 @writemem65816(i32 %1, i32 0)
ret void
}