xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("Usage: udevadm control COMMAND\n"
         "  --log-priority=<level>   set the udev log level for the daemon\n"
         "  --stop-exec-queue        keep udevd from executing events, queue "
         "only\n"
         "  --start-exec-queue       execute events, flush queue\n"
         "  --reload-rules           reloads the rules files\n"
         "  --property=<KEY>=<value> set a global property for all events\n"
         "  --children-max=<N>       maximum number of children\n"
         "  --help                   print this help text\n\n");
}


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

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

LLVM IR (-O0):
@.str = [442 x i8] c"Usage: udevadm control COMMAND\0A --log-priority=<level> set the udev log level for the daemon\0A --stop-exec-queue keep udevd from executing events, queue only\0A --start-exec-queue execute events, flush queue\0A --reload-rules reloads the rules files\0A --property=<KEY>=<value> set a global property for all events\0A --children-max=<N> maximum number of children\0A --help print this help text\0A\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([442 x i8], [442 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [441 x i8] c"Usage: udevadm control COMMAND\0A --log-priority=<level> set the udev log level for the daemon\0A --stop-exec-queue keep udevd from executing events, queue only\0A --start-exec-queue execute events, flush queue\0A --reload-rules reloads the rules files\0A --property=<KEY>=<value> set a global property for all events\0A --children-max=<N> maximum number of children\0A --help print this help text\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([441 x i8], [441 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__12__GeneralIO__clr();
void Stm25pSpiP__CSN__clr(void) { Msp430GpioC__12__GeneralIO__clr(); }


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

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

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

LLVM IR (-O2):
define void @Stm25pSpiP__CSN__clr() {
%1 = tail call i32 (...) @Msp430GpioC__12__GeneralIO__clr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int main(void) {
  f();
  int y = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write_Z80_call_table();
int /*<<< orphan*/ write_Z80_makefile();
int main(int argc, char *argv[]) {
  write_Z80_makefile();
  write_Z80_call_table();
  exit(0);
}


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   1030 <write_Z80_makefile@plt>
mov    $0x0,%al
call   1040 <write_Z80_call_table@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <write_Z80_makefile@plt>
xor    %eax,%eax
call   1040 <write_Z80_call_table@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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 (...) @write_Z80_makefile()
%7 = call i32 (...) @write_Z80_call_table()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @write_Z80_makefile()
%4 = tail call i32 (...) @write_Z80_call_table()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EndAccessors();
void EndRuntime() { EndAccessors(); }


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

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

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

LLVM IR (-O2):
define void @EndRuntime() {
%1 = tail call i32 (...) @EndAccessors()
ret void
}
/* Variables and functions */
int TCSANOW;
int termios_tcsnow(void) { return TCSANOW; }


x86 assembly (clang, -O0):
<termios_tcsnow>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@TCSANOW = global i32 0
define i32 @termios_tcsnow() {
%1 = load i32, i32* @TCSANOW
ret i32 %1
}

LLVM IR (-O2):
@TCSANOW = global i32 0
define i32 @termios_tcsnow() {
%1 = load i32, i32* @TCSANOW
ret i32 %1
}
void tail(char *s) { int i = 0, k; }


x86 assembly (clang, -O0):
<tail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @tail(i8* nocapture %0) {
ret void
}
int f1(struct s1 *p) {
  return ((struct s6 { int j; } *)p)->j;
}


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

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

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

LLVM IR (-O2):
%struct.s1 = type opaque
define i32 @f1(%struct.s1* nocapture %0) {
%2 = bitcast %struct.s1* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _flockfile(int /*<<< orphan*/ *);
void _flockfile_debug_stub(FILE *fp, char *fname, int lineno) {
  _flockfile(fp);
}


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

x86 assembly (clang, -O2):
<_flockfile_debug_stub>:
jmp    1030 <_flockfile@plt>

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

LLVM IR (-O2):
define void @_flockfile_debug_stub(i32* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @_flockfile(i32* %0)
ret void
}
/* Variables and functions */
void __attribute__((no, noclone)) bar(uintptr_t a) {
  int *p = (int *)a;
  *p = 1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @bar(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @bar(i64 %0) {
%2 = inttoptr i64 %0 to i32*
store i32 1, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Ciao Mondo!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Ciao Mondo!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Ciao Mondo!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct terminal_t {
  int dummy;
};
struct parm_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal_t *, int, int /*<<< orphan*/);
int sum(struct parm_t *);
void curs_down(struct terminal_t *term, struct parm_t *parm) {
  int num = sum(parm);
  if (num <= 0)
    num = 1;
  move_cursor(term, num, 0);
}


x86 assembly (clang, -O0):
<curs_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sum@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     114d <curs_down+0x2d>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1040 <move_cursor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curs_down>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <sum@plt>
test   %eax,%eax
mov    $0x1,%esi
cmovg  %eax,%esi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1040 <move_cursor@plt>

LLVM IR (-O0):
%struct.terminal_t = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_down(%struct.terminal_t* %0, %struct.parm_t* %1) {
%3 = alloca %struct.terminal_t*
%4 = alloca %struct.parm_t*
%5 = alloca i32
store %struct.terminal_t* %0, %struct.terminal_t** %3
store %struct.parm_t* %1, %struct.parm_t** %4
%6 = load %struct.parm_t*, %struct.parm_t** %4
%7 = call i32 @sum(%struct.parm_t* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %5
br label %11
11: ; preds = %10, %2
%12 = load %struct.terminal_t*, %struct.terminal_t** %3
%13 = load i32, i32* %5
%14 = call i32 @move_cursor(%struct.terminal_t* %12, i32 %13, i32 0)
ret void
}

LLVM IR (-O2):
%struct.terminal_t = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_down(%struct.terminal_t* %0, %struct.parm_t* %1) {
%3 = tail call i32 @sum(%struct.parm_t* %1)
%4 = icmp sgt i32 %3, 1
%5 = select i1 %4, i32 %3, i32 1
%6 = tail call i32 @move_cursor(%struct.terminal_t* %0, i32 %5, i32 0)
ret void
}
/* Variables and functions */
int japi_graphiclabel(int, char *);
int j_graphiclabel(int arg0, char *arg1) {
  return (japi_graphiclabel(arg0, arg1));
}


x86 assembly (clang, -O0):
<j_graphiclabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <japi_graphiclabel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_graphiclabel>:
jmp    1030 <japi_graphiclabel@plt>

LLVM IR (-O0):
define i32 @j_graphiclabel(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @japi_graphiclabel(i32 %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @j_graphiclabel(i32 %0, i8* %1) {
%3 = tail call i32 @japi_graphiclabel(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, unsigned int,
                          char const *);
void __assert_fail(const char *assertion, const char *file, unsigned int line,
                   const char *func) {
  printf("Assertion '%s' failed, at file %s:%d, function %s\n", assertion, file,
         line, func);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<__assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <__assert_fail+0x32>

x86 assembly (clang, -O2):
<__assert_fail>:
push   %rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <__assert_fail+0x20>

LLVM IR (-O0):
@.str = [51 x i8] c"Assertion '%s' failed, at file %s:%d, function %s\0A\00"
define void @__assert_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11, i8* %12)
br label %14
14: ; preds = %14, %4
br label %14
}

LLVM IR (-O2):
@.str = [51 x i8] c"Assertion '%s' failed, at file %s:%d, function %s\0A\00"
define void @__assert_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2, i8* %3)
br label %6
6: ; preds = %6, %4
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int is_equal_string(const char *s1, const char *s2) { return !strcmp(s1, s2); }


x86 assembly (clang, -O0):
<is_equal_string>:
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,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_equal_string(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 i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_equal_string(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
char gcharminus(char x, char y) {
  x -= y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<gcharminus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
movsbl -0x1(%rbp),%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    1144 <gcharminus+0x34>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcharminus>:
push   %rbx
mov    %edi,%ebx
sub    %sil,%bl
jne    111f <gcharminus+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @gcharminus(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, %6
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = icmp ne i8 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 @foo(i8* null)
br label %15
15: ; preds = %13, %2
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @gcharminus(i8 signext %0, i8 signext %1) {
%3 = sub i8 %0, %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i8 %3
}
/* Variables and functions */
long internal__syscall2(long, long, long);
long __syscall2(long n, long a1, long a2) {
  return internal__syscall2(n, a1, a2);
}


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

x86 assembly (clang, -O2):
<__syscall2>:
jmp    1030 <internal__syscall2@plt>

LLVM IR (-O0):
define i64 @__syscall2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i64 @internal__syscall2(i64 %7, i64 %8, i64 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @__syscall2(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @internal__syscall2(i64 %0, i64 %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_bytes_to_string();
int /*<<< orphan*/ test_string_to_bytes();
int main(void) {
  test_string_to_bytes();
  test_bytes_to_string();
  printf("\n  \e[32m\u2713 \e[90mok\e[0m\n\n");
  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_string_to_bytes@plt>
mov    $0x0,%al
call   1050 <test_bytes_to_string@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_string_to_bytes@plt>
xor    %eax,%eax
call   1050 <test_bytes_to_string@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0A \1B[32m\E2\9C\93 \1B[90mok\1B[0m\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_string_to_bytes()
%3 = call i32 (...) @test_bytes_to_string()
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"\0A \1B[32m\E2\9C\93 \1B[90mok\1B[0m\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @test_string_to_bytes()
%2 = tail call i32 (...) @test_bytes_to_string()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long long osfreq();
long long cpucycles_x86cpuinfo_persecond(void) { return osfreq(); }


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

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

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

LLVM IR (-O2):
define i64 @cpucycles_x86cpuinfo_persecond() {
%1 = tail call i64 (...) @osfreq()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, char, int);
int strlen(char *);
void trixCopyToPrefix(char *word, char *prefix) {
  int len = strlen(word);
  if (len >= 5)
    memcpy(prefix, word, 5);
  else {
    memset(prefix, ' ', 5);
    memcpy(prefix, word, len);
  }
}


x86 assembly (clang, -O0):
<trixCopyToPrefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jl     116d <trixCopyToPrefix+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x5,%edx
call   1050 <memcpy@plt>
jmp    1190 <trixCopyToPrefix+0x60>
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
mov    $0x5,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trixCopyToPrefix>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x5,%edx
cmp    $0x4,%eax
jg     115f <trixCopyToPrefix+0x2f>
mov    %eax,%ebp
mov    %r14,%rdi
mov    $0x20,%esi
mov    $0x5,%edx
call   1040 <memset@plt>
mov    %ebp,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <memcpy@plt>

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

LLVM IR (-O2):
define void @trixCopyToPrefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 4
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memset(i8* %1, i8 signext 32, i32 5)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %3, %5 ], [ 5, %2 ]
%9 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_scalb();
scalar_t__ scalb(double, double);
void test_scalb(double d1, double d2) {
  if (scalb(d1, d2) != scalb(d1, d2))
    link_failure_scalb();
}


x86 assembly (clang, -O0):
<test_scalb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <scalb@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <scalb@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_scalb+0x4b>
mov    $0x0,%al
call   1030 <link_failure_scalb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scalb>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1040 <scalb@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <scalb@plt>
cmp    %rax,%rbx
jne    1153 <test_scalb+0x33>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_scalb@plt>

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

LLVM IR (-O2):
define void @test_scalb(double %0, double %1) {
%3 = tail call i64 @scalb(double %0, double %1)
%4 = tail call i64 @scalb(double %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_scalb()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void printhelp(FILE *out, char *app) {
  fprintf(out, "Usage: %s <command> <dirs to watch>\n", app);
}


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

x86 assembly (clang, -O2):
<printhelp>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: %s <command> <dirs to watch>\0A\00"
define void @printhelp(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Usage: %s <command> <dirs to watch>\0A\00"
define void @printhelp(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ times2(int, int);
int main(int argc, char *argv[]) {
  int x, y;
  x = 3;
  y = 4;
  times2(x, y);
  printf("x = %d, y = %d\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <times2@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"x = %d, y = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @times2(i32 3, i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3, i32 4)
ret i32 0
}
int optoi(int op) {
  int opi;
  switch (op) {
  case '+':
    opi = 1;
    break;
  case '-':
    opi = 2;
    break;
  case '*':
    opi = 3;
    break;
  case '/':
    opi = 4;
    break;
  case '(':
    opi = 5;
    break;
  case ')':
    opi = 6;
    break;
  case '#':
    opi = 7;
    break;
  default:
    opi = 0;
  }
  return opi;
}


x86 assembly (clang, -O0):
<optoi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffdd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xc,%eax
ja     1184 <optoi+0x84>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    118b <optoi+0x8b>
movl   $0x2,-0x8(%rbp)
jmp    118b <optoi+0x8b>
movl   $0x3,-0x8(%rbp)
jmp    118b <optoi+0x8b>
movl   $0x4,-0x8(%rbp)
jmp    118b <optoi+0x8b>
movl   $0x5,-0x8(%rbp)
jmp    118b <optoi+0x8b>
movl   $0x6,-0x8(%rbp)
jmp    118b <optoi+0x8b>
movl   $0x7,-0x8(%rbp)
jmp    118b <optoi+0x8b>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<optoi>:
add    $0xffffffdd,%edi
xor    %eax,%eax
cmp    $0xc,%edi
ja     1117 <optoi+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @optoi(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %12 [
i32 43, label %5
i32 45, label %6
i32 42, label %7
i32 47, label %8
i32 40, label %9
i32 41, label %10
i32 35, label %11
]
5: ; preds = %1
store i32 1, i32* %3
br label %13
6: ; preds = %1
store i32 2, i32* %3
br label %13
7: ; preds = %1
store i32 3, i32* %3
br label %13
8: ; preds = %1
store i32 4, i32* %3
br label %13
9: ; preds = %1
store i32 5, i32* %3
br label %13
10: ; preds = %1
store i32 6, i32* %3
br label %13
11: ; preds = %1
store i32 7, i32* %3
br label %13
12: ; preds = %1
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@switch.table.optoi = [13 x i32] [i32 7, i32 0, i32 0, i32 0, i32 0, i32 5, i32 6, i32 3, i32 1, i32 0, i32 2, i32 0, i32 4]
define i32 @optoi(i32 %0) {
%2 = add i32 %0, -35
%3 = icmp ult i32 %2, 13
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [13 x i32], [13 x i32]* @switch.table.optoi, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int strlen(const char *str) {
  int len = 0;
  while ((*str++) != '\0')
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <strlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

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

/* Variables and functions */
char *get_tmp_dir();
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
char *get_pid_file(void) {
  static char pid_file[2048];
  if (!pid_file[0])
    snprintf(pid_file, sizeof(pid_file), "%s/pid-wakeup", get_tmp_dir());
  return pid_file;
}


x86 assembly (clang, -O0):
<get_pid_file>:
push   %rbp
mov    %rsp,%rbp
cmpb   $0x0,0x2f15(%rip)
jne    1153 <get_pid_file+0x33>
mov    $0x0,%al
call   1040 <get_tmp_dir@plt>
mov    %rax,%rcx
lea    0x2efe(%rip),%rdi
mov    $0x800,%esi
lea    0xeb2(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ee6(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pid_file>:
push   %rax
cmpb   $0x0,0x2f18(%rip)
jne    114c <get_pid_file+0x2c>
xor    %eax,%eax
call   1040 <get_tmp_dir@plt>
lea    0x2f08(%rip),%rdi
lea    0xec1(%rip),%rdx
mov    $0x800,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
lea    0x2eed(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@get_pid_file.pid_file = internal global [2048 x i8] zeroinitializer
@.str = [14 x i8] c"%s/pid-wakeup\00"
define i8* @get_pid_file() {
%1 = load i8, i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @get_pid_file.pid_file, i64 0, i64 0)
%2 = icmp ne i8 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i8* (...) @get_tmp_dir()
%5 = call i32 @snprintf(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @get_pid_file.pid_file, i64 0, i64 0), i32 2048, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %6
6: ; preds = %3, %0
ret i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @get_pid_file.pid_file, i64 0, i64 0)
}

LLVM IR (-O2):
@get_pid_file.pid_file = internal global [2048 x i8] zeroinitializer
@.str = [14 x i8] c"%s/pid-wakeup\00"
define i8* @get_pid_file() {
%1 = load i8, i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @get_pid_file.pid_file, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i8* (...) @get_tmp_dir()
%5 = tail call i32 @snprintf(i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @get_pid_file.pid_file, i64 0, i64 0), i32 2048, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %6
6: ; preds = %3, %0
ret i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @get_pid_file.pid_file, i64 0, i64 0)
}
int strcmp(const char *s1, const char *s2) {
  signed char res;
  while (1) {
    if (((res = *s1 - *(s2++)) != 0) || (!*(s1++)))
      break;
  }
  return res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jne    114e <strcmp+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1153 <strcmp+0x53>
jmp    1158 <strcmp+0x58>
jmp    110c <strcmp+0xc>
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%edx
mov    %edx,%ecx
sub    (%rsi,%rax,1),%cl
test   %dl,%dl
je     1125 <strcmp+0x25>
add    $0x1,%rax
test   %cl,%cl
je     1110 <strcmp+0x10>
movsbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(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 = %2, %24
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %9, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %6
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
%21 = load i8, i8* %19
%22 = icmp ne i8 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %18, %6
br label %25
24: ; preds = %18
br label %6
25: ; preds = %23
%26 = load i8, i8* %5
%27 = sext i8 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %10, %3 ]
%5 = phi i8* [ %0, %2 ], [ %11, %3 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = sub i8 %6, %7
%9 = icmp ne i8 %8, 0
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %6, 0
%13 = or i1 %12, %9
br i1 %13, label %14, label %3
14: ; preds = %3
%15 = sext i8 %8 to i32
ret i32 %15
}
char *audio_system_name(int system) { return ("unknown"); }


x86 assembly (clang, -O0):
<audio_system_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_system_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @audio_system_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @audio_system_name(i32 %0) {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int mgetch();
int /*<<< orphan*/ mungetc();
nextsymbol() {
  int c;
  c = mgetch();
  mungetc();
  return (c);
}


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

x86 assembly (clang, -O2):
<nextsymbol>:
push   %rbx
xor    %eax,%eax
call   1030 <mgetch@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <mungetc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nextsymbol() {
%1 = alloca i32
%2 = call i32 (...) @mgetch()
store i32 %2, i32* %1
%3 = call i32 (...) @mungetc()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @nextsymbol() {
%1 = tail call i32 (...) @mgetch()
%2 = tail call i32 (...) @mungetc()
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long backing_planes;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
void set_XSetWindowAttributes_backing_planes(void *_p, unsigned long _v) {
  ((XSetWindowAttributes *)_p)->backing_planes = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XSetWindowAttributes_backing_planes(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_in_range_2(int, int);
int /*<<< orphan*/ assert_in_wide_range(int);
int /*<<< orphan*/ clang_analyzer_eval(int);
void less(int m, int n) {
  assert_in_range_2(m, n);
  if (m <= n)
    return;
  assert_in_wide_range(m - n);
  clang_analyzer_eval(n < m);
}


x86 assembly (clang, -O0):
<less>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <assert_in_range_2@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115a <less+0x2a>
jmp    1178 <less+0x48>
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1040 <assert_in_wide_range@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<less>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <assert_in_range_2@plt>
sub    %ebp,%ebx
jle    1157 <less+0x27>
mov    %ebx,%edi
call   1040 <assert_in_wide_range@plt>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <clang_analyzer_eval@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @less(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 @assert_in_range_2(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
br label %22
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = call i32 @assert_in_wide_range(i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
%20 = zext i1 %19 to i32
%21 = call i32 @clang_analyzer_eval(i32 %20)
br label %22
22: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @less(i32 %0, i32 %1) {
%3 = tail call i32 @assert_in_range_2(i32 %0, i32 %1)
%4 = icmp sgt i32 %0, %1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = sub nsw i32 %0, %1
%7 = tail call i32 @assert_in_wide_range(i32 %6)
%8 = tail call i32 @clang_analyzer_eval(i32 1)
br label %9
9: ; preds = %2, %5
ret void
}
void rop3_40_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk1 = *D & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

x86 assembly (clang, -O2):
<rop3_40_0_1>:
xor    %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_40_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %6
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = or i32 %26, %32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = and i32 %39, %42
%44 = or i32 %33, %43
%45 = trunc i32 %44 to i8
%46 = load i8*, i8** %4
store i8 %45, i8* %46
ret void
}

LLVM IR (-O2):
define void @rop3_40_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, %2
%6 = and i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
unsigned int hash(unsigned int seed, const char *s) {
  assert(s);
  unsigned char *p;
  for (p = (unsigned char *)s; *p != '\0'; p++) {
    seed *= 37;
    seed ^= *p;
  }
  return seed;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <hash+0x55>
imul   $0x25,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <hash+0x20>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <assert@plt>
mov    (%r14),%al
test   %al,%al
je     1147 <hash+0x37>
add    $0x1,%r14
nopl   0x0(%rax)
movzbl %al,%eax
lea    (%rbx,%rbx,8),%ecx
lea    (%rbx,%rcx,4),%ebx
xor    %eax,%ebx
movzbl (%r14),%eax
add    $0x1,%r14
test   %al,%al
jne    1130 <hash+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @hash(i32 %0, i8* %1) {
%3 = tail call i32 @assert(i8* %1)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %14, %6 ], [ %4, %2 ]
%8 = phi i8* [ %13, %6 ], [ %1, %2 ]
%9 = phi i32 [ %12, %6 ], [ %0, %2 ]
%10 = zext i8 %7 to i32
%11 = mul i32 %9, 37
%12 = xor i32 %11, %10
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i32 [ %0, %2 ], [ %12, %6 ]
ret i32 %17
}
int os_mkdir(const char *filename, unsigned int mode, int *rc) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @os_mkdir(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void deparse_byte_buf(uint8_t *dst, uint8_t *src, int len) {
  memcpy(dst, src, len);
}


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

x86 assembly (clang, -O2):
<deparse_byte_buf>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @deparse_byte_buf(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 @memcpy(i32* %7, i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @deparse_byte_buf(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @memcpy(i32* %0, i32* %1, i32 %2)
ret void
}
int hostapd_check_ht_capab(struct hostapd_iface *iface) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define i32 @hostapd_check_ht_capab(%struct.hostapd_iface* nocapture readnone %0) {
ret i32 0
}