xunge/DecIR huggingface dataset:
int foo() {
  int i, bits;
  for (i = 1, bits = 1; i > 0; i += i)
    ++bits;
  return bits;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1133 <foo+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <foo+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 33
}
void close_sdl_audio(void) {}


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

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

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

LLVM IR (-O2):
define void @close_sdl_audio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_46_im_0();
void z80_ed_4e_im_0(void) { z80_ed_46_im_0(); }


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

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

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

LLVM IR (-O2):
define void @z80_ed_4e_im_0() {
%1 = tail call i32 (...) @z80_ed_46_im_0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
__attribute__((noreturn)) void usage(const char *arg0) {
  (void)arg0;
  fputs("usage:\n\n", stderr);
  fputs("ufs_gen "
        "[--prefix pfx] [--suffix sfx] [--sfxnops n]\n"
        "        --override addr --with addr --stackidx idx\n"
        "        --shellcode\n",
        stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xec4(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xeca(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"usage:\0A\0A\00"
@stderr = global i32 0
@.str.1 = [124 x i8] c"ufs_gen [--prefix pfx] [--suffix sfx] [--sfxnops n]\0A --override addr --with addr --stackidx idx\0A --shellcode\0A\00"
@EX_USAGE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EX_USAGE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"usage:\0A\0A\00"
@stderr = global i32 0
@.str.1 = [124 x i8] c"ufs_gen [--prefix pfx] [--suffix sfx] [--sfxnops n]\0A --override addr --with addr --stackidx idx\0A --shellcode\0A\00"
@EX_USAGE = global i32 0
define void @usage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @EX_USAGE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a, *ap, *bp;
  a = 305419854;
  ap = &a;
  bp = ap;
  printf("%d\t%d\t%d\n", a, *ap, *bp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1234564e,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d\09%d\09%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 305419854, i32 305419854, i32 305419854)
ret i32 0
}
IR0A1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= (*((unsigned int *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx),%eax
ja     1137 <IR0A1+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <IR0A1+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0A1>:
mov    (%r8),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = load i32, i32* inttoptr (i64 11111111 to i32*)
%9 = icmp ule i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int chance(int p) {
  if (((float)rand() / (float)RAND_MAX) >= ((float)p / 100.0f))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<chance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eba(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
movss  0xebc(%rip),%xmm2
divss  %xmm2,%xmm1
ucomiss %xmm1,%xmm0
jb     115d <chance+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1164 <chance+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chance>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec2(%rip),%rax
cvtsi2ss %ebx,%xmm1
movaps 0xecf(%rip),%xmm2
cvtsi2ssq (%rax),%xmm2
unpcklps %xmm1,%xmm0
divps  %xmm2,%xmm0
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @chance(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @rand()
%5 = sitofp i64 %4 to float
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to float
%8 = fdiv float %5, %7
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to float
%11 = fdiv float %10, 1.000000e+02
%12 = fcmp oge float %8, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @chance(i32 %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to float
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to float
%6 = sitofp i32 %0 to float
%7 = insertelement <2 x float> poison, float %3, i64 0
%8 = insertelement <2 x float> %7, float %6, i64 1
%9 = insertelement <2 x float> <float poison, float 1.000000e+02>, float %5, i64 0
%10 = fdiv <2 x float> %8, %9
%11 = extractelement <2 x float> %10, i64 0
%12 = extractelement <2 x float> %10, i64 1
%13 = fcmp oge float %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
void short2buf(unsigned char *buf, int inv) {
  buf[0] = (inv >> 0) & 0xff;
  buf[1] = (inv >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<short2buf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<short2buf>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @short2buf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 0
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @short2buf(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
char *ace_str_alloc(size_t);
int strlen(char const *);
int /*<<< orphan*/ strncat(char *, char const *, size_t);
char *ace_str_join_2(const char *s1, const char *s2) {
  size_t length = strlen(s1) + strlen(s2) + 1;
  char *result = ace_str_alloc(length);
  strncat(result, s1, length);
  strncat(result, s2, length);
  return result;
}


x86 assembly (clang, -O0):
<ace_str_join_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ace_str_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <strncat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <strncat@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ace_str_join_2>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %r15d,%eax
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1030 <ace_str_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1050 <strncat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <strncat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ace_str_join_2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %8, %10
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = call i8* @ace_str_alloc(i64 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = load i8*, i8** %3
%18 = load i64, i64* %5
%19 = call i32 @strncat(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %6
%21 = load i8*, i8** %4
%22 = load i64, i64* %5
%23 = call i32 @strncat(i8* %20, i8* %21, i64 %22)
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @ace_str_join_2(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = sext i32 %6 to i64
%8 = tail call i8* @ace_str_alloc(i64 %7)
%9 = tail call i32 @strncat(i8* %8, i8* %0, i64 %7)
%10 = tail call i32 @strncat(i8* %8, i8* %1, i64 %7)
ret i8* %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int cli_dir_exists(const char *fpath) {
  struct stat st;
  if (stat(fpath, &st) == -1)
    return (0);
  if (!S_ISDIR(st.st_mode))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<cli_dir_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    114e <cli_dir_exists+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1172 <cli_dir_exists+0x52>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    116b <cli_dir_exists+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1172 <cli_dir_exists+0x52>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_dir_exists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1141 <cli_dir_exists+0x21>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @cli_dir_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %9
store i32 0, i32* %2
br label %16
15: ; preds = %9
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @cli_dir_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
unsigned rx_padding_size(unsigned len) { return (~len + 1) & (8 - 1); }


x86 assembly (clang, -O0):
<rx_padding_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rx_padding_size>:
mov    %edi,%eax
neg    %eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @rx_padding_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = add i32 %4, 1
%6 = and i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @rx_padding_size(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, 7
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
time_t get_whole_seconds(const double seconds) {
  return (time_t)((long)seconds);
}


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

x86 assembly (clang, -O2):
<get_whole_seconds>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @get_whole_seconds(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_whole_seconds(double %0) {
%2 = fptosi double %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add();
int /*<<< orphan*/ by_ptr(int /*<<< orphan*/);
void add_by_ptr(uint32_t x) {
  by_ptr(x);
  add();
}


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

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

LLVM IR (-O0):
define void @add_by_ptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr(i32 %3)
%5 = call i32 (...) @add()
ret void
}

LLVM IR (-O2):
define void @add_by_ptr(i32 %0) {
%2 = tail call i32 @by_ptr(i32 %0)
%3 = tail call i32 (...) @add()
ret void
}
int qcs_min(int a, int b) { return a > b ? b : a; }


x86 assembly (clang, -O0):
<qcs_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <qcs_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <qcs_min+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcs_min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @qcs_min(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @qcs_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char **);
void fig06_12() {
  char array[5];
  printf("    array = %p\n&array[0] = %p\n   &array = %p\n", array, &array[0],
         &array);
}


x86 assembly (clang, -O0):
<fig06_12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rsi
lea    -0x5(%rbp),%rdx
lea    -0x5(%rbp),%rcx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig06_12>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x3(%rsp),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [46 x i8] c" array = %p\0A&array[0] = %p\0A &array = %p\0A\00"
define void @fig06_12() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = bitcast [5 x i8]* %1 to i8**
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8** %4)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c" array = %p\0A&array[0] = %p\0A &array = %p\0A\00"
define void @fig06_12() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = bitcast [5 x i8]* %1 to i8**
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2, i8** %3)
ret void
}
int fun1120() { return 1120; }


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

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

LLVM IR (-O0):
define i32 @fun1120() {
ret i32 1120
}

LLVM IR (-O2):
define i32 @fun1120() {
ret i32 1120
}
/* Variables and functions */
int /*<<< orphan*/ chronometer_start();
int /*<<< orphan*/ consolemanager_println(char *);
void shell_program_chrono_start(int argc __attribute__((__unused__)),
                                char *argv[] __attribute__((__unused__))) {
  chronometer_start();
  consolemanager_println("Chronometer started !");
}


x86 assembly (clang, -O0):
<shell_program_chrono_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <chronometer_start@plt>
lea    0xec3(%rip),%rdi
call   1030 <consolemanager_println@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"Chronometer started !\00"
define void @shell_program_chrono_start(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @chronometer_start()
%6 = call i32 @consolemanager_println(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Chronometer started !\00"
define void @shell_program_chrono_start(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @chronometer_start()
%4 = tail call i32 @consolemanager_println(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __hosted_from_gdb_errno(int);
int do_syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/, int *);
int /*<<< orphan*/ errno;
int close(int fildes) {
  int status;
  int error;
  status = do_syscall(4, fildes, 0, 0, 0, &error);
  if (status < 0)
    errno = __hosted_from_gdb_errno(error);
  return status;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x4,%edi
xor    %r8d,%r8d
lea    -0xc(%rbp),%r9
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <do_syscall@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1165 <close+0x45>
mov    -0xc(%rbp),%edi
call   1040 <__hosted_from_gdb_errno@plt>
mov    %eax,%ecx
mov    0x2e7d(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%esi
lea    0xc(%rsp),%r9
mov    $0x4,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <do_syscall@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1155 <close+0x35>
mov    0xc(%rsp),%edi
call   1040 <__hosted_from_gdb_errno@plt>
mov    0x2e8d(%rip),%rcx
mov    %eax,(%rcx)
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @do_syscall(i32 4, i32 %5, i32 0, i32 0, i32 0, i32* %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = call i32 @__hosted_from_gdb_errno(i32 %10)
store i32 %11, i32* @errno
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @do_syscall(i32 4, i32 %0, i32 0, i32 0, i32 0, i32* %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @__hosted_from_gdb_errno(i32 %7)
store i32 %8, i32* @errno
br label %9
9: ; preds = %6, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int strlen(char *);
void lower_to_upper(char in[]) {
  int i;
  for (i = 0; i < strlen(in); i++) {
    printf("%c\n", in[i] ^ ' ');
  }
}


x86 assembly (clang, -O0):
<lower_to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <lower_to_upper+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
xor    $0x20,%eax
lea    0xe9b(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <lower_to_upper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_to_upper>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    1163 <lower_to_upper+0x43>
xor    %ebx,%ebx
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
xor    $0x20,%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <lower_to_upper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @lower_to_upper(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = xor i8 %7, 32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = add nuw nsw i64 %5, 1
%11 = tail call i32 @strlen(i8* %0)
%12 = sext i32 %11 to i64
%13 = icmp slt i64 %10, %12
br i1 %13, label %4, label %14
14: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
bool streq(const char *a, const char *b) { return strcmp(a, b) == 0; }


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @streq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
char *sc(char *dst, char *src) {
  char c;
  while (0 != (c = *src++)) {
    *dst++ = c;
  }
  *dst = c;
  return (dst);
}


x86 assembly (clang, -O0):
<sc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1146 <sc+0x46>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <sc+0xc>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <sc+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <sc+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @sc(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int notify_begin(int pi, unsigned handle, uint32_t bits) {
  return pigpio_command(pi, 19, handle, bits, 1);
}


x86 assembly (clang, -O0):
<notify_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x13,%esi
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notify_begin>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x13,%esi
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @notify_begin(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @pigpio_command(i32 %7, i32 19, i32 %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @notify_begin(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pigpio_command(i32 %0, i32 19, i32 %1, i32 %2, i32 1)
ret i32 %4
}
void writeint(sp, i) struct slot *sp;
int i;
{
  if (i >= 10)
    writeint(sp, i / 10);
  writech(sp, i % 10 + '0');
}


x86 assembly (clang, -O0):
<writeint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jl     114f <writeint+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <writeint@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x30,%esi
mov    $0x0,%al
call   1040 <writech@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeint>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
cmp    $0xa,%esi
jl     1145 <writeint+0x25>
mov    %ebx,%eax
mov    $0xcccccccd,%esi
imul   %rax,%rsi
shr    $0x23,%rsi
mov    %r14,%rdi
call   1030 <writeint@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%rbx,%rax,1),%esi
add    $0x30,%esi
mov    %r14,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <writech@plt>

LLVM IR (-O0):
%struct.slot = type opaque
define void @writeint(%struct.slot* %0, i32 %1) {
%3 = alloca %struct.slot*
%4 = alloca i32
store %struct.slot* %0, %struct.slot** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load %struct.slot*, %struct.slot** %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 10
br label %11
11: ; preds = %7, %2
%12 = load %struct.slot*, %struct.slot** %3
%13 = load i32, i32* %4
%14 = srem i32 %13, 10
%15 = add nsw i32 %14, 48
%16 = call i32 (%struct.slot*, i32, ...) bitcast (i32 (...)* @writech to i32 (%struct.slot*, i32, ...)*)(%struct.slot* %12, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.slot = type opaque
define void @writeint(%struct.slot* %0, i32 %1) {
%3 = icmp sgt i32 %1, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i32 %1, 10
tail call void @writeint(%struct.slot* %0, i32 %5)
br label %6
6: ; preds = %4, %2
%7 = srem i32 %1, 10
%8 = add nsw i32 %7, 48
%9 = tail call i32 (%struct.slot*, i32, ...) bitcast (i32 (...)* @writech to i32 (%struct.slot*, i32, ...)*)(%struct.slot* %0, i32 %8)
ret void
}
/* Type definitions */
struct mempool {
  int dummy;
};

/* Variables and functions */
void *mp_grow_internal(struct mempool *, unsigned int);
void *mp_ptr(struct mempool *);
void *mp_spread_internal(struct mempool *pool, void *p, unsigned size) {
  void *old = mp_ptr(pool);
  void *new = mp_grow_internal(pool, p - old + size);
  return p - old + new;
}


x86 assembly (clang, -O0):
<mp_spread_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mp_ptr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    -0x14(%rbp),%ecx
add    %rcx,%rax
mov    %eax,%esi
call   1030 <mp_grow_internal@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
add    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_spread_internal>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <mp_ptr@plt>
sub    %rax,%rbx
add    %ebx,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <mp_grow_internal@plt>
add    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.mempool = type { i32 }
define i8* @mp_spread_internal(%struct.mempool* %0, i8* %1, i32 %2) {
%4 = alloca %struct.mempool*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.mempool* %0, %struct.mempool** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load %struct.mempool*, %struct.mempool** %4
%10 = call i8* @mp_ptr(%struct.mempool* %9)
store i8* %10, i8** %7
%11 = load %struct.mempool*, %struct.mempool** %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %7
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
%17 = load i32, i32* %6
%18 = zext i32 %17 to i64
%19 = add nsw i64 %16, %18
%20 = trunc i64 %19 to i32
%21 = call i8* @mp_grow_internal(%struct.mempool* %11, i32 %20)
store i8* %21, i8** %8
%22 = load i8*, i8** %5
%23 = load i8*, i8** %7
%24 = ptrtoint i8* %22 to i64
%25 = ptrtoint i8* %23 to i64
%26 = sub i64 %24, %25
%27 = load i8*, i8** %8
%28 = getelementptr i8, i8* %27, i64 %26
ret i8* %28
}

LLVM IR (-O2):
%struct.mempool = type { i32 }
define i8* @mp_spread_internal(%struct.mempool* %0, i8* %1, i32 %2) {
%4 = tail call i8* @mp_ptr(%struct.mempool* %0)
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %4 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = add i32 %8, %2
%10 = tail call i8* @mp_grow_internal(%struct.mempool* %0, i32 %9)
%11 = getelementptr i8, i8* %10, i64 %7
ret i8* %11
}
/* Variables and functions */
long double __qsign(long double, long double);
long double intr_wrap_464(long double p1, long double p2) {
  return __qsign(p1, p2);
}


x86 assembly (clang, -O0):
<intr_wrap_464>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <__qsign@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_464>:
jmp    1030 <__qsign@plt>

LLVM IR (-O0):
define x86_fp80 @intr_wrap_464(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @__qsign(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @intr_wrap_464(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @__qsign(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
int ValidateDate(const unsigned char *date, unsigned char format,
                 int dateType) {
  return 1;
}


x86 assembly (clang, -O0):
<ValidateDate>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ValidateDate(i8* nocapture readnone %0, i8 zeroext %1, i32 %2) {
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ a4;
};
typedef TYPE_1__ xfrm_address_t;

/* Variables and functions */
unsigned int ntohl(int /*<<< orphan*/);
unsigned int __xfrm4_addr_hash(xfrm_address_t *addr) { return ntohl(addr->a4); }


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

x86 assembly (clang, -O2):
<__xfrm4_addr_hash>:
mov    (%rdi),%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @__xfrm4_addr_hash(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohl(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @__xfrm4_addr_hash(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohl(i32 %3)
ret i32 %4
}
void adis16400_remove_trigger(struct iio_dev *indio_dev) {}


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

x86 assembly (clang, -O2):
ret

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

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

/* Variables and functions */
int O_CREAT;
int O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char const *, int, int /*<<< orphan*/);
int touch(const char *path, mode_t mode) {
  int fd = open(path, O_RDONLY | O_CREAT, mode);
  if (fd == -1) {
    return -1;
  }
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<touch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
mov    0x2eb5(%rip),%rax
or     (%rax),%esi
mov    -0x14(%rbp),%edx
call   1040 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1166 <touch+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <touch+0x55>
mov    -0x18(%rbp),%edi
call   1030 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<touch>:
push   %rax
mov    %esi,%edx
mov    0x2eb6(%rip),%rax
mov    0x2ec7(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     114a <touch+0x2a>
mov    %eax,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
define i32 @touch(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* @O_RDONLY
%9 = load i32, i32* @O_CREAT
%10 = or i32 %8, %9
%11 = load i32, i32* %5
%12 = call i32 @open(i8* %7, i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %19
16: ; preds = %2
%17 = load i32, i32* %6
%18 = call i32 @close(i32 %17)
store i32 0, i32* %3
br label %19
19: ; preds = %16, %15
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
define i32 @touch(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_RDONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = tail call i32 @open(i8* %0, i32 %5, i32 %1)
%7 = icmp eq i32 %6, -1
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @close(i32 %6)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 0, %8 ], [ -1, %2 ]
ret i32 %11
}
void acc(void) {}


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

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

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

LLVM IR (-O2):
define void @acc() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ memcpy(char *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *mystrdup(const char *s) {
  char *ss = (char *)malloc(strlen(s) + 1);
  if (ss != NULL)
    memcpy(ss, s, strlen(s) + 1);
  return ss;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118d <mystrdup+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%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 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <mystrdup+0x34>
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%9 = add nsw i64 %8, 1
%10 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %9)
br label %11
11: ; preds = %7, %1
ret i8* %5
}
void DBG_INF_FMT(const char *const format, ...) {}


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

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

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

LLVM IR (-O2):
define void @DBG_INF_FMT(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(
      stderr, "usage: %s\n",
      "logger [-46Ais] [-f file] [-h host] [-P port] [-p pri] [-t tag]\n"
      "              [message ...]");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s\0A\00"
@.str.1 = [92 x i8] c"logger [-46Ais] [-f file] [-h host] [-P port] [-p pri] [-t tag]\0A [message ...]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s\0A\00"
@.str.1 = [92 x i8] c"logger [-46Ais] [-f file] [-h host] [-P port] [-p pri] [-t tag]\0A [message ...]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void sesc_pseudoreset(void) {}


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

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

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

LLVM IR (-O2):
define void @sesc_pseudoreset() {
ret void
}
void f4(union { int i; } * a) {}


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

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

LLVM IR (-O0):
%union.anon = type { i32 }
define void @f4(%union.anon* %0) {
%2 = alloca %union.anon*
store %union.anon* %0, %union.anon** %2
ret void
}

LLVM IR (-O2):
%union.anon = type { i32 }
define void @f4(%union.anon* nocapture %0) {
ret void
}