xunge/DecIR huggingface dataset:
/* Variables and functions */
void ft_strclr(char *s) {
  int i;
  i = 0;
  if (s != NULL) {
    while (s[i]) {
      s[i] = '\0';
      i++;
    }
    s[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <ft_strclr+0x57>
jmp    111f <ft_strclr+0x1f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114b <ft_strclr+0x4b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <ft_strclr+0x1f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     1128 <ft_strclr+0x28>
cmpb   $0x0,(%rdi)
je     1122 <ft_strclr+0x22>
nopw   0x0(%rax,%rax,1)
movb   $0x0,(%rdi)
lea    0x1(%rdi),%rax
cmpb   $0x0,0x1(%rdi)
mov    %rax,%rdi
jne    1110 <ft_strclr+0x10>
jmp    1125 <ft_strclr+0x25>
mov    %rdi,%rax
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
store i8 0, i8* %8
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = phi i8* [ %0, %3 ], [ %10, %6 ]
store i8 0, i8* %14
br label %15
15: ; preds = %13, %1
ret void
}
/* Type definitions */
struct FNVHash128 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fnv128UpdateBuffer(struct FNVHash128 *, char const *,
                                      int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void fnv128UpdateString(struct FNVHash128 *hval, const char *str) {
  fnv128UpdateBuffer(hval, str, strlen(str));
}


x86 assembly (clang, -O0):
<fnv128UpdateString>:
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    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <fnv128UpdateBuffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnv128UpdateString>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fnv128UpdateBuffer@plt>

LLVM IR (-O0):
%struct.FNVHash128 = type { i32 }
define void @fnv128UpdateString(%struct.FNVHash128* %0, i8* %1) {
%3 = alloca %struct.FNVHash128*
%4 = alloca i8*
store %struct.FNVHash128* %0, %struct.FNVHash128** %3
store i8* %1, i8** %4
%5 = load %struct.FNVHash128*, %struct.FNVHash128** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @fnv128UpdateBuffer(%struct.FNVHash128* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.FNVHash128 = type { i32 }
define void @fnv128UpdateString(%struct.FNVHash128* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @fnv128UpdateBuffer(%struct.FNVHash128* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ check_linux();
scalar_t__ check_xen_tokyo();
const char *probe_system(void) {
  const char *system = NULL;
  if (check_linux())
    system = "linux";
  if (check_xen_tokyo())
    system = "xen-tokyo";
  return system;
}


x86 assembly (clang, -O0):
<probe_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <check_linux@plt>
cmp    $0x0,%rax
je     114c <probe_system+0x2c>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <check_xen_tokyo@plt>
cmp    $0x0,%rax
je     1168 <probe_system+0x48>
lea    0xea2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<probe_system>:
push   %rbx
xor    %eax,%eax
call   1030 <check_linux@plt>
mov    %rax,%rbx
test   %rax,%rax
lea    0xecb(%rip),%rax
cmovne %rax,%rbx
xor    %eax,%eax
call   1040 <check_xen_tokyo@plt>
test   %rax,%rax
lea    0xebc(%rip),%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"linux\00"
@.str.1 = [10 x i8] c"xen-tokyo\00"
define i8* @probe_system() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i64 (...) @check_linux()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
br label %5
5: ; preds = %4, %0
%6 = call i64 (...) @check_xen_tokyo()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %9
9: ; preds = %8, %5
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"linux\00"
@.str.1 = [10 x i8] c"xen-tokyo\00"
define i8* @probe_system() {
%1 = tail call i64 (...) @check_linux()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
%4 = tail call i64 (...) @check_xen_tokyo()
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ max_sounds_dynamic(int);
int /*<<< orphan*/ max_sounds_static(int);
int qmax(int /*<<< orphan*/, int /*<<< orphan*/);
int max_sounds(int p) {
  return qmax(max_sounds_dynamic(p), max_sounds_static(p));
}


x86 assembly (clang, -O0):
<max_sounds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <max_sounds_dynamic@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <max_sounds_static@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <qmax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_sounds>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <max_sounds_dynamic@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <max_sounds_static@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <qmax@plt>

LLVM IR (-O0):
define i32 @max_sounds(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @max_sounds_dynamic(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @max_sounds_static(i32 %5)
%7 = call i32 @qmax(i32 %4, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @max_sounds(i32 %0) {
%2 = tail call i32 @max_sounds_dynamic(i32 %0)
%3 = tail call i32 @max_sounds_static(i32 %0)
%4 = tail call i32 @qmax(i32 %2, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef char const uint32_t;

/* Variables and functions */
uint32_t fourcc(const char *s) {
  return s[0] | s[1] << 8 | s[2] << 16 | s[3] << 24;
}


x86 assembly (clang, -O0):
<fourcc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @fourcc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
%25 = trunc i32 %24 to i8
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @fourcc(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int feof(int /*<<< orphan*/ *);
int c_feof_(FILE **stream) { return feof(*stream); }


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

x86 assembly (clang, -O2):
<c_feof_>:
mov    (%rdi),%rdi
jmp    1030 <feof@plt>

LLVM IR (-O0):
define i32 @c_feof_(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = call i32 @feof(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @c_feof_(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call i32 @feof(i32* %2)
ret i32 %3
}
void RTTcpSgWriteLNB(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpSgWriteLNB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void oom_killer(void) {
  fprintf(stderr, "\n\n !!! Out of memory !!!\n\n");
  abort();
}


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

x86 assembly (clang, -O2):
<oom_killer>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"\0A\0A !!! Out of memory !!!\0A\0A\00"
define void @oom_killer() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"\0A\0A !!! Out of memory !!!\0A\0A\00"
define void @oom_killer() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
void *shmat(int, int /*<<< orphan*/, int /*<<< orphan*/);
void *g_shmat(int shmid) { return shmat(shmid, 0, 0); }


x86 assembly (clang, -O0):
<g_shmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <shmat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_shmat>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <shmat@plt>

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

LLVM IR (-O2):
define i8* @g_shmat(i32 %0) {
%2 = tail call i8* @shmat(i32 %0, i32 0, i32 0)
ret i8* %2
}
void udelay(unsigned int n) {
  if (!n)
    return;
  __asm__("1: dec %%eax; jne 1b;" : : "a"(n * 1000));
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1116 <udelay+0x16>
jmp    1125 <udelay+0x25>
imul   $0x3e8,-0x4(%rbp),%eax
dec    %eax
jne    111d <udelay+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
test   %edi,%edi
je     110e <udelay+0xe>
imul   $0x3e8,%edi,%eax
dec    %eax
jne    110a <udelay+0xa>
ret

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

LLVM IR (-O2):
define void @udelay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = mul i32 %0, 1000
tail call void asm sideeffect "1: dec %eax; jne 1b;", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
long long shft_ll(long long *, long long *);
long long intr_wrap_555(long long p1, long long p2) {
  return shft_ll(&p1, &p2);
}


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

x86 assembly (clang, -O2):
<intr_wrap_555>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <shft_ll@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @intr_wrap_555(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @shft_ll(i64* %3, i64* %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @intr_wrap_555(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @shft_ll(i64* %3, i64* %4)
ret i64 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ arc_mode;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
int get_XGCValues_arc_mode(void *_p) {
  return (int)((XGCValues *)_p)->arc_mode;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XGCValues_arc_mode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct sock_fprog {
  int dummy;
};

/* Variables and functions */
int __bpf_ipv4_hash(struct sock_fprog *, int);
int bpf_vlan_ipv4_hash(struct sock_fprog *fprog) {
  return __bpf_ipv4_hash(fprog, true);
}


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

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

LLVM IR (-O0):
%struct.sock_fprog = type { i32 }
define i32 @bpf_vlan_ipv4_hash(%struct.sock_fprog* %0) {
%2 = alloca %struct.sock_fprog*
store %struct.sock_fprog* %0, %struct.sock_fprog** %2
%3 = load %struct.sock_fprog*, %struct.sock_fprog** %2
%4 = call i32 @__bpf_ipv4_hash(%struct.sock_fprog* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.sock_fprog = type { i32 }
define i32 @bpf_vlan_ipv4_hash(%struct.sock_fprog* %0) {
%2 = tail call i32 @__bpf_ipv4_hash(%struct.sock_fprog* %0, i32 1)
ret i32 %2
}
int look(str)
register char *str;
{
  register int rc;
  char tokenbuf[510];
  rc = match(tokenbuf, str);
  pbstr(tokenbuf);
  return (rc);
}


x86 assembly (clang, -O0):
<look>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <match@plt>
mov    %eax,-0xc(%rbp)
lea    -0x210(%rbp),%rdi
mov    $0x0,%al
call   1040 <pbstr@plt>
mov    -0xc(%rbp),%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<look>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <match@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <pbstr@plt>
mov    %ebp,%eax
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @look(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [510 x i8]
store i8* %0, i8** %2
%5 = getelementptr inbounds [510 x i8], [510 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
store i32 %7, i32* %3
%8 = getelementptr inbounds [510 x i8], [510 x i8]* %4, i64 0, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @pbstr to i32 (i8*, ...)*)(i8* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @look(i8* %0) {
%2 = alloca [510 x i8]
%3 = getelementptr inbounds [510 x i8], [510 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @match to i32 (i8*, i8*, ...)*)(i8* %3, i8* %0)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @pbstr to i32 (i8*, ...)*)(i8* %3)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t decode_symbol(uint8_t symbol) {
  static uint8_t const s_radio_symbol_table[53] = {
      0, 0, 0, 0, 0, 0, 0,  0, 0,  0, 0,  11, 0, 13, 14, 0, 0, 0,
      0, 0, 0, 0, 7, 0, 0,  9, 8,  0, 15, 0,  0, 0,  0,  0, 0, 3,
      0, 5, 6, 0, 0, 0, 10, 0, 12, 0, 0,  0,  0, 1,  2,  0, 4};
  if (symbol >= 53) {
    return 0;
  }
  return s_radio_symbol_table[symbol];
}


x86 assembly (clang, -O0):
<decode_symbol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x35,-0x8(%rbp)
jl     111d <decode_symbol+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    112e <decode_symbol+0x2e>
movslq -0x8(%rbp),%rcx
lea    0xed8(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_symbol>:
xor    %eax,%eax
cmp    $0x34,%edi
jg     1114 <decode_symbol+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@decode_symbol.s_radio_symbol_table = internal constant [53 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 11, i32 0, i32 13, i32 14, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 0, i32 0, i32 9, i32 8, i32 0, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 3, i32 0, i32 5, i32 6, i32 0, i32 0, i32 0, i32 10, i32 0, i32 12, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 0, i32 4]
define i32 @decode_symbol(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 53
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [53 x i32], [53 x i32]* @decode_symbol.s_radio_symbol_table, i64 0, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@decode_symbol.s_radio_symbol_table = internal unnamed_addr constant [53 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 11, i32 0, i32 13, i32 14, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 0, i32 0, i32 9, i32 8, i32 0, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 3, i32 0, i32 5, i32 6, i32 0, i32 0, i32 0, i32 10, i32 0, i32 12, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 0, i32 4]
define i32 @decode_symbol(i32 %0) {
%2 = icmp sgt i32 %0, 52
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [53 x i32], [53 x i32]* @decode_symbol.s_radio_symbol_table, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
int int_compare(int *a, int *b) {
  if (*a == *b)
    return 0;
  else if (*a < *b)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    112a <int_compare+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    114f <int_compare+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <int_compare+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <int_compare+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_compare(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = icmp slt i32 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ set_key(char *);
int /*<<< orphan*/ set_value(char *);
void set(char *_key, char *_value) {
  set_key(_key);
  set_value(_value);
}


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

x86 assembly (clang, -O2):
<set>:
push   %rbx
mov    %rsi,%rbx
call   1040 <set_key@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <set_value@plt>

LLVM IR (-O0):
define void @set(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 = call i32 @set_key(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @set_value(i8* %7)
ret void
}

LLVM IR (-O2):
define void @set(i8* %0, i8* %1) {
%3 = tail call i32 @set_key(i8* %0)
%4 = tail call i32 @set_value(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanProcs();
int /*<<< orphan*/ scanUsers();
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  scanUsers();
  for (;;) {
    sleep(30);
    scanProcs();
    scanUsers();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <scanUsers@plt>
mov    $0x1e,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1030 <scanProcs@plt>
mov    $0x0,%al
call   1040 <scanUsers@plt>
jmp    114d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <scanUsers@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1e,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <scanProcs@plt>
xor    %eax,%eax
call   1040 <scanUsers@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @scanUsers()
br label %7
7: ; preds = %7, %2
%8 = call i32 @sleep(i32 30)
%9 = call i32 (...) @scanProcs()
%10 = call i32 (...) @scanUsers()
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @scanUsers()
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @sleep(i32 30)
%6 = tail call i32 (...) @scanProcs()
%7 = tail call i32 (...) @scanUsers()
br label %4
}
void main() {
  int value = 10000;
  switch (value) {
  case 100:
    value = 100;
    break;
  case 200:
    value = 200;
    break;
  default:
    value = 300;
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2710,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x64,%eax
je     1132 <main+0x32>
jmp    111f <main+0x1f>
mov    -0x8(%rbp),%eax
sub    $0xc8,%eax
je     113e <main+0x3e>
jmp    114a <main+0x4a>
movl   $0x64,-0x4(%rbp)
jmp    1151 <main+0x51>
movl   $0xc8,-0x4(%rbp)
jmp    1151 <main+0x51>
movl   $0x12c,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 10000, i32* %1
%2 = load i32, i32* %1
switch i32 %2, label %5 [
i32 100, label %3
i32 200, label %4
]
3: ; preds = %0
store i32 100, i32* %1
br label %6
4: ; preds = %0
store i32 200, i32* %1
br label %6
5: ; preds = %0
store i32 300, i32* %1
br label %6
6: ; preds = %5, %4, %3
ret void
}

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

/* Variables and functions */
int offtin(int /*<<< orphan*/ *);
int /*<<< orphan*/ sporkel_bspatch_valid_header(int /*<<< orphan*/ *, int);
ssize_t sporkel_bspatch_newsize(u_char *patch, ssize_t patchsz) {
  if (!sporkel_bspatch_valid_header(patch, patchsz))
    return -1;
  return offtin(patch + 24);
}


x86 assembly (clang, -O0):
<sporkel_bspatch_newsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <sporkel_bspatch_valid_header@plt>
cmp    $0x0,%eax
jne    1150 <sporkel_bspatch_newsize+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <sporkel_bspatch_newsize+0x40>
mov    -0x10(%rbp),%rdi
add    $0x60,%rdi
call   1040 <offtin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sporkel_bspatch_newsize>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sporkel_bspatch_valid_header@plt>
test   %eax,%eax
je     113a <sporkel_bspatch_newsize+0x1a>
add    $0x60,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <offtin@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sporkel_bspatch_newsize(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %5
%8 = call i32 @sporkel_bspatch_valid_header(i32* %6, i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 -1, i32* %3
br label %15
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 24
%14 = call i32 @offtin(i32* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @sporkel_bspatch_newsize(i32* %0, i32 %1) {
%3 = tail call i32 @sporkel_bspatch_valid_header(i32* %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %0, i64 24
%7 = tail call i32 @offtin(i32* %6)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __randombytes_sysrandom_buf(int /*<<< orphan*/ *, int);
uint32_t __randombytes_sysrandom(void) {
  uint32_t r;
  __randombytes_sysrandom_buf(&r, sizeof r);
  return r;
}


x86 assembly (clang, -O0):
<__randombytes_sysrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <__randombytes_sysrandom_buf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__randombytes_sysrandom>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <__randombytes_sysrandom_buf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__randombytes_sysrandom() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @__randombytes_sysrandom_buf(i32* %1, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t unaligned64(const void *v) {
  struct Unaligned {
    uint64_t i;
  } __attribute__((packed));
  return ((const struct Unaligned *)v)->i;
}


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

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

LLVM IR (-O0):
%struct.Unaligned = type { i32 }
define i32 @unaligned64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.Unaligned*
%5 = getelementptr inbounds %struct.Unaligned, %struct.Unaligned* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @unaligned64(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_buf();
int /*<<< orphan*/ test_startswith();
int /*<<< orphan*/ test_startswithcase();
int /*<<< orphan*/ test_str();
int /*<<< orphan*/ test_strcasestrn();
int /*<<< orphan*/ test_strstrn();
int main(void) {
  test_str();
  test_buf();
  test_strstrn();
  test_strcasestrn();
  test_startswith();
  test_startswithcase();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_str@plt>
mov    $0x0,%al
call   1080 <test_buf@plt>
mov    $0x0,%al
call   1070 <test_strstrn@plt>
mov    $0x0,%al
call   1060 <test_strcasestrn@plt>
mov    $0x0,%al
call   1040 <test_startswith@plt>
mov    $0x0,%al
call   1050 <test_startswithcase@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_str@plt>
xor    %eax,%eax
call   1080 <test_buf@plt>
xor    %eax,%eax
call   1070 <test_strstrn@plt>
xor    %eax,%eax
call   1060 <test_strcasestrn@plt>
xor    %eax,%eax
call   1040 <test_startswith@plt>
xor    %eax,%eax
call   1050 <test_startswithcase@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_str()
%3 = call i32 (...) @test_buf()
%4 = call i32 (...) @test_strstrn()
%5 = call i32 (...) @test_strcasestrn()
%6 = call i32 (...) @test_startswith()
%7 = call i32 (...) @test_startswithcase()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_str()
%2 = tail call i32 (...) @test_buf()
%3 = tail call i32 (...) @test_strstrn()
%4 = tail call i32 (...) @test_strcasestrn()
%5 = tail call i32 (...) @test_startswith()
%6 = tail call i32 (...) @test_startswithcase()
ret i32 0
}
int test_imm_95uint16_reg(unsigned short val) {
  return ((val) & (0x95 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_95uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x95,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_95uint16_reg>:
test   $0x95,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_95uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 149
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int isClosingTag(char *tag) { return ('/' == tag[0]); }


x86 assembly (clang, -O0):
<isClosingTag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x2f,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isClosingTag>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isClosingTag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 47, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isClosingTag(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *monta_data(char *date) {
  struct tm lt;
  time_t t;
  time(&t);
  localtime_r(&t, &lt);
  strftime(date, 10, "%h-%d-%y", &lt);
  return date;
}


x86 assembly (clang, -O0):
<monta_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <time@plt>
lea    -0x14(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
lea    0xe9e(%rip),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monta_data>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
lea    0x8(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <localtime_r@plt>
lea    0xea0(%rip),%rdx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %r15,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%h-%d-%y\00"
define i8* @monta_data(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tm
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 @time(i32* %4)
%6 = call i32 @localtime_r(i32* %4, %struct.tm* %3)
%7 = load i8*, i8** %2
%8 = call i32 @strftime(i8* %7, i32 10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%h-%d-%y\00"
define i8* @monta_data(i8* returned %0) {
%2 = alloca %struct.tm
%3 = alloca i32
%4 = bitcast %struct.tm* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @time(i32* %3)
%7 = call i32 @localtime_r(i32* %3, %struct.tm* %2)
%8 = call i32 @strftime(i8* %0, i32 10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
ret i8* %0
}
int test_imm_D3uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xD3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D3uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xd3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D3uint64_midword_reg>:
test   $0xd30000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D3uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13828096
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_hex(unsigned char *s, size_t n) {
  unsigned int i;
  for (i = 0; i < n; ++i)
    printf("%02x", (unsigned int)s[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jae    115b <print_hex+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movzbl (%rax,%rcx,1),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <print_hex+0x17>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <print_hex+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    %r12,%rbx
jb     1140 <print_hex+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print_hex(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw nsw i64 %5, 1
%11 = and i64 %10, 4294967295
%12 = icmp ult i64 %11, %1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_session_get_remote_user(const char *session, char **remote_user) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_session_get_remote_user>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_session_get_remote_user(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_session_get_remote_user(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void avio_seek() {}


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

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

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

LLVM IR (-O2):
define void @avio_seek() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgc_exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void handle_quit() {
  printf("Bye.\n");
  fflush(stdout);
  cgc_exit(0);
}


x86 assembly (clang, -O0):
<handle_quit>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %edi,%edi
call   1040 <cgc_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_quit>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <cgc_exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Bye.\0A\00"
@stdout = global i32 0
define void @handle_quit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 @cgc_exit(i32 0)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [5 x i8] c"Bye.\00"
define void @handle_quit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @cgc_exit(i32 0)
ret void
}
unsigned int find_zero(const unsigned char *b) {
  unsigned int i;
  for (i = 0; *b != '\0' && i < (127 - 1); i++, b++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<find_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     112e <find_zero+0x2e>
cmpl   $0x7e,-0xc(%rbp)
setb   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113e <find_zero+0x3e>
jmp    115d <find_zero+0x5d>
jmp    1143 <find_zero+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <find_zero+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_zero>:
cmpb   $0x0,(%rdi)
je     1124 <find_zero+0x24>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
je     1123 <find_zero+0x23>
cmp    $0x7d,%ecx
mov    %rax,%rcx
jb     1110 <find_zero+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @find_zero(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp ult i32 %10, 126
br label %12
12: ; preds = %9, %4
%13 = phi i1 [ false, %4 ], [ %11, %9 ]
br i1 %13, label %14, label %20
14: ; preds = %12
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = add i32 %16, 1
store i32 %17, i32* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
br label %4
20: ; preds = %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @find_zero(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
%11 = icmp ult i32 %5, 125
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %4, label %13
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %14
}
/* Variables and functions */
int strerror_r(int, char *, size_t);
size_t strlen(char *);
size_t posix_strerror_r(int error_code, char *buffer, size_t buffer_size) {
  int r = strerror_r(error_code, buffer, buffer_size);
  if (r == 0) {
    return strlen(buffer);
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<posix_strerror_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <strerror_r@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1162 <posix_strerror_r+0x42>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x8(%rbp)
jmp    116a <posix_strerror_r+0x4a>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_strerror_r>:
push   %rbx
mov    %rsi,%rbx
call   1040 <strerror_r@plt>
test   %eax,%eax
je     1134 <posix_strerror_r+0x14>
mov    $0x1,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i64 @posix_strerror_r(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @strerror_r(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
br label %8
8: ; preds = %3, %6
%9 = phi i64 [ %7, %6 ], [ 1, %3 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ U_raw(int *, int *, int);
void U2(int *a, int *b) { U_raw(a, b, 2); }


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

x86 assembly (clang, -O2):
<U2>:
mov    $0x2,%edx
jmp    1030 <U_raw@plt>

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

LLVM IR (-O2):
define void @U2(i32* %0, i32* %1) {
%3 = tail call i32 @U_raw(i32* %0, i32* %1, i32 2)
ret void
}
extern void writew(unsigned short b, unsigned long addr) {
  *(volatile unsigned int *)((addr << 5) +
                             ((0xfffffc0000000000UL) + 0x200000000UL) + 0x08) =
      b * 0x00010001;
}


x86 assembly (clang, -O0):
<writew>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
imul   $0x10001,%eax,%ecx
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
movabs $0xfffffc0200000000,%rdx
fc ff ff
add    %rdx,%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writew>:
mov    %edi,%eax
shl    $0x10,%eax
or     %edi,%eax
shl    $0x5,%rsi
movabs $0xfffffc0200000008,%rcx
fc ff ff
mov    %eax,(%rsi,%rcx,1)
ret

LLVM IR (-O0):
define void @writew(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = mul nsw i32 %6, 65537
%8 = load i64, i64* %4
%9 = shl i64 %8, 5
%10 = add i64 %9, -4389456576512
%11 = add i64 %10, 8
%12 = inttoptr i64 %11 to i32*
store volatile i32 %7, i32* %12
ret void
}

LLVM IR (-O2):
define void @writew(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = mul nuw nsw i32 %3, 65537
%5 = shl i64 %1, 5
%6 = add i64 %5, -4389456576504
%7 = inttoptr i64 %6 to i32*
store volatile i32 %4, i32* %7
ret void
}