xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void showHelp(FILE *f) {
  fprintf(
      f,
      "Usage: ookdump [-h] [-?] [-v] [-a mcastaddr] [-p mcastport] [-i "
      "mcastinterface]\n"
      "  -h | -? | --help                      display usage and exit\n"
      "  -v | --verbose                        verbose logging\n"
      "  -a addr | --multicast-address addr    multicast address, default "
      "236.0.0.1\n"
      "  -p port | --multicast-port port       multicast port, default 3636\n"
      "  -i addr | --multicast-interface addr  address of the multicast "
      "interface, default 127.0.0.1\n");
}


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

x86 assembly (clang, -O2):
<showHelp>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1b7,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [440 x i8] c"Usage: ookdump [-h] [-?] [-v] [-a mcastaddr] [-p mcastport] [-i mcastinterface]\0A -h | -? | --help display usage and exit\0A -v | --verbose verbose logging\0A -a addr | --multicast-address addr multicast address, default 236.0.0.1\0A -p port | --multicast-port port multicast port, default 3636\0A -i addr | --multicast-interface addr address of the multicast interface, default 127.0.0.1\0A\00"
define void @showHelp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([440 x i8], [440 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [440 x i8] c"Usage: ookdump [-h] [-?] [-v] [-a mcastaddr] [-p mcastport] [-i mcastinterface]\0A -h | -? | --help display usage and exit\0A -v | --verbose verbose logging\0A -a addr | --multicast-address addr multicast address, default 236.0.0.1\0A -p port | --multicast-port port multicast port, default 3636\0A -i addr | --multicast-interface addr address of the multicast interface, default 127.0.0.1\0A\00"
define void @showHelp(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([440 x i8], [440 x i8]* @.str, i64 0, i64 0), i64 439, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xa1() {
  Assert_real((islower(161) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              810, ("islower should be 0 for 0xa1"));
}


x86 assembly (clang, -O0):
<t_islower_0xa1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa1,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x32a,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xa1>:
push   %rax
mov    $0xa1,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x32a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa1\00"
define void @t_islower_0xa1() {
%1 = call i64 @islower(i32 161)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa1\00"
define void @t_islower_0xa1() {
%1 = tail call i64 @islower(i32 161)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int do_134() { return 134; }


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

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

LLVM IR (-O0):
define i32 @do_134() {
ret i32 134
}

LLVM IR (-O2):
define i32 @do_134() {
ret i32 134
}
/* Variables and functions */
int bar();
int foo() {
  int a[32];
  return foo() + bar() + a[0];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
call   1040 <foo@plt>
mov    %eax,-0x84(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
add    %ecx,%eax
add    -0x80(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca [32 x i32]
%2 = call i32 @foo()
%3 = call i32 (...) @bar()
%4 = add nsw i32 %2, %3
%5 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %5
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 @foo()
%2 = tail call i32 (...) @bar()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ keepalive;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_KEEPALIVE;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              void *, int);
void socket_keepalive(int fd) {
  int keepalive = 1;
  setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (void *)&keepalive,
             sizeof(keepalive));
}


x86 assembly (clang, -O0):
<socket_keepalive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_keepalive>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define void @socket_keepalive(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_KEEPALIVE
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define void @socket_keepalive(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_KEEPALIVE
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void signal_callback_handler(int signum) {
  printf("Caught signal %d\n", signum);
  exit(1);
}


x86 assembly (clang, -O0):
<signal_callback_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_callback_handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @signal_callback_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @signal_callback_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int decode_atom_format_6_1(unsigned char const *, struct stream *);
int decode_atom_format_6_10(const unsigned char *pkt, struct stream *stream) {
  return decode_atom_format_6_1(pkt, stream);
}


x86 assembly (clang, -O0):
<decode_atom_format_6_10>:
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 <decode_atom_format_6_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_atom_format_6_10>:
jmp    1030 <decode_atom_format_6_1@plt>

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

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_atom_format_6_10(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_atom_format_6_1(i8* %0, %struct.stream* %1)
ret i32 %3
}
int rand_hop_0() {}


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

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

LLVM IR (-O0):
define i32 @rand_hop_0() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @rand_hop_0() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ semihost(int, void *);
__attribute__((noreturn)) void quit_failure(void) {
  semihost(0x18, (void *)0x0);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<quit_failure>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <semihost@plt>
jmp    1122 <quit_failure+0x12>

x86 assembly (clang, -O2):
<quit_failure>:
push   %rax
mov    $0x18,%edi
xor    %esi,%esi
call   1030 <semihost@plt>
nopl   (%rax)
jmp    1120 <quit_failure+0x10>

LLVM IR (-O0):
define void @quit_failure() {
%1 = call i32 @semihost(i32 24, i8* null)
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @quit_failure() {
%1 = tail call i32 @semihost(i32 24, i8* null)
br label %2
2: ; preds = %0, %2
br label %2
}
int test_imm_B3uint8_mem(unsigned char *val) {
  return ((*val) & (-0xB3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B3uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff4d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B3uint8_mem>:
testb  $0x4d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B3uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 77
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ asinf(float);
int /*<<< orphan*/ link_failure_asinf();
void test_asinf(float f) {
  if (asinf(f) != asinf(f))
    link_failure_asinf();
}


x86 assembly (clang, -O0):
<test_asinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <asinf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <asinf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_asinf+0x3c>
mov    $0x0,%al
call   1030 <link_failure_asinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_asinf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <asinf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <asinf@plt>
cmp    %rax,%rbx
jne    1149 <test_asinf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_asinf@plt>

LLVM IR (-O0):
define void @test_asinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @asinf(float %3)
%5 = load float, float* %2
%6 = call i64 @asinf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_asinf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_asinf(float %0) {
%2 = tail call i64 @asinf(float %0)
%3 = tail call i64 @asinf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_asinf()
br label %7
7: ; preds = %5, %1
ret void
}
void gdk_gc_set_rgb_fg_color() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_set_rgb_fg_color() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage_error(char **argv) {
  fprintf(stderr, "usage: %s {export|unexport} <gpio-pin> [pullup|pulldown]\n",
          argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"usage: %s {export|unexport} <gpio-pin> [pullup|pulldown]\0A\00"
define void @usage_error(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"usage: %s {export|unexport} <gpio-pin> [pullup|pulldown]\0A\00"
define void @usage_error(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int a_fun();
int /*<<< orphan*/ does_it_work();
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int main() {
  if (strcmp(does_it_work(), "yes it does") != 0) {
    return -a_fun();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <does_it_work@plt>
mov    %eax,%edi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1173 <main+0x43>
mov    $0x0,%al
call   1030 <a_fun@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <main+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <does_it_work@plt>
lea    0xebf(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1158 <main+0x28>
xor    %eax,%eax
call   1030 <a_fun@plt>
mov    %eax,%ebx
neg    %ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"yes it does\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @does_it_work()
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 (...) @a_fun()
%7 = sub nsw i32 0, %6
store i32 %7, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"yes it does\00"
define i32 @main() {
%1 = tail call i32 (...) @does_it_work()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 (...) @a_fun()
%6 = sub nsw i32 0, %5
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ %6, %4 ], [ 0, %0 ]
ret i32 %8
}
int test_imm_AEuint32_mem(unsigned int *val) {
  return ((*val) & (0xAE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AEuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xae,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_AEuint32_mem>:
testb  $0xae,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_AEuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 174
%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_AEuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 174
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void Msp430TimerCapComP__6__Compare__default__fired(void) {}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCapComP__6__Compare__default__fired() {
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int randomPiece(void) {
  int i, j;
  i = RAND_MAX / 15;
  i *= 15;
  while ((j = rand()) >= i) {
    continue;
  }
  return (j % 16);
}


x86 assembly (clang, -O0):
<randomPiece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
imul   $0xf,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
cmp    -0x4(%rbp),%eax
jl     114b <randomPiece+0x3b>
jmp    1133 <randomPiece+0x23>
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomPiece>:
push   %rbx
mov    0x2ed0(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x3,%ecx
add    %eax,%ecx
lea    (%rcx,%rcx,4),%eax
lea    (%rax,%rax,2),%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %ebx,%eax
jge    1140 <randomPiece+0x30>
lea    0xf(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff0,%ecx
sub    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @randomPiece() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @RAND_MAX
%4 = sdiv i32 %3, 15
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 15
store i32 %6, i32* %1
br label %7
7: ; preds = %11, %0
%8 = call i32 (...) @rand()
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
%13 = load i32, i32* %2
%14 = srem i32 %13, 16
ret i32 %14
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @randomPiece() {
%1 = load i32, i32* @RAND_MAX
%2 = srem i32 %1, 15
%3 = sub i32 %1, %2
br label %4
4: ; preds = %4, %0
%5 = tail call i32 (...) @rand()
%6 = icmp slt i32 %5, %3
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = srem i32 %5, 16
ret i32 %8
}
/* Type definitions */
struct chat_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ endwin();
void ui_end(struct chat_state *state) {
  (void)state;
  endwin();
}


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

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

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

LLVM IR (-O2):
%struct.chat_state = type { i32 }
define void @ui_end(%struct.chat_state* nocapture readnone %0) {
%2 = tail call i32 (...) @endwin()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void SysCtlIntClear(uint32_t ui32Ints) {
  (*((volatile uint32_t *)(0x400FE058))) = ui32Ints;
}


x86 assembly (clang, -O0):
<SysCtlIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fe058,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlIntClear>:
mov    %edi,0x400fe058
ret

LLVM IR (-O0):
define void @SysCtlIntClear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1074782296 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlIntClear(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1074782296 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ getppid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void timerElapsed(int sig) {
  kill(getppid(), SIGUSR1);
  return;
}


x86 assembly (clang, -O0):
<timerElapsed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getppid@plt>
mov    %eax,%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerElapsed>:
push   %rax
xor    %eax,%eax
call   1040 <getppid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define void @timerElapsed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getppid()
%4 = load i32, i32* @SIGUSR1
%5 = call i32 @kill(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define void @timerElapsed(i32 %0) {
%2 = tail call i32 (...) @getppid()
%3 = load i32, i32* @SIGUSR1
%4 = tail call i32 @kill(i32 %2, i32 %3)
ret void
}
int conv(char s) {
  int x = 0;
  switch (s) {
  case 'I':
    x = 1;
    break;
  case 'V':
    x = 5;
    break;
  case 'X':
    x = 10;
    break;
  case 'L':
    x = 50;
    break;
  case 'C':
    x = 100;
    break;
  default:
    x = 0;
    break;
  }
  return x;
}


x86 assembly (clang, -O0):
<conv>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1177 <conv+0x77>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    117e <conv+0x7e>
movl   $0x5,-0x8(%rbp)
jmp    117e <conv+0x7e>
movl   $0xa,-0x8(%rbp)
jmp    117e <conv+0x7e>
movl   $0x32,-0x8(%rbp)
jmp    117e <conv+0x7e>
movl   $0x64,-0x8(%rbp)
jmp    117e <conv+0x7e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     1123 <conv+0x23>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
xor    %eax,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @conv(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
]
6: ; preds = %1
store i32 1, i32* %3
br label %12
7: ; preds = %1
store i32 5, i32* %3
br label %12
8: ; preds = %1
store i32 10, i32* %3
br label %12
9: ; preds = %1
store i32 50, i32* %3
br label %12
10: ; preds = %1
store i32 100, i32* %3
br label %12
11: ; preds = %1
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @conv(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 73, label %8
i32 86, label %3
i32 88, label %4
i32 76, label %5
i32 67, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 0, %7 ], [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %9
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int my_sigaction(int, struct sigaction const *, struct sigaction *);
int _sigaction(int signum, const struct sigaction *act,
               struct sigaction *oldact) {
  return my_sigaction(signum, act, oldact);
}


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

x86 assembly (clang, -O2):
<_sigaction>:
jmp    1030 <my_sigaction@plt>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
define i32 @_sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = alloca i32
%5 = alloca %struct.sigaction*
%6 = alloca %struct.sigaction*
store i32 %0, i32* %4
store %struct.sigaction* %1, %struct.sigaction** %5
store %struct.sigaction* %2, %struct.sigaction** %6
%7 = load i32, i32* %4
%8 = load %struct.sigaction*, %struct.sigaction** %5
%9 = load %struct.sigaction*, %struct.sigaction** %6
%10 = call i32 @my_sigaction(i32 %7, %struct.sigaction* %8, %struct.sigaction* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
define i32 @_sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = tail call i32 @my_sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
int ceil(int /*<<< orphan*/);
int /*<<< orphan*/ log10(int /*<<< orphan*/);
int istrlen(int someint) {
  if (someint == 0)
    return 1;
  return ceil(log10(abs(someint))) + (someint < 0);
}


x86 assembly (clang, -O0):
<istrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1151 <istrlen+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1179 <istrlen+0x49>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1050 <log10@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
cmpl   $0x0,-0x8(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<istrlen>:
push   %rbx
test   %edi,%edi
je     113f <istrlen+0x1f>
mov    %edi,%ebx
neg    %edi
cmovs  %ebx,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
shr    $0x1f,%ebx
add    %eax,%ebx
jmp    1144 <istrlen+0x24>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @istrlen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @abs(i32 %8)
%10 = call i32 @log10(i32 %9)
%11 = call i32 @ceil(i32 %10)
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 0
%14 = zext i1 %13 to i32
%15 = add nsw i32 %11, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %7, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @istrlen(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%5 = tail call i32 @log10(i32 %4)
%6 = tail call i32 @ceil(i32 %5)
%7 = lshr i32 %0, 31
%8 = add nsw i32 %6, %7
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 1, %1 ]
ret i32 %10
}
double vde_chain_nm10_sq(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<vde_chain_nm10_sq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @vde_chain_nm10_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int semctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int remove_semaphore(int *semid, char *name) {
  int status;
  status = semctl(*semid, IPC_RMID, 0);
  if (status < 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<remove_semaphore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <semctl@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    114f <remove_semaphore+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1156 <remove_semaphore+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_semaphore>:
push   %rax
mov    (%rdi),%edi
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <semctl@plt>
not    %eax
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @remove_semaphore(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* @IPC_RMID
%10 = call i32 @semctl(i32 %8, i32 %9, i32 0)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %15
14: ; preds = %2
store i32 1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @remove_semaphore(i32* nocapture %0, i8* nocapture readnone %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* @IPC_RMID
%5 = tail call i32 @semctl(i32 %3, i32 %4, i32 0)
%6 = xor i32 %5, -1
%7 = lshr i32 %6, 31
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ stderr;
void debug(unsigned int dbg) { fprintf(stderr, "[DEBUG] %d\n", dbg); }


x86 assembly (clang, -O0):
<debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"[DEBUG] %d\0A\00"
define void @debug(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"[DEBUG] %d\0A\00"
define void @debug(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ isupper(char const);
int get_num_elems(const char *in) {
  int out = 0;
  while (*in) {
    if (isupper(*in))
      out++;
    in++;
  }
  return out;
}


x86 assembly (clang, -O0):
<get_num_elems>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <get_num_elems+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     114f <get_num_elems+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <get_num_elems+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_elems>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114c <get_num_elems+0x3c>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isupper@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <get_num_elems+0x20>
jmp    114e <get_num_elems+0x3e>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_num_elems(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = tail call i64 @isupper(i8 signext %5)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t motorcontrol(uint8_t motor_a, uint8_t motor_b, uint8_t motor_c,
                     uint8_t motor_d, uint8_t *channel_a, uint8_t *channel_b,
                     uint8_t *channel_c, uint8_t *channel_d) {
  return 0;
}


x86 assembly (clang, -O0):
<motorcontrol>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @motorcontrol(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
ret i32 0
}

LLVM IR (-O2):
define i32 @motorcontrol(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5, i32* nocapture readnone %6, i32* nocapture readnone %7) {
ret i32 0
}
void SIO1_about(void) {}


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

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

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

LLVM IR (-O2):
define void @SIO1_about() {
ret void
}
/* Type definitions */
struct intf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ARPOP_REPLY;
int /*<<< orphan*/ arp_packet_send(int, struct intf *, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
void arp_defend(int as, struct intf *intf) {
  arp_packet_send(as, intf, ARPOP_REPLY, 0);
}


x86 assembly (clang, -O0):
<arp_defend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <arp_packet_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arp_defend>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
jmp    1030 <arp_packet_send@plt>

LLVM IR (-O0):
%struct.intf = type { i32 }
@ARPOP_REPLY = global i32 0
define void @arp_defend(i32 %0, %struct.intf* %1) {
%3 = alloca i32
%4 = alloca %struct.intf*
store i32 %0, i32* %3
store %struct.intf* %1, %struct.intf** %4
%5 = load i32, i32* %3
%6 = load %struct.intf*, %struct.intf** %4
%7 = load i32, i32* @ARPOP_REPLY
%8 = call i32 @arp_packet_send(i32 %5, %struct.intf* %6, i32 %7, i32 0)
ret void
}

LLVM IR (-O2):
%struct.intf = type { i32 }
@ARPOP_REPLY = global i32 0
define void @arp_defend(i32 %0, %struct.intf* %1) {
%3 = load i32, i32* @ARPOP_REPLY
%4 = tail call i32 @arp_packet_send(i32 %0, %struct.intf* %1, i32 %3, i32 0)
ret void
}
/* Variables and functions */
char *ltrim(char *);
char *rtrim(char *);
extern char *trim(const char *str) {
  char *cur = (char *)str;
  cur = ltrim(cur);
  cur = rtrim(cur);
  return (cur);
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rax
call   1040 <ltrim@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <rtrim@plt>

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @ltrim(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @rtrim(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = tail call i8* @ltrim(i8* %0)
%3 = tail call i8* @rtrim(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int funct(int p) {
  int i;
  char array[128];
  for (i = 0; i < 128; i++)
    array[i] = 'c';
  if (p == 0) {
    sleep(100000);
    return 0;
  } else {
    return funct(p - 1);
  }
}


x86 assembly (clang, -O0):
<funct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    115c <funct+0x3c>
movslq -0xc(%rbp),%rax
movb   $0x63,-0x90(%rbp,%rax,1)
63
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <funct+0x15>
cmpl   $0x0,-0x8(%rbp)
jne    117c <funct+0x5c>
mov    $0x186a0,%edi
call   1040 <sleep@plt>
movl   $0x0,-0x4(%rbp)
jmp    118a <funct+0x6a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <funct@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funct>:
push   %rax
mov    $0x186a0,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @funct(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [128 x i8]
store i32 %0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %13, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 128
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 %11
store i8 99, i8* %12
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %6
16: ; preds = %6
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @sleep(i32 100000)
store i32 0, i32* %2
br label %25
21: ; preds = %16
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 1
%24 = call i32 @funct(i32 %23)
store i32 %24, i32* %2
br label %25
25: ; preds = %21, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @funct(i32 %0) {
%2 = tail call i32 @sleep(i32 100000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void sleep() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @sleep() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_bind();
int /*<<< orphan*/ test_listen_bound();
int /*<<< orphan*/ test_listen_unbound();
int /*<<< orphan*/ test_socket();
int /*<<< orphan*/ test_socketpair();
int main(int argc, char *argv[]) {
  test_socket();
  test_socketpair();
  test_listen_unbound();
  test_bind();
  test_listen_bound();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <test_socket@plt>
mov    $0x0,%al
call   1030 <test_socketpair@plt>
mov    $0x0,%al
call   1050 <test_listen_unbound@plt>
mov    $0x0,%al
call   1040 <test_bind@plt>
mov    $0x0,%al
call   1060 <test_listen_bound@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_socket@plt>
xor    %eax,%eax
call   1030 <test_socketpair@plt>
xor    %eax,%eax
call   1050 <test_listen_unbound@plt>
xor    %eax,%eax
call   1040 <test_bind@plt>
xor    %eax,%eax
call   1060 <test_listen_bound@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @test_socket()
%6 = call i32 (...) @test_socketpair()
%7 = call i32 (...) @test_listen_unbound()
%8 = call i32 (...) @test_bind()
%9 = call i32 (...) @test_listen_bound()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_socket()
%4 = tail call i32 (...) @test_socketpair()
%5 = tail call i32 (...) @test_listen_unbound()
%6 = tail call i32 (...) @test_bind()
%7 = tail call i32 (...) @test_listen_bound()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ box_boolean(int);
int /*<<< orphan*/ dpop();
double untag_float_fast(int /*<<< orphan*/);
void primitive_float_lesseq(void) {
  double y = untag_float_fast(dpop());
  double x = untag_float_fast(dpop());
  ;
  box_boolean(x <= y);
}


x86 assembly (clang, -O0):
<primitive_float_lesseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <box_boolean@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_lesseq>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
xor    %edi,%edi
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %dil
pop    %rax
jmp    1040 <box_boolean@plt>

LLVM IR (-O0):
define void @primitive_float_lesseq() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (...) @dpop()
%4 = call double @untag_float_fast(i32 %3)
store double %4, double* %1
%5 = call i32 (...) @dpop()
%6 = call double @untag_float_fast(i32 %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = load double, double* %1
%9 = fcmp ole double %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @box_boolean(i32 %10)
ret void
}

LLVM IR (-O2):
define void @primitive_float_lesseq() {
%1 = tail call i32 (...) @dpop()
%2 = tail call double @untag_float_fast(i32 %1)
%3 = tail call i32 (...) @dpop()
%4 = tail call double @untag_float_fast(i32 %3)
%5 = fcmp ole double %4, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @box_boolean(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chol_eps(int, double const *, int /*<<< orphan*/, double *);
void chol(int n, const double A[], double L[]) { chol_eps(n, A, 0, L); }


x86 assembly (clang, -O0):
<chol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1030 <chol_eps@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chol>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <chol_eps@plt>

LLVM IR (-O0):
define void @chol(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load i32, i32* %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call i32 @chol_eps(i32 %7, double* %8, i32 0, double* %9)
ret void
}

LLVM IR (-O2):
define void @chol(i32 %0, double* %1, double* %2) {
%4 = tail call i32 @chol_eps(i32 %0, double* %1, i32 0, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
void pmu_prep_sar_ratio() {
  pmu_reg_write(33, ((1 << 0)));
  pmu_reg_write(7, ((0 << 0)));
  pmu_reg_write(6, ((0 << 0)));
  pmu_reg_write(58, ((0 << 0)));
}


x86 assembly (clang, -O0):
<pmu_prep_sar_ratio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x3a,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_prep_sar_ratio>:
push   %rax
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x3a,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_prep_sar_ratio() {
%1 = call i32 @pmu_reg_write(i32 33, i32 1)
%2 = call i32 @pmu_reg_write(i32 7, i32 0)
%3 = call i32 @pmu_reg_write(i32 6, i32 0)
%4 = call i32 @pmu_reg_write(i32 58, i32 0)
ret void
}

LLVM IR (-O2):
define void @pmu_prep_sar_ratio() {
%1 = tail call i32 @pmu_reg_write(i32 33, i32 1)
%2 = tail call i32 @pmu_reg_write(i32 7, i32 0)
%3 = tail call i32 @pmu_reg_write(i32 6, i32 0)
%4 = tail call i32 @pmu_reg_write(i32 58, i32 0)
ret void
}
void authnone_verf() {}


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

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

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

LLVM IR (-O2):
define void @authnone_verf() {
ret void
}