xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ interrupt(int, int, char *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void executeForegroundCommand(char *args[]) {
  interrupt(0x21, 0xa, args[1], 0, 0);
  return;
}


x86 assembly (clang, -O0):
<executeForegroundCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x21,%edi
mov    $0xa,%esi
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <interrupt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeForegroundCommand>:
mov    0x8(%rdi),%rdx
mov    $0x21,%edi
mov    $0xa,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <interrupt@plt>

LLVM IR (-O0):
define void @executeForegroundCommand(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %4
%6 = call i32 @interrupt(i32 33, i32 10, i8* %5, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @executeForegroundCommand(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32 @interrupt(i32 33, i32 10, i8* %3, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemonServer(int, char **);
int main(int argc, char *argv[]) { daemonServer(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @daemonServer(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ mkdtemp(char *);
int /*<<< orphan*/ strcat(char *, char *);
int pyi_test_temp_path(char *buff) {
  strcat(buff, "/_MEIXXXXXX");
  if (mkdtemp(buff)) {
    strcat(buff, "/");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<pyi_test_temp_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
call   1030 <mkdtemp@plt>
cmp    $0x0,%rax
je     116b <pyi_test_temp_path+0x4b>
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strcat@plt>
movl   $0x1,-0x4(%rbp)
jmp    1172 <pyi_test_temp_path+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pyi_test_temp_path>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <mkdtemp@plt>
test   %rax,%rax
je     1153 <pyi_test_temp_path+0x33>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/_MEIXXXXXX\00"
@.str.1 = [2 x i8] c"/\00"
define i32 @pyi_test_temp_path(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i64 @mkdtemp(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"/_MEIXXXXXX\00"
@.str.1 = [2 x i8] c"/\00"
define i32 @pyi_test_temp_path(i8* %0) {
%2 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @mkdtemp(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int havege_random(void *, char *, size_t);
int random_stub_nsl(void *havege_state, char *output, size_t len) {
  return havege_random(havege_state, output, len);
}


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

x86 assembly (clang, -O2):
<random_stub_nsl>:
jmp    1030 <havege_random@plt>

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

LLVM IR (-O2):
define i32 @random_stub_nsl(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @havege_random(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_LookAt_init(void) {
  _hmt_register_covercase("HMM_LookAt", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_LookAt_init>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"HMM_LookAt\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LookAt_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_SIZE16_swap(char *, int);
void U_WMRSETRELABS_swap(char *record, int torev) {
  U_WMRCORE_SIZE16_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_WMRSETRELABS_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <U_WMRCORE_SIZE16_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRSETRELABS_swap>:
jmp    1030 <U_WMRCORE_SIZE16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRSETRELABS_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_SIZE16_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int, int, int);
void DoTwoSwap(void) { InlineWords(4, 19, 40, 19, 41); }


x86 assembly (clang, -O0):
<DoTwoSwap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x13,%ecx
mov    $0x28,%edx
mov    $0x29,%r8d
mov    %ecx,%esi
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoTwoSwap>:
mov    $0x4,%edi
mov    $0x13,%esi
mov    $0x28,%edx
mov    $0x13,%ecx
mov    $0x29,%r8d
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoTwoSwap() {
%1 = call i32 @InlineWords(i32 4, i32 19, i32 40, i32 19, i32 41)
ret void
}

LLVM IR (-O2):
define void @DoTwoSwap() {
%1 = tail call i32 @InlineWords(i32 4, i32 19, i32 40, i32 19, i32 41)
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int get_time_msec() {
  int mtime;
  struct timeval tv;
  gettimeofday(&tv, NULL);
  mtime = tv.tv_usec / 1000;
  return mtime;
}


x86 assembly (clang, -O0):
<get_time_msec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_msec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @get_time_msec() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @get_time_msec() {
%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 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
ret i32 %6
}
void ff_hevc_put_hevc_uni_w_epel_h32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h32_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void putname(char pnam[][20], int n) {
  int j;
  for (j = 0; j < n; j++) {
    printf("the name of [%d] is %s.\n", j, pnam[j]);
  }
}


x86 assembly (clang, -O0):
<putname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <putname+0x4e>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rdx
movslq -0x10(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rdx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <putname+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"the name of [%d] is %s.\0A\00"
define void @putname([20 x i8]* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %7, i64 0
%9 = trunc i64 %7 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %8)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
struct timespec {
  int member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void msleep(unsigned int msecs) {
  struct timespec time = {0, 1000000 * msecs};
  nanosleep(&time, NULL);
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
imul   $0xf4240,-0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
push   %rax
movl   $0x0,(%rsp)
imul   $0xf4240,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%6 = load i32, i32* %2
%7 = mul i32 1000000, %6
store i32 %7, i32* %5
%8 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @msleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%6 = mul i32 %0, 1000000
store i32 %6, i32* %5
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *getenv(char *);
int /*<<< orphan*/ rt_checker_violation_found();
scalar_t__ strlen(char *);
void __rtcheck_violation() {
  rt_checker_violation_found();
  char *e = getenv("RTCHECK_ABORT");
  if (e != NULL && strlen(e) > 0) {
    abort();
  }
}


x86 assembly (clang, -O0):
<__rtcheck_violation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rt_checker_violation_found@plt>
lea    0xeaa(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1184 <__rtcheck_violation+0x44>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
jle    1184 <__rtcheck_violation+0x44>
mov    $0x0,%al
call   1040 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rtcheck_violation>:
push   %rax
xor    %eax,%eax
call   1060 <rt_checker_violation_found@plt>
lea    0xeb1(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1166 <__rtcheck_violation+0x26>
mov    %rax,%rdi
call   1050 <strlen@plt>
test   %rax,%rax
jg     1168 <__rtcheck_violation+0x28>
pop    %rax
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"RTCHECK_ABORT\00"
define void @__rtcheck_violation() {
%1 = alloca i8*
%2 = call i32 (...) @rt_checker_violation_found()
%3 = call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i8*, i8** %1
%8 = call i64 @strlen(i8* %7)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"RTCHECK_ABORT\00"
define void @__rtcheck_violation() {
%1 = tail call i32 (...) @rt_checker_violation_found()
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i64 @strlen(i8* %2)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %4, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundcets_fileno(FILE *stream) {
  return fileno(stream);
}


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

x86 assembly (clang, -O2):
<softboundcets_fileno>:
jmp    1030 <fileno@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_fileno(i32* %0) {
%2 = tail call i32 @fileno(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
void threefish_invmix(void *data, uint8_t rot) {
  uint64_t x;
  x = (((uint64_t *)data)[1]);
  x ^= (((uint64_t *)data)[0]);
  (((uint64_t *)data)[1]) = ((x >> rot) | (x << (64 - rot)));
  (((uint64_t *)data)[0]) -= (((uint64_t *)data)[1]);
}


x86 assembly (clang, -O0):
<threefish_invmix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x40,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x14(%rbp),%ecx
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<threefish_invmix>:
mov    %esi,%ecx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
xor    %eax,%edx
mov    %edx,%esi
sar    %cl,%esi
neg    %cl
shl    %cl,%edx
or     %esi,%edx
mov    %edx,0x4(%rdi)
sub    %edx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @threefish_invmix(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = load i32, i32* %5
%15 = xor i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = ashr i32 %16, %17
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = sub nsw i32 64, %20
%22 = shl i32 %19, %21
%23 = or i32 %18, %22
%24 = load i8*, i8** %3
%25 = bitcast i8* %24 to i32*
%26 = getelementptr inbounds i32, i32* %25, i64 1
store i32 %23, i32* %26
%27 = load i8*, i8** %3
%28 = bitcast i8* %27 to i32*
%29 = getelementptr inbounds i32, i32* %28, i64 1
%30 = load i32, i32* %29
%31 = load i8*, i8** %3
%32 = bitcast i8* %31 to i32*
%33 = getelementptr inbounds i32, i32* %32, i64 0
%34 = load i32, i32* %33
%35 = sub nsw i32 %34, %30
store i32 %35, i32* %33
ret void
}

LLVM IR (-O2):
define void @threefish_invmix(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = load i32, i32* %3
%8 = xor i32 %7, %6
%9 = ashr i32 %8, %1
%10 = sub nsw i32 64, %1
%11 = shl i32 %8, %10
%12 = or i32 %9, %11
store i32 %12, i32* %5
%13 = sub nsw i32 %7, %12
store i32 %13, i32* %3
ret void
}
void uart_init() {
  (*((volatile unsigned short *)0x7F008000)) &= ~0xff;
  (*((volatile unsigned short *)0x7F008000)) |= 0x22;
  (*((volatile unsigned long *)0x7F005000)) = 0b11;
  (*((volatile unsigned long *)0x7F005004)) = 0b0101;
  (*((volatile unsigned long *)0x7F005008)) = 1;
  (*((volatile unsigned short *)0x7F005028)) =
      (int)(66500000 / (115200 * 16) - 1);
  (*((volatile unsigned short *)0x7F00502C)) = 0x0080;
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008000,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0xffffff00,%eax
mov    %ax,%cx
mov    $0x7f008000,%eax
mov    %cx,(%rax)
mov    $0x7f008000,%eax
mov    (%rax),%ax
movzwl %ax,%eax
or     $0x22,%eax
mov    %ax,%cx
mov    $0x7f008000,%eax
mov    %cx,(%rax)
mov    $0x7f005000,%eax
movq   $0x3,(%rax)
mov    $0x7f005004,%eax
movq   $0x5,(%rax)
mov    $0x7f005008,%eax
movq   $0x1,(%rax)
mov    $0x7f005028,%eax
movw   $0x23,(%rax)
mov    $0x7f00502c,%eax
movw   $0x80,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
andw   $0xff00,0x7f008000
orw    $0x22,0x7f008000
7f 22
movq   $0x3,0x7f005000
movq   $0x5,0x7f005004
movq   $0x1,0x7f005008
movw   $0x23,0x7f005028
movw   $0x80,0x7f00502c
ret

LLVM IR (-O0):
define void @uart_init() {
%1 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%2 = zext i16 %1 to i32
%3 = and i32 %2, -256
%4 = trunc i32 %3 to i16
store volatile i16 %4, i16* inttoptr (i64 2130739200 to i16*)
%5 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%6 = zext i16 %5 to i32
%7 = or i32 %6, 34
%8 = trunc i32 %7 to i16
store volatile i16 %8, i16* inttoptr (i64 2130739200 to i16*)
store volatile i64 3, i64* inttoptr (i64 2130726912 to i64*)
store volatile i64 5, i64* inttoptr (i64 2130726916 to i64*)
store volatile i64 1, i64* inttoptr (i64 2130726920 to i64*)
store volatile i16 35, i16* inttoptr (i64 2130726952 to i16*)
store volatile i16 128, i16* inttoptr (i64 2130726956 to i16*)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
%1 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%2 = and i16 %1, -256
store volatile i16 %2, i16* inttoptr (i64 2130739200 to i16*)
%3 = load volatile i16, i16* inttoptr (i64 2130739200 to i16*)
%4 = or i16 %3, 34
store volatile i16 %4, i16* inttoptr (i64 2130739200 to i16*)
store volatile i64 3, i64* inttoptr (i64 2130726912 to i64*)
store volatile i64 5, i64* inttoptr (i64 2130726916 to i64*)
store volatile i64 1, i64* inttoptr (i64 2130726920 to i64*)
store volatile i16 35, i16* inttoptr (i64 2130726952 to i16*)
store volatile i16 128, i16* inttoptr (i64 2130726956 to i16*)
ret void
}
/* Variables and functions */
int strlen(char *);
int hasTrailingSlash(char *s) { return s[strlen(s) - 1] == '/'; }


x86 assembly (clang, -O0):
<hasTrailingSlash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasTrailingSlash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x2f,-0x1(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hasTrailingSlash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 47
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @hasTrailingSlash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Warning(char *warning_message) {
  fprintf(stderr, "Warning: %s\n", warning_message);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<Warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Warning>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"Warning: %s\0A\00"
define void @Warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar1();
int /*<<< orphan*/ bar2();
void foo(unsigned int a, unsigned int b) {
  if (a >= b)
    bar1();
  else if (a <= b)
    bar2();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     1146 <foo+0x26>
mov    $0x0,%al
call   1040 <bar1@plt>
jmp    115e <foo+0x3e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     1159 <foo+0x39>
mov    $0x0,%al
call   1030 <bar2@plt>
jmp    115e <foo+0x3e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    %esi,%edi
jae    112b <foo+0xb>
jmp    1030 <bar2@plt>
jmp    1040 <bar1@plt>

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp uge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @bar1()
br label %17
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp ule i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (...) @bar2()
br label %16
16: ; preds = %14, %10
br label %17
17: ; preds = %16, %8
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @bar1()
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @bar2()
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TxTimedByte(int /*<<< orphan*/, char);
void TxTimedString(const char *str, char txDelay) {
  while (*str) {
    TxTimedByte(*str++, txDelay);
  }
}


x86 assembly (clang, -O0):
<TxTimedString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <TxTimedString+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
movsbl -0x9(%rbp),%esi
call   1030 <TxTimedByte@plt>
jmp    1122 <TxTimedString+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TxTimedString>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <TxTimedString+0x35>
mov    %rdi,%rbx
add    $0x1,%rbx
movsbl %sil,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <TxTimedByte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <TxTimedString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @TxTimedString(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @TxTimedByte(i32 %9, i8 signext %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int main(int argc, char *argv[]) {
  const char *s = "Hello, World!";
  printf("%s\n", s);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void voidfunc(void) {}


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

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

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

LLVM IR (-O2):
define void @voidfunc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MS_INVALIDATE;
int /*<<< orphan*/ msync(void *, size_t, int /*<<< orphan*/);
void mfile_flush(void *mem, size_t length) {
  msync(mem, length, MS_INVALIDATE);
}


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

x86 assembly (clang, -O2):
<mfile_flush>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <msync@plt>

LLVM IR (-O0):
@MS_INVALIDATE = global i32 0
define void @mfile_flush(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @MS_INVALIDATE
%8 = call i32 @msync(i8* %5, i64 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@MS_INVALIDATE = global i32 0
define void @mfile_flush(i8* %0, i64 %1) {
%3 = load i32, i32* @MS_INVALIDATE
%4 = tail call i32 @msync(i8* %0, i64 %1, i32 %3)
ret void
}
/* Variables and functions */
double sqrt(double);
double resultant(double lat, double lon) {
  double x = (lon - 77.987309) * 111974.434;
  double y = (lat - 41.996243) * 82226.69901;
  return sqrt(x * x + y * y);
}


x86 assembly (clang, -O0):
<resultant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resultant>:
addsd  0xee8(%rip),%xmm1
mulsd  0xee8(%rip),%xmm1
addsd  0xee8(%rip),%xmm0
mulsd  0xee8(%rip),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     114e <resultant+0x3e>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
ret
movapd %xmm1,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @resultant(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = fsub double %7, 0x40537F30121682F9
%9 = fmul double %8, 0x40FB5666F1A9FBE7
store double %9, double* %5
%10 = load double, double* %3
%11 = fsub double %10, 0x4044FF84E3FFEF39
%12 = fmul double %11, 0x40F4132B2F251C19
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %5
%15 = load double, double* %6
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = call double @llvm.fmuladd.f64(double %13, double %14, double %17)
%19 = call double @sqrt(double %18)
ret double %19
}

LLVM IR (-O2):
define double @resultant(double %0, double %1) {
%3 = fadd double %1, 0xC0537F30121682F9
%4 = fmul double %3, 0x40FB5666F1A9FBE7
%5 = fadd double %0, 0xC044FF84E3FFEF39
%6 = fmul double %5, 0x40F4132B2F251C19
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %7)
%9 = tail call double @sqrt(double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ fgetpwent(int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  fgetpwent(0);
  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)
xor    %edi,%edi
call   1030 <fgetpwent@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <fgetpwent@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 @fgetpwent(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fgetpwent(i32 0)
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t oof2_state_size(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @oof2_state_size() {
ret i32 5
}

LLVM IR (-O2):
define i32 @oof2_state_size() {
ret i32 5
}
/* Variables and functions */
scalar_t__ is_leap_year(int);
int year_size(int y) { return (is_leap_year(y)) ? 366 : 365; }


x86 assembly (clang, -O0):
<year_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_leap_year@plt>
mov    %rax,%rdx
mov    $0x16d,%eax
mov    $0x16e,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<year_size>:
push   %rax
call   1030 <is_leap_year@plt>
cmp    $0x1,%rax
mov    $0x16e,%eax
sbb    $0x0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @year_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @is_leap_year(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 366, i32 365
ret i32 %7
}

LLVM IR (-O2):
define i32 @year_size(i32 %0) {
%2 = tail call i64 @is_leap_year(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 365, i32 366
ret i32 %4
}
/* Variables and functions */
int _pb_print_bits(unsigned long *, int);
int _pb_print_bits_ul(unsigned long value) {
  return _pb_print_bits(&value, sizeof(unsigned long));
}


x86 assembly (clang, -O0):
<_pb_print_bits_ul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1030 <_pb_print_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pb_print_bits_ul>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <_pb_print_bits@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_pb_print_bits_ul(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @_pb_print_bits(i64* %2, i32 8)
ret i32 %3
}

LLVM IR (-O2):
define i32 @_pb_print_bits_ul(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @_pb_print_bits(i64* %2, i32 8)
ret i32 %3
}
const char *dynload_error(void) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @dynload_error() {
ret i8* undef
}
int lldesc_get_required_num(int data_size) {
  return (data_size + (4096 - 4) - 1) / (4096 - 4);
}


x86 assembly (clang, -O0):
<lldesc_get_required_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffc,%eax
sub    $0x1,%eax
mov    $0xffc,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<lldesc_get_required_num>:
mov    %edi,%eax
add    $0xffb,%eax
cltq
imul   $0xffffffff80200803,%rax,%rax
shr    $0x20,%rax
add    %edi,%eax
add    $0xffb,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xb,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @lldesc_get_required_num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 4092
%5 = sub nsw i32 %4, 1
%6 = sdiv i32 %5, 4092
ret i32 %6
}

LLVM IR (-O2):
define i32 @lldesc_get_required_num(i32 %0) {
%2 = add nsw i32 %0, 4091
%3 = sdiv i32 %2, 4092
ret i32 %3
}
/* Type definitions */
struct ipr_ioa {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ipr_write_host_attr(struct ipr_ioa *, char *, char *,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void set_log_level(struct ipr_ioa *ioa, char *log_level) {
  ipr_write_host_attr(ioa, "log_level", log_level, strlen(log_level));
}


x86 assembly (clang, -O0):
<set_log_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea6(%rip),%rsi
call   1030 <ipr_write_host_attr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_log_level>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0xec7(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ipr_write_host_attr@plt>

LLVM IR (-O0):
%struct.ipr_ioa = type { i32 }
@.str = [10 x i8] c"log_level\00"
define void @set_log_level(%struct.ipr_ioa* %0, i8* %1) {
%3 = alloca %struct.ipr_ioa*
%4 = alloca i8*
store %struct.ipr_ioa* %0, %struct.ipr_ioa** %3
store i8* %1, i8** %4
%5 = load %struct.ipr_ioa*, %struct.ipr_ioa** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @ipr_write_host_attr(%struct.ipr_ioa* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.ipr_ioa = type { i32 }
@.str = [10 x i8] c"log_level\00"
define void @set_log_level(%struct.ipr_ioa* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @ipr_write_host_attr(%struct.ipr_ioa* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %3)
ret void
}
int file_flush(struct Stream_t *Stream __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.Stream_t = type opaque
define i32 @file_flush(%struct.Stream_t* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int opt_count(char *str) {
  if (str == NULL) {
    return 0;
  } else {
    return atoi(str);
  }
}


x86 assembly (clang, -O0):
<opt_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <opt_count+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <opt_count+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_count>:
test   %rdi,%rdi
je     111a <opt_count+0xa>
jmp    1030 <atoi@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @opt_count(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @atoi(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int hconvert_main() { exit(EXIT_FAILURE); }


x86 assembly (clang, -O0):
<hconvert_main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<hconvert_main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @hconvert_main() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @hconvert_main() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
void *malloc(unsigned int const);
void *get_fragmented_memory_page() {
  const unsigned int large_size = 4096UL;
  const unsigned int small_size = 37UL;
  void *s_mem;
  void *l_mem;
  s_mem = malloc(small_size);
  l_mem = malloc(large_size);
  if (l_mem == NULL || s_mem == NULL)
    exit(EXIT_FAILURE);
  free(s_mem);
  return l_mem;
}


x86 assembly (clang, -O0):
<get_fragmented_memory_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1000,-0x4(%rbp)
movl   $0x25,-0x8(%rbp)
mov    $0x25,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1178 <get_fragmented_memory_page+0x48>
cmpq   $0x0,-0x10(%rbp)
jne    1186 <get_fragmented_memory_page+0x56>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fragmented_memory_page>:
push   %r14
push   %rbx
push   %rax
mov    $0x25,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    $0x1000,%edi
call   1040 <malloc@plt>
test   %r14,%r14
je     116b <get_fragmented_memory_page+0x3b>
mov    %rax,%rbx
test   %rax,%rax
je     116b <get_fragmented_memory_page+0x3b>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i8* @get_fragmented_memory_page() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 4096, i32* %1
store i32 37, i32* %2
%5 = call i8* @malloc(i32 37)
store i8* %5, i8** %3
%6 = call i8* @malloc(i32 4096)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = load i8*, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %9, %0
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i8* @get_fragmented_memory_page() {
%1 = tail call dereferenceable_or_null(37) i8* @malloc(i32 37)
%2 = tail call dereferenceable_or_null(4096) i8* @malloc(i32 4096)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %1, null
%5 = or i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = tail call i32 @free(i8* %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XBaseFontNameListOfFontSet() {
  printf("XBaseFontNameListOfFontSet called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"XBaseFontNameListOfFontSet called\0A\00"
define i32 @XBaseFontNameListOfFontSet() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"XBaseFontNameListOfFontSet called\00"
define i32 @XBaseFontNameListOfFontSet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_87uint16_mem(unsigned short *val) {
  return ((*val) & (0x87 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_87uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 135
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}