xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ NWK_SyncConf();
void nwkSyncTimerHandler(void) { NWK_SyncConf(); }


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

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

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

LLVM IR (-O2):
define void @nwkSyncTimerHandler() {
%1 = tail call i32 (...) @NWK_SyncConf()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int htonl(int);
scalar_t__ is_big_endian();
uint64_t htonll(uint64_t hostlong) {
  if (is_big_endian())
    return hostlong;
  else
    return ((uint64_t)htonl(hostlong & 0xFFFFFFFF) << 32 |
            htonl(hostlong >> 32));
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <is_big_endian@plt>
cmp    $0x0,%rax
je     1147 <htonll+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <htonll+0x55>
mov    -0x8(%rbp),%edi
and    $0xffffffff,%edi
call   1030 <htonl@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <is_big_endian@plt>
test   %rax,%rax
jne    113b <htonll+0x1b>
mov    %ebx,%edi
call   1030 <htonl@plt>
call   1030 <htonl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @htonll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @is_big_endian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %17
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, -1
%11 = call i32 @htonl(i32 %10)
%12 = shl i32 %11, 32
%13 = load i32, i32* %3
%14 = ashr i32 %13, 32
%15 = call i32 @htonl(i32 %14)
%16 = or i32 %12, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %8, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @htonll(i32 returned %0) {
%2 = tail call i64 (...) @is_big_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @htonl(i32 %0)
%6 = tail call i32 @htonl(i32 poison)
br label %7
7: ; preds = %1, %4
ret i32 %0
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t timestamp_now() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<timestamp_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @timestamp_now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @timestamp_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void dprint_soln(int n, int nrhs, double *soln) {
  int i;
  for (i = 0; i < n; i++)
    printf("\t%d: %.4f\n", i, soln[i]);
}


x86 assembly (clang, -O0):
<dprint_soln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <dprint_soln+0x4f>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <dprint_soln+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dprint_soln>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1149 <dprint_soln+0x39>
mov    %rdx,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dprint_soln+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"\09%d: %.4f\0A\00"
define void @dprint_soln(i32 %0, i32 %1, double* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds double, double* %2, i64 %8
%10 = load double, double* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %11, double %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t times(struct tms *buf) { return (clock_t)0; }


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

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

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

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @times(%struct.tms* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: lzma2eva <loadadddr> <entry> <lzmafile> <evafile>\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"usage: lzma2eva <loadadddr> <entry> <lzmafile> <evafile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"usage: lzma2eva <loadadddr> <entry> <lzmafile> <evafile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int getpeername(int, struct sockaddr *, int *);
int /*<<< orphan*/ read(int, char *, int);
int socket_connected(int s) {
  struct sockaddr_in sa;
  int dummy;
  char ch;
  dummy = sizeof sa;
  if (getpeername(s, (struct sockaddr *)&sa, &dummy) == -1) {
    read(s, &ch, 1);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<socket_connected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <getpeername@plt>
cmp    $0xffffffff,%eax
jne    1168 <socket_connected+0x48>
mov    -0x8(%rbp),%edi
lea    -0x15(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
movl   $0x0,-0x4(%rbp)
jmp    116f <socket_connected+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_connected>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <getpeername@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
jne    115d <socket_connected+0x3d>
lea    0x3(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1040 <read@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_connected(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %3
store i32 4, i32* %5
%7 = load i32, i32* %3
%8 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%9 = call i32 @getpeername(i32 %7, %struct.sockaddr* %8, i32* %5)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 @read(i32 %12, i8* %6, i32 1)
store i32 0, i32* %2
br label %15
14: ; preds = %1
store i32 1, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_connected(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = alloca i8
%5 = bitcast %struct.sockaddr_in* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%7 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%8 = call i32 @getpeername(i32 %0, %struct.sockaddr* %7, i32* %3)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @read(i32 %0, i8* %4, i32 1)
br label %12
12: ; preds = %1, %10
%13 = phi i32 [ 0, %10 ], [ 1, %1 ]
ret i32 %13
}
int get_rp_code_from_opcode(int instruction) {
  return (instruction & 0b00110000) >> 6;
}


x86 assembly (clang, -O0):
<get_rp_code_from_opcode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x30,%eax
sar    $0x6,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_rp_code_from_opcode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 48
%5 = ashr i32 %4, 6
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_rp_code_from_opcode(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           char *);
int /*<<< orphan*/ stderr;
void status(char *msg) {
  static int pass = 1;
  fprintf(stderr, "(%d) %s\n", pass++, msg);
}


x86 assembly (clang, -O0):
<status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2efd(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2ef2(%rip)
mov    -0x8(%rbp),%rcx
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    0x2f06(%rip),%edx
lea    0x1(%rdx),%eax
mov    %eax,0x2efd(%rip)
lea    0xece(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@status.pass = internal global i32 1
@stderr = global i32 0
@.str = [9 x i8] c"(%d) %s\0A\00"
define void @status(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* @status.pass
%5 = add nsw i32 %4, 1
store i32 %5, i32* @status.pass
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %6)
ret void
}

LLVM IR (-O2):
@status.pass = internal unnamed_addr global i32 1
@stderr = global i32 0
@.str = [9 x i8] c"(%d) %s\0A\00"
define void @status(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @status.pass
%4 = add nsw i32 %3, 1
store i32 %4, i32* @status.pass
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %0)
ret void
}
void inverte_posicao(char senha[5], int a, int b) {
  char aux = senha[a];
  senha[a] = senha[b];
  senha[b] = aux;
}


x86 assembly (clang, -O0):
<inverte_posicao>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverte_posicao>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

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

LLVM IR (-O2):
define void @inverte_posicao(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int sin(double);
double csc(double n) {
  if (sin(n) == 0) {
    return 0. / 0.;
  }
  return 1 / sin(n);
}


x86 assembly (clang, -O0):
<csc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
cmp    $0x0,%eax
jne    1142 <csc+0x32>
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <csc+0x4f>
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csc>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
test   %eax,%eax
je     113d <csc+0x2d>
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret
movsd  0xebb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @csc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @sin(double %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0x7FF8000000000000, double* %2
br label %13
8: ; preds = %1
%9 = load double, double* %3
%10 = call i32 @sin(double %9)
%11 = sdiv i32 1, %10
%12 = sitofp i32 %11 to double
store double %12, double* %2
br label %13
13: ; preds = %8, %7
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @csc(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @sin(double %0)
%6 = add i32 %5, 1
%7 = icmp ult i32 %6, 3
%8 = select i1 %7, i32 %5, i32 0
%9 = sitofp i32 %8 to double
br label %10
10: ; preds = %1, %4
%11 = phi double [ %9, %4 ], [ 0x7FF8000000000000, %1 ]
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char const *);
void touch(const char *fn, const char *contents) {
  FILE *fp;
  assert(fp = fopen(fn, "w"));
  fprintf(fp, contents);
  fclose(fp);
}


x86 assembly (clang, -O0):
<touch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rdi
mov    %rdi,-0x18(%rbp)
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<touch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xeb2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @touch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = call i32 @assert(i32* %7)
%9 = load i32*, i32** %5
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32* %9, i8* %10)
%12 = load i32*, i32** %5
%13 = call i32 @fclose(i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @touch(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @assert(i32* %3)
%5 = tail call i32 @fprintf(i32* %3, i8* %1)
%6 = tail call i32 @fclose(i32* %3)
ret void
}
void unsigned_char_shr_signed_char_signed_int(unsigned char *LHS,
                                              signed int RHS) {
  (*LHS) >>= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_shr_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
sar    %cl,%edx
mov    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_shr_signed_char_signed_int>:
mov    %esi,%ecx
movzbl (%rdi),%eax
shr    %cl,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_shr_signed_char_signed_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @unsigned_char_shr_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = lshr i32 %4, %1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ opentrajfile_(long long *);
void OpenTrajFile(int traj_id) {
  long long trajid64 = traj_id;
  opentrajfile_(&trajid64);
}


x86 assembly (clang, -O0):
<OpenTrajFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <opentrajfile_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenTrajFile>:
push   %rax
movslq %edi,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <opentrajfile_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @OpenTrajFile(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = sext i32 %0 to i64
store i64 %4, i64* %2
%5 = call i32 @opentrajfile_(i64* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_write(char);
void Puts(char *s) {
  char c;
  while ((c = *s++) != '\0') {
    uart_write(c);
  }
}


x86 assembly (clang, -O0):
<Puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114a <Puts+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <uart_write@plt>
jmp    111c <Puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <Puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_write@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <Puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @uart_write(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spi_emit_buf(char *, int);
void spi_emit_fsync(void) { spi_emit_buf("\x6", 1); }


x86 assembly (clang, -O0):
<spi_emit_fsync>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <spi_emit_buf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_emit_fsync>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <spi_emit_buf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\06\00"
define void @spi_emit_fsync() {
%1 = call i32 @spi_emit_buf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\06\00"
define void @spi_emit_fsync() {
%1 = tail call i32 @spi_emit_buf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int LOG_NDELAY;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *);
void logerr(const char *msg) {
  openlog("firejail", LOG_NDELAY | LOG_PID, LOG_USER);
  syslog(LOG_ERR, "%s\n", msg);
  closelog();
}


x86 assembly (clang, -O0):
<logerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    0x2e8c(%rip),%rax
or     (%rax),%esi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
lea    0xea2(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe92(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logerr>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e8d(%rip),%rax
mov    0x2e96(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    0xeaa(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"firejail\00"
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define void @logerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_NDELAY
%4 = load i32, i32* @LOG_PID
%5 = or i32 %3, %4
%6 = load i32, i32* @LOG_USER
%7 = call i32 @openlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* @LOG_ERR
%9 = load i8*, i8** %2
%10 = call i32 @syslog(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"firejail\00"
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define void @logerr(i8* %0) {
%2 = load i32, i32* @LOG_NDELAY
%3 = load i32, i32* @LOG_PID
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_USER
%6 = tail call i32 @openlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* @LOG_ERR
%8 = tail call i32 @syslog(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%9 = tail call i32 (...) @closelog()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int get_sec() {
  int sec;
  time_t timer;
  struct tm *time_ptr;
  timer = time(NULL);
  time_ptr = localtime(&timer);
  sec = time_ptr->tm_sec;
  return sec;
}


x86 assembly (clang, -O0):
<get_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sec>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @get_sec() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %5, %struct.tm** %3
%6 = load %struct.tm*, %struct.tm** %3
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
%8 = load i32, i32* %7
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @get_sec() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ fp_query(int /*<<< orphan*/ const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void p_query(const u_char *msg) { fp_query(msg, stdout); }


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

x86 assembly (clang, -O2):
<p_query>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fp_query@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @p_query(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fp_query(i32* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @p_query(i32* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fp_query(i32* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int i = 0;
  for (; i < 100; i++) {
    if (i % 2) {
      continue;
    }
    printf("%d*%d=%d\n", i, i, i * i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1170 <main+0x60>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1149 <main+0x39>
jmp    1162 <main+0x52>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    1128 <main+0x18>
nop
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1140 <main+0x30>
test   $0x1,%bl
jne    1120 <main+0x10>
mov    %ebx,%ecx
imul   %ebx,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d*%d=%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %9, %8 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = mul nuw nsw i32 %2, %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2, i32 %6)
br label %8
8: ; preds = %1, %5
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 100
br i1 %10, label %11, label %1
11: ; preds = %8
ret i32 0
}
int test_imm_6Fint16_reg(short val) {
  return ((val) & (-0x6F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Fint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -111
%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_6Fint16_reg(i16 signext %0) {
%2 = and i16 %0, -111
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ARGBToRAWRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRAWRow_SSSE3() {
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int main(int argc, char **argv) {
  return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_FAILURE
ret i32 %3
}
int config_READER_NAGRA(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_READER_NAGRA() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int middle(char const *);
int /*<<< orphan*/ stderr;
int outer(char *dummy) {
  const char local = 0;
  int retval;
  fprintf(stderr, "outer: &local = %p\n", &local);
  retval = middle(&local);
  fprintf(stderr, "outer: middle returned %d\n", retval);
  return retval != 0;
}


x86 assembly (clang, -O0):
<outer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
lea    -0x9(%rbp),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
lea    -0x9(%rbp),%rdi
call   1040 <middle@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outer>:
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x7(%rsp)
mov    0x2eb0(%rip),%r14
mov    (%r14),%edi
lea    0xec6(%rip),%rsi
lea    0x7(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <middle@plt>
mov    %eax,%ebx
mov    (%r14),%edi
lea    0xeb7(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
test   %ebx,%ebx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"outer: &local = %p\0A\00"
@.str.1 = [27 x i8] c"outer: middle returned %d\0A\00"
define i32 @outer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8* %0, i8** %2
store i8 0, i8* %3
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 @middle(i8* %3)
store i32 %7, i32* %4
%8 = load i32, i32* @stderr
%9 = load i32, i32* %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"outer: &local = %p\0A\00"
@.str.1 = [27 x i8] c"outer: middle returned %d\0A\00"
define i32 @outer(i8* nocapture readnone %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @middle(i8* %2)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = icmp ne i32 %5, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int main1(int);
int main(void) {
  check_vect();
  return main1(128);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x80,%edi
pop    %rax
jmp    1040 <main1@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 128)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_1_callee(void *, void *);
void test_1(void *p, void *q) {
  if (p == 0 || q == 0)
    return;
  test_1_callee(p, q);
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <test_1+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    113b <test_1+0x2b>
jmp    1148 <test_1+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <test_1_callee@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
test   %rdi,%rdi
je     111f <test_1+0xf>
test   %rsi,%rsi
je     111f <test_1+0xf>
jmp    1030 <test_1_callee@plt>
ret

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

LLVM IR (-O2):
define void @test_1(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @test_1_callee(i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
ret void
}
unsigned rnint(float a) { return (unsigned)(a * 255 + 0.5); }


x86 assembly (clang, -O0):
<rnint>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnint>:
mulss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @rnint(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 2.550000e+02
%5 = fpext float %4 to double
%6 = fadd double %5, 5.000000e-01
%7 = fptoui double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @rnint(float %0) {
%2 = fmul float %0, 2.550000e+02
%3 = fpext float %2 to double
%4 = fadd double %3, 5.000000e-01
%5 = fptoui double %4 to i32
ret i32 %5
}
unsigned int russianPeasant(unsigned int a, unsigned int b) {
  int res = 0;
  while (b > 0) {
    if (b & 1)
      res += a;
    a = a << 1;
    b = b >> 1;
  }
  return (res);
}


x86 assembly (clang, -O0):
<russianPeasant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    114a <russianPeasant+0x4a>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1133 <russianPeasant+0x33>
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <russianPeasant+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<russianPeasant>:
xor    %eax,%eax
test   %esi,%esi
je     1126 <russianPeasant+0x26>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %esi,%edx
and    $0x1,%edx
neg    %edx
and    %edi,%edx
add    %edx,%eax
add    %edi,%edi
shr    %ecx
cmp    $0x1,%esi
mov    %ecx,%esi
ja     1110 <russianPeasant+0x10>
ret

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

LLVM IR (-O2):
define i32 @russianPeasant(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = phi i32 [ %12, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 %7
%11 = add i32 %10, %5
%12 = shl i32 %7, 1
%13 = lshr i32 %6, 1
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %16
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t WatchdogValueGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x00000004))));
}


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

x86 assembly (clang, -O2):
<WatchdogValueGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x4(%rax),%rax
ret

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

LLVM IR (-O2):
define i64 @WatchdogValueGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
float mixf(float x, float y, float a) { return x + (x - y) * a; }


x86 assembly (clang, -O0):
<mixf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixf>:
movaps %xmm0,%xmm3
subss  %xmm1,%xmm3
mulss  %xmm2,%xmm3
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @mixf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fsub float %8, %9
%11 = load float, float* %6
%12 = call float @llvm.fmuladd.f32(float %10, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @mixf(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fmuladd.f32(float %4, float %2, float %0)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIGSTOP;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int ignore_signal(void) {
  signal(SIGINT, SIG_IGN);
  signal(SIGSTOP, SIG_IGN);
  signal(SIGQUIT, SIG_IGN);
}


x86 assembly (clang, -O0):
<ignore_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_signal>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGSTOP = global i32 0
@SIGQUIT = global i32 0
define i32 @ignore_signal() {
%1 = alloca i32
%2 = load i32, i32* @SIGINT
%3 = load i32, i32* @SIG_IGN
%4 = call i32 @signal(i32 %2, i32 %3)
%5 = load i32, i32* @SIGSTOP
%6 = load i32, i32* @SIG_IGN
%7 = call i32 @signal(i32 %5, i32 %6)
%8 = load i32, i32* @SIGQUIT
%9 = load i32, i32* @SIG_IGN
%10 = call i32 @signal(i32 %8, i32 %9)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGSTOP = global i32 0
@SIGQUIT = global i32 0
define i32 @ignore_signal() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGSTOP
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGQUIT
%8 = load i32, i32* @SIG_IGN
%9 = tail call i32 @signal(i32 %7, i32 %8)
ret i32 undef
}
/* Variables and functions */
scalar_t__ isblank(int);
int isspace(int c) {
  if (isblank(c))
    return 1;
  switch (c) {
  case '\f':
  case '\n':
  case '\r':
  case '\t':
  case '\v':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
je     1139 <isspace+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1160 <isspace+0x50>
mov    -0x8(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x4,%eax
ja     1159 <isspace+0x49>
jmp    114d <isspace+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1160 <isspace+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
push   %rbx
mov    %edi,%ebx
call   1030 <isblank@plt>
test   %rax,%rax
setne  %al
add    $0xfffffff7,%ebx
cmp    $0x5,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isblank(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %12
8: ; preds = %1
%9 = load i32, i32* %3
switch i32 %9, label %11 [
i32 12, label %10
i32 10, label %10
i32 13, label %10
i32 9, label %10
i32 11, label %10
]
10: ; preds = %8, %8, %8, %8, %8
store i32 1, i32* %2
br label %12
11: ; preds = %8
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = tail call i64 @isblank(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = add i32 %0, -9
%5 = icmp ult i32 %4, 5
%6 = or i1 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}