xunge/DecIR huggingface dataset:
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double gettimeofday_d(void) {
  struct timeval tv;
  gettimeofday(&tv, (struct timezone *)0);
  return tv.tv_sec + tv.tv_usec / 1e6;
}


x86 assembly (clang, -O0):
<gettimeofday_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday_d>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
%struct.timezone = type { i32 }
define double @gettimeofday_d() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %4, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
%struct.timezone = type { i32 }
define double @gettimeofday_d() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
IR0AR1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*p0) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AR1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x30(%rbp),%rax
movsd  0x21e888(%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1146 <IR0AR1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <IR0AR1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AR1>:
movsd  0x21e888(%rcx),%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @IR0AR1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = load double, double* %14
%16 = load double*, double** %13
%17 = getelementptr inbounds double, double* %16, i64 277777
%18 = load double, double* %17
%19 = fcmp ole double %15, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @IR0AR1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = load double, double* %4
%8 = getelementptr inbounds double, double* %5, i64 277777
%9 = load double, double* %8
%10 = fcmp ole double %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
void caller_1_2_2_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_2_1_1_1_1() {
ret void
}
int isupper(c)
char c;
{ return c >= 'A' && c <= 'Z'; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
shl    $0x18,%edi
add    $0xbfffffff,%edi
xor    %eax,%eax
cmp    $0x1affffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1073741825
%4 = icmp ult i32 %3, 452984831
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned long);
void *xalloc(unsigned long);
void *zalloc(unsigned long size) {
  void *mem = xalloc(size);
  if (mem)
    memset(mem, 0, size);
  return mem;
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xalloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <zalloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <xalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <zalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @zalloc(i64 %0) {
%2 = tail call i8* @xalloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct intf {
  int dummy;
};

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


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

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

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

LLVM IR (-O2):
%struct.intf = type { i32 }
@ARPOP_REQUEST = global i32 0
define void @arp_claim(i32 %0, %struct.intf* %1) {
%3 = load i32, i32* @ARPOP_REQUEST
%4 = tail call i32 @arp_packet_send(i32 %0, %struct.intf* %1, i32 %3, i32 0)
ret void
}
void ktsan_sync_release(void *addr) {}


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

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

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

LLVM IR (-O2):
define void @ktsan_sync_release(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hej jag heter Greco");
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hej jag heter Greco\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Hej jag heter Greco\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int log_getc(FILE *fp) {
  int ch = getc(fp);
  if (ch == EOF) {
    fprintf(stderr, "Got EOF: exiting\n");
    exit(0);
  }
  return ch;
}


x86 assembly (clang, -O0):
<log_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%eax
jne    1176 <log_getc+0x46>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_getc>:
push   %rax
call   1050 <getc@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
je     1143 <log_getc+0x13>
pop    %rcx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stderr = global i32 0
@.str = [18 x i8] c"Got EOF: exiting\0A\00"
define i32 @log_getc(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i32 0
@stderr = global i32 0
@.str = [18 x i8] c"Got EOF: exiting\0A\00"
define i32 @log_getc(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %1
ret i32 %2
}
void init_ip(void) {}


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

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

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

LLVM IR (-O2):
define void @init_ip() {
ret void
}
const char *Doc_Name(void) { return "Doc"; }


x86 assembly (clang, -O0):
<Doc_Name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"Doc\00"
define i8* @Doc_Name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"Doc\00"
define i8* @Doc_Name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct ndm_strmap_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ ndm_strmap_size(struct ndm_strmap_t const *);
bool ndm_strmap_is_empty(const struct ndm_strmap_t *map) {
  return ndm_strmap_size(map) == 0;
}


x86 assembly (clang, -O0):
<ndm_strmap_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ndm_strmap_size@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ndm_strmap_t = type { i32 }
define i32 @ndm_strmap_is_empty(%struct.ndm_strmap_t* %0) {
%2 = alloca %struct.ndm_strmap_t*
store %struct.ndm_strmap_t* %0, %struct.ndm_strmap_t** %2
%3 = load %struct.ndm_strmap_t*, %struct.ndm_strmap_t** %2
%4 = call i64 @ndm_strmap_size(%struct.ndm_strmap_t* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.ndm_strmap_t = type { i32 }
define i32 @ndm_strmap_is_empty(%struct.ndm_strmap_t* %0) {
%2 = tail call i64 @ndm_strmap_size(%struct.ndm_strmap_t* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void ptrace_sandbox_permit_chmod(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

LLVM IR (-O0):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_chmod(%struct.pt_sandbox* %0) {
%2 = alloca %struct.pt_sandbox*
store %struct.pt_sandbox* %0, %struct.pt_sandbox** %2
%3 = load %struct.pt_sandbox*, %struct.pt_sandbox** %2
ret void
}

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_chmod(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hoic_sw(int, int);
int hdoip_cli_ready(int fd, int fdr, char **argv, int argc) {
  hoic_sw(fd, (0x31000008));
  return 0;
}


x86 assembly (clang, -O0):
<hdoip_cli_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x31000008,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdoip_cli_ready>:
push   %rax
mov    $0x31000008,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hdoip_cli_ready(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = call i32 @hoic_sw(i32 %9, i32 822083592)
ret i32 0
}

LLVM IR (-O2):
define i32 @hdoip_cli_ready(i32 %0, i32 %1, i8** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @hoic_sw(i32 %0, i32 822083592)
ret i32 0
}
/* Variables and functions */
int errno;
void posix_errno_set(int e) { errno = e; }


x86 assembly (clang, -O0):
<posix_errno_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
@errno = global i32 0
define void @posix_errno_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @posix_errno_set(i32 %0) {
store i32 %0, i32* @errno
ret void
}
/* Variables and functions */
scalar_t__ isupper(char);
char shiftforward(char c, int key) {
  if (isupper(c))
    return ((c - 'A' + key) % 26) + 'A';
  return ((c - 'a' + key) % 26) + 'a';
}


x86 assembly (clang, -O0):
<shiftforward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     1153 <shiftforward+0x43>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    -0x8(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%al
mov    %al,-0x1(%rbp)
jmp    116d <shiftforward+0x5d>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    -0x8(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftforward>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <isupper@plt>
xor    %edx,%edx
test   %rax,%rax
sete   %cl
setne  %dl
shl    $0x5,%edx
add    %ebp,%edx
shl    $0x5,%cl
lea    (%rbx,%rdx,1),%eax
add    $0xffffff9f,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %esi,%eax
add    %cl,%al
add    $0x41,%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @shiftforward(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i8, i8* %4
%7 = call i64 @isupper(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 65
%13 = load i32, i32* %5
%14 = add nsw i32 %12, %13
%15 = srem i32 %14, 26
%16 = add nsw i32 %15, 65
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
br label %27
18: ; preds = %2
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 97
%22 = load i32, i32* %5
%23 = add nsw i32 %21, %22
%24 = srem i32 %23, 26
%25 = add nsw i32 %24, 97
%26 = trunc i32 %25 to i8
store i8 %26, i8* %3
br label %27
27: ; preds = %18, %9
%28 = load i8, i8* %3
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @shiftforward(i8 signext %0, i32 %1) {
%3 = tail call i64 @isupper(i8 signext %0)
%4 = icmp eq i64 %3, 0
%5 = sext i8 %0 to i32
%6 = select i1 %4, i32 -97, i32 -65
%7 = select i1 %4, i8 97, i8 65
%8 = add nsw i32 %6, %5
%9 = add nsw i32 %8, %1
%10 = srem i32 %9, 26
%11 = trunc i32 %10 to i8
%12 = add nsw i8 %7, %11
ret i8 %12
}
/* Type definitions */
struct Buffer {
  int dummy;
};

/* Variables and functions */
size_t buffer_copy_logic(struct Buffer *, void *, size_t, int);
size_t buffer_copy_next(void *buf, void *data, size_t length) {
  struct Buffer *buffer = buf;
  return buffer_copy_logic(buffer, data, length, 1);
}


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

x86 assembly (clang, -O2):
<buffer_copy_next>:
mov    $0x1,%ecx
jmp    1030 <buffer_copy_logic@plt>

LLVM IR (-O0):
%struct.Buffer = type { i32 }
define i64 @buffer_copy_next(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.Buffer*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.Buffer*
store %struct.Buffer* %9, %struct.Buffer** %7
%10 = load %struct.Buffer*, %struct.Buffer** %7
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i64 @buffer_copy_logic(%struct.Buffer* %10, i8* %11, i64 %12, i32 1)
ret i64 %13
}

LLVM IR (-O2):
%struct.Buffer = type { i32 }
define i64 @buffer_copy_next(i8* %0, i8* %1, i64 %2) {
%4 = bitcast i8* %0 to %struct.Buffer*
%5 = tail call i64 @buffer_copy_logic(%struct.Buffer* %4, i8* %1, i64 %2, i32 1)
ret i64 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_read_standard_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(30, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_read_standard_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_read_standard_solutions>:
mov    $0x1e,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_read_standard_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 30, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_read_standard_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 30, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ AG();
int /*<<< orphan*/ srand(int);
int main(int argc, char *argv[]) {
  srand(3);
  AG();
  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    $0x3,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1040 <AG@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1040 <AG@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srand(i32 3)
%4 = tail call i32 (...) @AG()
ret i32 0
}
/* Variables and functions */
scalar_t__ strerror(int);
const char *snd_strerror(int errnum) {
  if (errnum < 0)
    errnum = -errnum;
  return (const char *)strerror(errnum);
}


x86 assembly (clang, -O0):
<snd_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112d <snd_strerror+0x1d>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <strerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_strerror>:
mov    %edi,%eax
neg    %eax
cmovns %eax,%edi
jmp    1030 <strerror@plt>

LLVM IR (-O0):
define i8* @snd_strerror(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 %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i64 @strerror(i32 %9)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @snd_strerror(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i64 @strerror(i32 %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(short *, int, int, int /*<<< orphan*/ *);
void fput_short(short val, FILE *file) { fwrite(&val, sizeof(short), 1, file); }


x86 assembly (clang, -O0):
<fput_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput_short>:
push   %rax
mov    %rsi,%rcx
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fput_short(i16 signext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @fwrite(i16* %3, i32 2, i32 1, i32* %5)
ret void
}

LLVM IR (-O2):
define void @fput_short(i16 signext %0, i32* nocapture %1) {
%3 = alloca i16
store i16 %0, i16* %3
%4 = call i32 @fwrite(i16* %3, i32 2, i32 1, i32* %1)
ret void
}
void vnum_result10(int *data) {
  int i = data[0];
  int m = i + 1;
  int j = data[1];
  int n = j + 1;
  data[2] = m + n;
  if (i == j)
    data[3] = 0;
}


x86 assembly (clang, -O0):
<vnum_result10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
add    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1151 <vnum_result10+0x51>
mov    -0x8(%rbp),%rax
movl   $0x0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnum_result10>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
lea    (%rax,%rcx,1),%edx
add    $0x2,%edx
mov    %edx,0x8(%rdi)
cmp    %ecx,%eax
jne    1119 <vnum_result10+0x19>
movl   $0x0,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @vnum_result10(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = add i32 %2, 2
%6 = add i32 %5, %4
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = icmp eq i32 %2, %4
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = getelementptr inbounds i32, i32* %0, i64 3
store i32 0, i32* %10
br label %11
11: ; preds = %9, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void kdCheckFile(FILE *fp, char *name) {
  if (fp == NULL) {
    fprintf(stderr, "ERROR opening file %s\n", name);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<kdCheckFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115e <kdCheckFile+0x3e>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kdCheckFile>:
test   %rdi,%rdi
je     1126 <kdCheckFile+0x6>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"ERROR opening file %s\0A\00"
define void @kdCheckFile(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 = icmp eq i32* %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"ERROR opening file %s\0A\00"
define void @kdCheckFile(i32* readnone %0, i8* %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
const char *iof_type_repr(int type) {
  static const char *type_repr[] = {
      "REG",
      "SOCK",
      "OTHER",
  };
  return (type >= 0 && type < (sizeof(type_repr) / sizeof(type_repr[0])))
             ? type_repr[type]
             : "UNKONWN";
}


x86 assembly (clang, -O0):
<iof_type_repr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1137 <iof_type_repr+0x37>
movslq -0x4(%rbp),%rax
cmp    $0x3,%rax
jae    1137 <iof_type_repr+0x37>
movslq -0x4(%rbp),%rcx
lea    0x2f06(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <iof_type_repr+0x47>
lea    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <iof_type_repr+0x47>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iof_type_repr>:
cmp    $0x2,%edi
ja     1116 <iof_type_repr+0x16>
mov    %edi,%eax
lea    0xef2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xefe(%rip),%rax
ret

LLVM IR (-O0):
@iof_type_repr.type_repr = internal global [3 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0)]
@.str = [4 x i8] c"REG\00"
@.str.1 = [5 x i8] c"SOCK\00"
@.str.2 = [6 x i8] c"OTHER\00"
@.str.3 = [8 x i8] c"UNKONWN\00"
define i8* @iof_type_repr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [3 x i8*], [3 x i8*]* @iof_type_repr.type_repr, i64 0, i64 %11
%13 = load i8*, i8** %12
br label %15
14: ; preds = %5, %1
br label %15
15: ; preds = %14, %9
%16 = phi i8* [ %13, %9 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %14 ]
ret i8* %16
}

LLVM IR (-O2):
@reltable.iof_type_repr = internal unnamed_addr constant [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.iof_type_repr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.iof_type_repr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.iof_type_repr to i64)) to i32)]
@.str = [4 x i8] c"REG\00"
@.str.1 = [5 x i8] c"SOCK\00"
@.str.2 = [6 x i8] c"OTHER\00"
@.str.3 = [8 x i8] c"UNKONWN\00"
define i8* @iof_type_repr(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.iof_type_repr to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int strlen(char *);
int rind(char *s, char c) {
  register int x;
  for (x = strlen(s) - 1; x != -1; x--)
    if (s[x] == c)
      return x;
  return -1;
}


x86 assembly (clang, -O0):
<rind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
je     1171 <rind+0x61>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    115e <rind+0x4e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <rind+0x68>
jmp    1163 <rind+0x53>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <rind+0x21>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rind>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
mov    %rcx,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
sub    $0x1,%rax
jb     1142 <rind+0x32>
cmp    %bpl,-0x1(%rbx,%rcx,1)
mov    %rax,%rcx
jne    1130 <rind+0x20>
jmp    1147 <rind+0x37>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rind(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
br label %5
5: ; preds = %9, %2
%6 = phi i64 [ %7, %9 ], [ %4, %2 ]
%7 = add nsw i64 %6, -1
%8 = icmp eq i64 %6, 0
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 %7
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %9
%14 = trunc i64 %7 to i32
br label %15
15: ; preds = %5, %13
%16 = phi i32 [ %14, %13 ], [ -1, %5 ]
ret i32 %16
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double getFloatTime(void) {
  struct timeval t;
  gettimeofday(&t, 0);
  return (double)t.tv_sec + (double)t.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<getFloatTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFloatTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @getFloatTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @getFloatTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
void sgx_init_quote() {}


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

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

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

LLVM IR (-O2):
define void @sgx_init_quote() {
ret void
}
int is_a_bmp(file_name)
char *file_name;
{}


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

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

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

LLVM IR (-O2):
define i32 @is_a_bmp(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
double M_PI;
double sin(double);
double sind(double theta) { return sin(theta * M_PI / 180.0); }


x86 assembly (clang, -O0):
<sind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xecb(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sind>:
mov    0x2ed1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xedd(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @sind(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
%7 = call double @sin(double %6)
ret double %7
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @sind(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
%5 = tail call double @sin(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x, y, res1, res2;
  if (1 > 0)
    res1 = 1111;
  else
    res1 = 2222;
  x = 1;
  y = -1;
  if (x > y)
    res2 = 3333;
  else
    res2 = 4444;
  print_int(res1);
  print_string("\n");
  print_int(res2);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x457,-0xc(%rbp)
movl   $0x1,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1155 <main+0x35>
movl   $0xd05,-0x10(%rbp)
jmp    115c <main+0x3c>
movl   $0x115c,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe95(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x10(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe81(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x457,%edi
call   1040 <print_int@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_string@plt>
mov    $0xd05,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1111, i32* %3
store i32 1, i32* %1
store i32 -1, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 3333, i32* %4
br label %10
9: ; preds = %0
store i32 4444, i32* %4
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
%12 = call i32 @print_int(i32 %11)
%13 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %4
%15 = call i32 @print_int(i32 %14)
%16 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_int(i32 1111)
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_int(i32 3333)
%4 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *memset_(void *s, const char c, size_t count) {
  char *xs = (char *)s;
  while (count--)
    *xs++ = c;
  *--xs = '\0';
  return s;
}


x86 assembly (clang, -O0):
<memset_>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     114c <memset_+0x4c>
mov    -0x9(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    111a <memset_+0x1a>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,-0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rax
test   %rdx,%rdx
je     1134 <memset_+0x24>
mov    %rdx,%rbx
movzbl %sil,%esi
mov    %r14,%rdi
call   1030 <memset@plt>
add    %r14,%rbx
mov    %rbx,%rax
movb   $0x0,-0x1(%rax)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @memset_(i8* returned writeonly %0, i8 signext %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = getelementptr i8, i8* %0, i64 %2
br label %7
7: ; preds = %5, %3
%8 = phi i8* [ %0, %3 ], [ %6, %5 ]
%9 = getelementptr inbounds i8, i8* %8, i64 -1
store i8 0, i8* %9
ret i8* %0
}
/* Variables and functions */
unsigned int __rc_cmpxchgl(int volatile *, int, int);
void __rc_spinlock_acquire(volatile int *l) {
  int old = *l;
  while (old == 1 || __rc_cmpxchgl(l, old, 1) != (unsigned)old)
    old = *l;
}


x86 assembly (clang, -O0):
<__rc_spinlock_acquire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     114e <__rc_spinlock_acquire+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <__rc_cmpxchgl@plt>
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115e <__rc_spinlock_acquire+0x4e>
jmp    116c <__rc_spinlock_acquire+0x5c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <__rc_spinlock_acquire+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rc_spinlock_acquire>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%ebp
cmp    $0x1,%ebp
je     1120 <__rc_spinlock_acquire+0x10>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
call   1030 <__rc_cmpxchgl@plt>
cmp    %ebp,%eax
jne    1120 <__rc_spinlock_acquire+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @__rc_spinlock_acquire(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load volatile i32, i32* %4
store i32 %5, i32* %3
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 1
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = call i32 @__rc_cmpxchgl(i32* %10, i32 %11, i32 1)
%13 = load i32, i32* %3
%14 = icmp ne i32 %12, %13
br label %15
15: ; preds = %9, %6
%16 = phi i1 [ true, %6 ], [ %14, %9 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i32*, i32** %2
%19 = load volatile i32, i32* %18
store i32 %19, i32* %3
br label %6
20: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @__rc_spinlock_acquire(i32* %0) {
br label %2
2: ; preds = %5, %1
%3 = load volatile i32, i32* %0
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %2, %6
br label %2
6: ; preds = %2
%7 = tail call i32 @__rc_cmpxchgl(i32* %0, i32 %3, i32 1)
%8 = icmp eq i32 %7, %3
br i1 %8, label %9, label %5
9: ; preds = %6
ret void
}
double lin_inter(double x, double y, double s) { return x + s * (y - x); }


x86 assembly (clang, -O0):
<lin_inter>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lin_inter>:
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @lin_inter(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %0)
ret double %5
}
int isprint(int c) { return ((c >= 0x20) && (c < 0x7f)); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
void(outb_local)(unsigned char value, int port) {
  {
    ;
    return;
  }
}


x86 assembly (clang, -O0):
<outb_local>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @outb_local(i8 zeroext %0, i32 %1) {
ret void
}