xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ move_pointer(int, int);
void display_move_pointer(int dx, int dy) { move_pointer(dx, dy); }


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

x86 assembly (clang, -O2):
<display_move_pointer>:
jmp    1030 <move_pointer@plt>

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

LLVM IR (-O2):
define void @display_move_pointer(i32 %0, i32 %1) {
%3 = tail call i32 @move_pointer(i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct sembuf {
  int sem_op;
  scalar_t__ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int semop(int, struct sembuf *, int);
void sem_unlock(int sem_set_id) {
  struct sembuf sem_op;
  int ret = -1;
  sem_op.sem_num = 0;
  sem_op.sem_op = 1;
  sem_op.sem_flg = 0;
  if ((ret = semop(sem_set_id, &sem_op, 1)) < 0) {
    perror("sem_unlock error ");
  }
}


x86 assembly (clang, -O0):
<sem_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x24(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1040 <semop@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jge    1172 <sem_unlock+0x52>
lea    0xe93(%rip),%rdi
call   1030 <perror@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_unlock>:
sub    $0x18,%rsp
movl   $0x1,(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1040 <semop@plt>
test   %eax,%eax
js     1149 <sem_unlock+0x29>
add    $0x18,%rsp
ret
lea    0xeb0(%rip),%rdi
call   1030 <perror@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i64, i64 }
@.str = [18 x i8] c"sem_unlock error \00"
define void @sem_unlock(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
%4 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 2
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 0
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 1
store i64 0, i64* %7
%8 = load i32, i32* %2
%9 = call i32 @semop(i32 %8, %struct.sembuf* %3, i32 1)
store i32 %9, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i64, i64 }
@.str = [18 x i8] c"sem_unlock error \00"
define void @sem_unlock(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> zeroinitializer, <2 x i64>* %6
%7 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}
int fusion_ushort(unsigned short *p) { return p[0x12345]; }


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

x86 assembly (clang, -O2):
<fusion_ushort>:
movzwl 0x2468a(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @fusion_ushort(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 74565
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fusion_ushort(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 74565
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
ret i32 %4
}
void SobelToPlaneRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @SobelToPlaneRow_Any_SSE2() {
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ prepareServer();
int /*<<< orphan*/ startServer(char *);
int main(int argc, char const *argv[]) {
  errno = 0;
  prepareServer();
  startServer("3491");
  return 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    0x2ea3(%rip),%rax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1040 <prepareServer@plt>
lea    0xeae(%rip),%rdi
call   1030 <startServer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
call   1040 <prepareServer@plt>
lea    0xec3(%rip),%rdi
call   1030 <startServer@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [5 x i8] c"3491\00"
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
store i64 0, i64* @errno
%6 = call i32 (...) @prepareServer()
%7 = call i32 @startServer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [5 x i8] c"3491\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
store i64 0, i64* @errno
%3 = tail call i32 (...) @prepareServer()
%4 = tail call i32 @startServer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x5c() {
  Assert_real((isxdigit(92) == 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_isxdigit.c",
              465, ("isxdigit should be 0 for 0x5c"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x5c>:
push   %rax
mov    $0x5c,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1d1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x5c\00"
define void @t_isxdigit_0x5c() {
%1 = call i64 @isxdigit(i32 92)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x5c\00"
define void @t_isxdigit_0x5c() {
%1 = tail call i64 @isxdigit(i32 92)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_text_iter_forward_cursor_position() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_forward_cursor_position() {
ret void
}
int c006(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @c006() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c006() {
ret i32 0
}
void INT_Excep_SDHI_CACI(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SDHI_CACI() {
ret void
}
/* Variables and functions */
int be_migrate_to_domain(int);
int be_migrate_to_cluster(int cluster, int cluster_size) {
  return be_migrate_to_domain(cluster);
}


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

x86 assembly (clang, -O2):
<be_migrate_to_cluster>:
jmp    1030 <be_migrate_to_domain@plt>

LLVM IR (-O0):
define i32 @be_migrate_to_cluster(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 = call i32 @be_migrate_to_domain(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @be_migrate_to_cluster(i32 %0, i32 %1) {
%3 = tail call i32 @be_migrate_to_domain(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ stderr;
void sslChk(int n) {
  if (n < 0) {
    ERR_print_errors_fp(stderr);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<sslChk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    114d <sslChk+0x2d>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <ERR_print_errors_fp@plt>
mov    $0x1,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sslChk>:
test   %edi,%edi
js     1125 <sslChk+0x5>
ret
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <ERR_print_errors_fp@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @sslChk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @ERR_print_errors_fp(i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @sslChk(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @ERR_print_errors_fp(i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OnFatalException();
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fiprintf(int /*<<< orphan*/, char *, char const *,
                            char const *, int, char const *);
int /*<<< orphan*/ stderr;
void __assert_func(const char *file, int line, const char *func,
                   const char *failedexpr) {
  OnFatalException();
  fiprintf(stderr,
           "assertion \"%s\" failed: file \"%s\", line %d, function %s\n",
           failedexpr, file, line, func);
  abort();
}


x86 assembly (clang, -O0):
<__assert_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <OnFatalException@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    -0x18(%rbp),%r9
lea    0xe92(%rip),%rsi
call   1050 <fiprintf@plt>
mov    $0x0,%al
call   1040 <abort@plt>

x86 assembly (clang, -O2):
<__assert_func>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <OnFatalException@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %r14,%r9
call   1050 <fiprintf@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"assertion \22%s\22 failed: file \22%s\22, line %d, function %s\0A\00"
define void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = call i32 (...) @OnFatalException()
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %8
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = call i32 @fiprintf(i32 %10, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i32 %13, i8* %14)
%16 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"assertion \22%s\22 failed: file \22%s\22, line %d, function %s\0A\00"
define void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 (...) @OnFatalException()
%6 = load i32, i32* @stderr
%7 = tail call i32 @fiprintf(i32 %6, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0, i32 %1, i8* %2)
%8 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char readc(char *);
int ppp_up(void) {
  return ((readc("/etc/ppp/ppp0-status") == '1') &
          (readc("/tmp/port_status") == '1'));
}


x86 assembly (clang, -O0):
<ppp_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <readc@plt>
movsbl %al,%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <readc@plt>
mov    %al,%cl
mov    -0x4(%rbp),%eax
movsbl %cl,%ecx
cmp    $0x31,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppp_up>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <readc@plt>
mov    %eax,%ebx
xor    $0x31,%bl
lea    0xeec(%rip),%rdi
call   1030 <readc@plt>
xor    $0x31,%al
xor    %ecx,%ecx
or     %bl,%al
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"/etc/ppp/ppp0-status\00"
@.str.1 = [17 x i8] c"/tmp/port_status\00"
define i32 @ppp_up() {
%1 = call signext i8 @readc(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 49
%4 = zext i1 %3 to i32
%5 = call signext i8 @readc(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 49
%8 = zext i1 %7 to i32
%9 = and i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
@.str = [21 x i8] c"/etc/ppp/ppp0-status\00"
@.str.1 = [17 x i8] c"/tmp/port_status\00"
define i32 @ppp_up() {
%1 = tail call signext i8 @readc(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8 %1, 49
%3 = tail call signext i8 @readc(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i8 %3, 49
%5 = and i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void ExttParameterAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttParameterAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double run_func_double(double (*g)(), double a, double b) {
  printf("%f\n", g(a, b));
}


x86 assembly (clang, -O0):
<run_func_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x2,%al
call   *%rcx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_func_double>:
push   %rax
mov    $0x2,%al
call   *%rdi
lea    0xee4(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define double @run_func_double(double (...)* %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double (...)*
%6 = alloca double
%7 = alloca double
store double (...)* %0, double (...)** %5
store double %1, double* %6
store double %2, double* %7
%8 = load double (...)*, double (...)** %5
%9 = load double, double* %6
%10 = load double, double* %7
%11 = bitcast double (...)* %8 to double (double, double, ...)*
%12 = call double (double, double, ...) %11(double %9, double %10)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %12)
%14 = load double, double* %4
ret double %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define double @run_func_double(double (...)* nocapture %0, double %1, double %2) {
%4 = bitcast double (...)* %0 to double (double, double, ...)*
%5 = tail call double (double, double, ...) %4(double %1, double %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
ret double undef
}
int test_imm_B9uint16_mem(unsigned short *val) {
  return ((*val) & (-0xB9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B9uint16_mem>:
movzwl (%rdi),%eax
test   $0xff47,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B9uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -185
%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_B9uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -185
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_stream_get_stats_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_stream@%p::get_stats (rtpp_stream_get_stats) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_stream_get_stats_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_stream_get_stats_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"Method rtpp_stream@%p::get_stats (rtpp_stream_get_stats) is invoked after destruction\0A\00"
define void @rtpp_stream_get_stats_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"Method rtpp_stream@%p::get_stats (rtpp_stream_get_stats) is invoked after destruction\0A\00"
define void @rtpp_stream_get_stats_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ permuttation(char *);
void perm(char *data) {
  permuttation(&data[0]);
  permuttation(&data[1]);
  permuttation(&data[2]);
  permuttation(&data[3]);
}


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

x86 assembly (clang, -O2):
<perm>:
push   %rbx
mov    %rdi,%rbx
call   1030 <permuttation@plt>
lea    0x1(%rbx),%rdi
call   1030 <permuttation@plt>
lea    0x2(%rbx),%rdi
call   1030 <permuttation@plt>
add    $0x3,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <permuttation@plt>

LLVM IR (-O0):
define void @perm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = call i32 @permuttation(i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = call i32 @permuttation(i8* %7)
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = call i32 @permuttation(i8* %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = call i32 @permuttation(i8* %13)
ret void
}

LLVM IR (-O2):
define void @perm(i8* %0) {
%2 = tail call i32 @permuttation(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = tail call i32 @permuttation(i8* %3)
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = tail call i32 @permuttation(i8* %5)
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = tail call i32 @permuttation(i8* %7)
ret void
}
unsigned invert(unsigned x, unsigned p, unsigned n) {
  unsigned adjusted;
  unsigned mask;
  adjusted = (p + 1 - n);
  mask = ~(~(unsigned)0 << n);
  return x ^ (mask << adjusted);
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
sub    %edx,%esi
not    %eax
lea    0x1(%rsi),%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = add i32 %9, 1
%11 = load i32, i32* %6
%12 = sub i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %6
%14 = shl i32 -1, %13
%15 = xor i32 %14, -1
store i32 %15, i32* %8
%16 = load i32, i32* %4
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = shl i32 %17, %18
%20 = xor i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, 1
%5 = sub i32 %4, %2
%6 = shl nsw i32 -1, %2
%7 = xor i32 %6, -1
%8 = shl i32 %7, %5
%9 = xor i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ resetAll();
void restoreTerm() {
  resetAll();
  printf("\e[?47l");
}


x86 assembly (clang, -O0):
<restoreTerm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <resetAll@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?47l\00"
define void @restoreTerm() {
%1 = call i32 (...) @resetAll()
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?47l\00"
define void @restoreTerm() {
%1 = tail call i32 (...) @resetAll()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void f4(char a, short b) {}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f4(i8 signext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @f4(i8 signext %0, i16 signext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cdflib_E0001(int /*<<< orphan*/, int *, double *, double *,
                                double *, double *, unsigned long *,
                                unsigned long *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
void cdflib_dzror(int *status, double *x, double *fx, double *xlo, double *xhi,
                  unsigned long *qleft, unsigned long *qhi) {
  cdflib_E0001(0, status, x, fx, xlo, xhi, qleft, qhi, NULL, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<cdflib_dzror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
xor    %edi,%edi
xor    %r11d,%r11d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x20(%rsp)
movq   $0x0,0x28(%rsp)
call   1030 <cdflib_E0001@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_dzror>:
sub    $0x38,%rsp
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x40(%rsp),%rdi
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rsp)
movups %xmm0,0x10(%rsp)
mov    %rdi,0x8(%rsp)
mov    %r9,(%rsp)
xor    %edi,%edi
mov    %rax,%r9
call   1030 <cdflib_E0001@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @cdflib_dzror(i32* %0, double* %1, double* %2, double* %3, double* %4, i64* %5, i64* %6) {
%8 = alloca i32*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i64*
%14 = alloca i64*
store i32* %0, i32** %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store double* %4, double** %12
store i64* %5, i64** %13
store i64* %6, i64** %14
%15 = load i32*, i32** %8
%16 = load double*, double** %9
%17 = load double*, double** %10
%18 = load double*, double** %11
%19 = load double*, double** %12
%20 = load i64*, i64** %13
%21 = load i64*, i64** %14
%22 = call i32 @cdflib_E0001(i32 0, i32* %15, double* %16, double* %17, double* %18, double* %19, i64* %20, i64* %21, i32* null, i32* null, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @cdflib_dzror(i32* %0, double* %1, double* %2, double* %3, double* %4, i64* %5, i64* %6) {
%8 = tail call i32 @cdflib_E0001(i32 0, i32* %0, double* %1, double* %2, double* %3, double* %4, i64* %5, i64* %6, i32* null, i32* null, i32* null, i32* null)
ret void
}
/* Variables and functions */
scalar_t__ string2long(char const *, char **, int, int /*<<< orphan*/);
unsigned long int strtoul(register const char *nptr, char **endptr, int base) {
  return (unsigned long)string2long(nptr, endptr, base, 0);
}


x86 assembly (clang, -O0):
<strtoul>:
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
xor    %ecx,%ecx
call   1030 <string2long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoul>:
xor    %ecx,%ecx
jmp    1030 <string2long@plt>

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

LLVM IR (-O2):
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @string2long(i8* %0, i8** %1, i32 %2, i32 0)
ret i64 %4
}
void next_Construct(_loc, _Base_Construct, _loc_0, _Base_Construct_0) int *_loc,
    *_Base_Construct, _loc_0, _Base_Construct_0;
{ Construct_NEXT_FNC_OBJ(_loc, _Base_Construct, _loc_0, _Base_Construct_0); }


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

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

LLVM IR (-O0):
define void @next_Construct(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @Construct_NEXT_FNC_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %9, i32* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @next_Construct(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @Construct_NEXT_FNC_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %0, i32* %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
char *strcopy(char *, char const *);
char *strappend(char *dst, const char *cat) {
  while (*dst)
    dst++;
  return strcopy(dst, cat);
}


x86 assembly (clang, -O0):
<strappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <strappend+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <strappend+0x10>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcopy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strappend>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <strappend+0x10>
jmp    1030 <strcopy@plt>

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

LLVM IR (-O2):
define i8* @strappend(i8* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i8* @strcopy(i8* %4, i8* %1)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: try [-dh] <command>\n");
  printf("  -d <seconds>   seconds to wait between executing command. defaults "
         "to 2 seconds.\n");
  printf("  -h             print this message\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: try [-dh] <command>\0A\00"
@.str.1 = [84 x i8] c" -d <seconds> seconds to wait between executing command. defaults to 2 seconds.\0A\00"
@.str.2 = [37 x i8] c" -h print this message\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Usage: try [-dh] <command>\00"
@str.3 = [83 x i8] c" -d <seconds> seconds to wait between executing command. defaults to 2 seconds.\00"
@str.4 = [36 x i8] c" -h print this message\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *(Memento_takeRef)(void *a) { return a; }


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

x86 assembly (clang, -O2):
<Memento_takeRef>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @Memento_takeRef(i8* readnone returned %0) {
ret i8* %0
}
double linspace(double start, double stop, int N, int i) {
  if (start == stop)
    return start;
  return start + (stop - start) * i / (N - 1);
}


x86 assembly (clang, -O0):
<linspace>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1139 <linspace+0x39>
jp     1139 <linspace+0x39>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1168 <linspace+0x68>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linspace>:
ucomisd %xmm1,%xmm0
jne    1109 <linspace+0x9>
jp     1109 <linspace+0x9>
ret
subsd  %xmm0,%xmm1
cvtsi2sd %esi,%xmm2
mulsd  %xmm1,%xmm2
add    $0xffffffff,%edi
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @linspace(double %0, double %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
store double %0, double* %6
store double %1, double* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load double, double* %6
%11 = load double, double* %7
%12 = fcmp oeq double %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load double, double* %6
store double %14, double* %5
br label %28
15: ; preds = %4
%16 = load double, double* %6
%17 = load double, double* %7
%18 = load double, double* %6
%19 = fsub double %17, %18
%20 = load i32, i32* %9
%21 = sitofp i32 %20 to double
%22 = fmul double %19, %21
%23 = load i32, i32* %8
%24 = sub nsw i32 %23, 1
%25 = sitofp i32 %24 to double
%26 = fdiv double %22, %25
%27 = fadd double %16, %26
store double %27, double* %5
br label %28
28: ; preds = %15, %13
%29 = load double, double* %5
ret double %29
}

LLVM IR (-O2):
define double @linspace(double %0, double %1, i32 %2, i32 %3) {
%5 = fcmp oeq double %0, %1
br i1 %5, label %14, label %6
6: ; preds = %4
%7 = fsub double %1, %0
%8 = sitofp i32 %3 to double
%9 = fmul double %7, %8
%10 = add nsw i32 %2, -1
%11 = sitofp i32 %10 to double
%12 = fdiv double %9, %11
%13 = fadd double %12, %0
br label %14
14: ; preds = %4, %6
%15 = phi double [ %13, %6 ], [ %0, %4 ]
ret double %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ReadWord(char *, int /*<<< orphan*/ *);
int SearchVocab(char *);
scalar_t__ feof(int /*<<< orphan*/ *);
int ReadWordIndex(FILE *fin) {
  char word[100];
  ReadWord(word, fin);
  if (feof(fin))
    return -1;
  return SearchVocab(word);
}


x86 assembly (clang, -O0):
<ReadWordIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ReadWord@plt>
mov    -0x10(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%rax
je     116b <ReadWordIndex+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <ReadWordIndex+0x47>
lea    -0x80(%rbp),%rdi
call   1050 <SearchVocab@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadWordIndex>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <ReadWord@plt>
mov    %rbx,%rdi
call   1030 <feof@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1160 <ReadWordIndex+0x30>
mov    %rsp,%rdi
call   1050 <SearchVocab@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ReadWordIndex(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [100 x i8]
store i32* %0, i32** %3
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = load i32*, i32** %3
%7 = call i32 @ReadWord(i8* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = call i64 @feof(i32* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %15
12: ; preds = %1
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%14 = call i32 @SearchVocab(i8* %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ReadWordIndex(i32* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @ReadWord(i8* %3, i32* %0)
%5 = call i64 @feof(i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @SearchVocab(i8* %3)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ %8, %7 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int array[3] = {100, 200, 300};
  int e = 53;
  printf("Element %d is %d\n", e, array[e]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x35,-0x14(%rbp)
mov    -0x14(%rbp),%esi
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.array = [3 x i32] [i32 100, i32 200, i32 300]
@.str = [18 x i8] c"Element %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
store i32 53, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Element %d is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 53, i32 undef)
ret i32 0
}
/* Variables and functions */
int f();
__attribute__((no, noclone)) int g3(int p1, int p2, int p3) { return f(); }


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

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

LLVM IR (-O0):
define i32 @g3(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 = call i32 (...) @f()
ret i32 %7
}

LLVM IR (-O2):
define i32 @g3(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @f()
ret i32 %4
}
void __attribute__((no, noclone)) fn10(void) {
  volatile int x = 10;
  volatile int e[20];
  e[x++] = 3;
  if (x != 11)
    __builtin_abort();
  e[x--] = 3;
  if (x != 10)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<fn10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
cltq
movl   $0x3,-0x60(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
cmp    $0xb,%eax
je     1145 <fn10+0x35>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cltq
movl   $0x3,-0x60(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
cmp    $0xa,%eax
je     116b <fn10+0x5b>
call   1030 <abort@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn10>:
sub    $0x68,%rsp
movl   $0xa,0xc(%rsp)
movslq 0xc(%rsp),%rax
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
movl   $0x3,0x10(%rsp,%rax,4)
mov    0xc(%rsp),%eax
cmp    $0xb,%eax
jne    115b <fn10+0x4b>
movslq 0xc(%rsp),%rax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
movl   $0x3,0x10(%rsp,%rax,4)
mov    0xc(%rsp),%eax
cmp    $0xa,%eax
jne    115b <fn10+0x4b>
add    $0x68,%rsp
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fn10() {
%1 = alloca i32
%2 = alloca [20 x i32]
store volatile i32 10, i32* %1
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, 1
store volatile i32 %4, i32* %1
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %5
store volatile i32 3, i32* %6
%7 = load volatile i32, i32* %1
%8 = icmp ne i32 %7, 11
br i1 %8, label %9, label %10
9: ; preds = %0
unreachable
10: ; preds = %0
%11 = load volatile i32, i32* %1
%12 = add nsw i32 %11, -1
store volatile i32 %12, i32* %1
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %13
store volatile i32 3, i32* %14
%15 = load volatile i32, i32* %1
%16 = icmp ne i32 %15, 10
br i1 %16, label %17, label %18
17: ; preds = %10
unreachable
18: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @fn10() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = bitcast i32* %1 to i8*
store volatile i32 10, i32* %1
%4 = bitcast [20 x i32]* %2 to i8*
%5 = load volatile i32, i32* %1
%6 = add nsw i32 %5, 1
store volatile i32 %6, i32* %1
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %7
store volatile i32 3, i32* %8
%9 = load volatile i32, i32* %1
%10 = icmp eq i32 %9, 11
br i1 %10, label %12, label %11
11: ; preds = %0
tail call void @abort()
unreachable
12: ; preds = %0
%13 = load volatile i32, i32* %1
%14 = add nsw i32 %13, -1
store volatile i32 %14, i32* %1
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 %15
store volatile i32 3, i32* %16
%17 = load volatile i32, i32* %1
%18 = icmp eq i32 %17, 10
br i1 %18, label %20, label %19
19: ; preds = %12
tail call void @abort()
unreachable
20: ; preds = %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *applet(char *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *f, char *const arg0) {
  fprintf(f,
          "Usage: %s [OPTIONS]\n\n"
          "Options:\n"
          " -t or --timeout SECOND Set time-out in seconds [default=-1].\n"
          " -s or --row-size SIZE  Set row size in bytes [default=16].\n"
          " -h or --help           Display this message.\n"
          " -V or --version        Display the version.\n"
          "",
          applet(arg0));
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <applet@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <applet@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [244 x i8] c"Usage: %s [OPTIONS]\0A\0AOptions:\0A -t or --timeout SECOND Set time-out in seconds [default=-1].\0A -s or --row-size SIZE Set row size in bytes [default=16].\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\00"
define void @usage(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 i8* @applet(i8* %6)
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([244 x i8], [244 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [244 x i8] c"Usage: %s [OPTIONS]\0A\0AOptions:\0A -t or --timeout SECOND Set time-out in seconds [default=-1].\0A -s or --row-size SIZE Set row size in bytes [default=16].\0A -h or --help Display this message.\0A -V or --version Display the version.\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @applet(i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([244 x i8], [244 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int isNull(double d) { return d == 0.0; }


x86 assembly (clang, -O0):
<isNull>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNull>:
xorpd  %xmm1,%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isNull(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isNull(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ c();
void a() { c(); }


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

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

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

LLVM IR (-O2):
define void @a() {
%1 = tail call i32 (...) @c()
ret void
}