xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void utarray_str_dtor(void *elt) {
  char **eltc = (char **)elt;
  if (*eltc)
    free(*eltc);
}


x86 assembly (clang, -O0):
<utarray_str_dtor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113e <utarray_str_dtor+0x2e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utarray_str_dtor>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <utarray_str_dtor+0xd>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @utarray_str_dtor(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int fremovexattr(int, char *, int /*<<< orphan*/);
int xattrkv_del(int db, char *key) { return fremovexattr(db, key, 0); }


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

x86 assembly (clang, -O2):
<xattrkv_del>:
xor    %edx,%edx
jmp    1030 <fremovexattr@plt>

LLVM IR (-O0):
define i32 @xattrkv_del(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 @fremovexattr(i32 %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xattrkv_del(i32 %0, i8* %1) {
%3 = tail call i32 @fremovexattr(i32 %0, i8* %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  scalar_t__ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ add_q_timeout_tv(int, struct timeval *, void (*)(void *),
                                    void *);
void add_q_timeout_sec(int queue, time_t when, void (*callback)(void *),
                       void *arg) {
  struct timeval tv;
  tv.tv_sec = when;
  tv.tv_usec = 0;
  add_q_timeout_tv(queue, &tv, callback, arg);
}


x86 assembly (clang, -O0):
<add_q_timeout_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x28(%rbp),%rsi
call   1030 <add_q_timeout_tv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_q_timeout_sec>:
sub    $0x18,%rsp
mov    %esi,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1030 <add_q_timeout_tv@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define void @add_q_timeout_sec(i32 %0, i32 %1, void (i8*)* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca void (i8*)*
%8 = alloca i8*
%9 = alloca %struct.timeval
store i32 %0, i32* %5
store i32 %1, i32* %6
store void (i8*)* %2, void (i8*)** %7
store i8* %3, i8** %8
%10 = load i32, i32* %6
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
store i32 %10, i32* %11
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
store i64 0, i64* %12
%13 = load i32, i32* %5
%14 = load void (i8*)*, void (i8*)** %7
%15 = load i8*, i8** %8
%16 = call i32 @add_q_timeout_tv(i32 %13, %struct.timeval* %9, void (i8*)* %14, i8* %15)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define void @add_q_timeout_sec(i32 %0, i32 %1, void (i8*)* %2, i8* %3) {
%5 = alloca %struct.timeval
%6 = bitcast %struct.timeval* %5 to i8*
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
store i32 %1, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
store i64 0, i64* %8
%9 = call i32 @add_q_timeout_tv(i32 %0, %struct.timeval* %5, void (i8*)* %2, i8* %3)
ret void
}
void USRPROC_DRV_ModExit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @USRPROC_DRV_ModExit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void coffee(int sig) { puts("\ntime for coffee...\n"); }


x86 assembly (clang, -O0):
<coffee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coffee>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\0Atime for coffee...\0A\00"
define void @coffee(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0Atime for coffee...\0A\00"
define void @coffee(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _mx_strbeginswithany(char *, char **, char **, int);
int mx_stribeginswithany(char *str, char **starts, char **endptr) {
  return _mx_strbeginswithany(str, starts, endptr, 1);
}


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

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

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

LLVM IR (-O2):
define i32 @mx_stribeginswithany(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @_mx_strbeginswithany(i8* %0, i8** %1, i8** %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ erase_block(void *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ lock_heap();
int /*<<< orphan*/ scale_blocks_if_needed();
int /*<<< orphan*/ unlock_heap();
void heap_free(void *ptr) {
  scale_blocks_if_needed();
  lock_heap();
  erase_block(ptr);
  unlock_heap();
  free(ptr);
}


x86 assembly (clang, -O0):
<heap_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <scale_blocks_if_needed@plt>
mov    $0x0,%al
call   1070 <lock_heap@plt>
mov    -0x8(%rbp),%rdi
call   1060 <erase_block@plt>
mov    $0x0,%al
call   1040 <unlock_heap@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_free>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <scale_blocks_if_needed@plt>
xor    %eax,%eax
call   1070 <lock_heap@plt>
mov    %rbx,%rdi
call   1060 <erase_block@plt>
xor    %eax,%eax
call   1040 <unlock_heap@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @heap_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @scale_blocks_if_needed()
%4 = call i32 (...) @lock_heap()
%5 = load i8*, i8** %2
%6 = call i32 @erase_block(i8* %5)
%7 = call i32 (...) @unlock_heap()
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @heap_free(i8* %0) {
%2 = tail call i32 (...) @scale_blocks_if_needed()
%3 = tail call i32 (...) @lock_heap()
%4 = tail call i32 @erase_block(i8* %0)
%5 = tail call i32 (...) @unlock_heap()
%6 = tail call i32 @free(i8* %0)
ret void
}
void ps_print_page_numbers() {}


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

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

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

LLVM IR (-O2):
define void @ps_print_page_numbers() {
ret void
}
void ath_tx_kick(struct ath_softc *sc) {}


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

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

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

LLVM IR (-O2):
%struct.ath_softc = type opaque
define void @ath_tx_kick(%struct.ath_softc* nocapture %0) {
ret void
}
char toUnderLine(char c) {
  if (c == ' ')
    return '_';
  else
    return c;
}


x86 assembly (clang, -O0):
<toUnderLine>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jne    1120 <toUnderLine+0x20>
movb   $0x5f,-0x1(%rbp)
jmp    1126 <toUnderLine+0x26>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toUnderLine>:
cmp    $0x20,%dil
mov    $0x5f,%eax
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @toUnderLine(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = select i1 %2, i8 95, i8 %0
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ finalize_stats();
int /*<<< orphan*/ finalize_syscalls();
int /*<<< orphan*/ stopTrace();
int /*<<< orphan*/ writeInt(int);
int /*<<< orphan*/ writeStr(char *);
void exitHandler(int signo, siginfo_t *info, void *context) {
  stopTrace();
  writeStr("exit handler, caught signal ");
  writeInt(signo);
  writeStr("\n");
  finalize_stats();
  finalize_syscalls();
}


x86 assembly (clang, -O0):
<exitHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <stopTrace@plt>
lea    0xe8f(%rip),%rdi
call   1060 <writeStr@plt>
mov    -0x4(%rbp),%edi
call   1030 <writeInt@plt>
lea    0xe98(%rip),%rdi
call   1060 <writeStr@plt>
mov    $0x0,%al
call   1070 <finalize_stats@plt>
mov    $0x0,%al
call   1040 <finalize_syscalls@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exitHandler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <stopTrace@plt>
lea    0xe9f(%rip),%rdi
call   1060 <writeStr@plt>
mov    %ebx,%edi
call   1030 <writeInt@plt>
lea    0xea9(%rip),%rdi
call   1060 <writeStr@plt>
xor    %eax,%eax
call   1070 <finalize_stats@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <finalize_syscalls@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"exit handler, caught signal \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @exitHandler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 (...) @stopTrace()
%8 = call i32 @writeStr(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = call i32 @writeInt(i32 %9)
%11 = call i32 @writeStr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (...) @finalize_stats()
%13 = call i32 (...) @finalize_syscalls()
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"exit handler, caught signal \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @exitHandler(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @stopTrace()
%5 = tail call i32 @writeStr(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @writeInt(i32 %0)
%7 = tail call i32 @writeStr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (...) @finalize_stats()
%9 = tail call i32 (...) @finalize_syscalls()
ret void
}
float clamp2f(float val, float min, float max) {
  if (val < min)
    return min;
  else if (val > max)
    return max;
  else
    return val;
}


x86 assembly (clang, -O0):
<clamp2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clamp2f+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clamp2f+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <clamp2f+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clamp2f+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp2f>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clamp2f(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @clamp2f(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ parsingIntAttr(char *, int);
void zcb_onInteger(char *name, int value) {
  ;
  parsingIntAttr(name, value);
}


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

x86 assembly (clang, -O2):
<zcb_onInteger>:
jmp    1030 <parsingIntAttr@plt>

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

LLVM IR (-O2):
define void @zcb_onInteger(i8* %0, i32 %1) {
%3 = tail call i32 @parsingIntAttr(i8* %0, i32 %1)
ret void
}
void ff_hevc_put_hevc_bi_pel_pixels16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels16_10_sse4() {
ret void
}
int test_imm_74int64_lowword_reg(long long val) {
  return ((val) & (0x74 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_74int64_lowword_reg>:
test   $0x74,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_74int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 116
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int read_word(int, int);
int /*<<< orphan*/ write_byte(int, int, int);
int /*<<< orphan*/ write_word(int, int, int);
void init_bios_area() {
  write_word(0x40, 0x10, read_word(0x40, 0x10) & 0xFFCF);
  write_byte(0x40, 0x85, 16);
  write_byte(0x40, 0x87, 0x60);
  write_byte(0x40, 0x88, 0xF9);
  write_byte(0x40, 0x89, 0x51);
  write_byte(0x40, 0x65, 0x09);
}


x86 assembly (clang, -O0):
<init_bios_area>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0x10,%esi
call   1030 <read_word@plt>
mov    %eax,%edx
and    $0xffcf,%edx
mov    $0x40,%edi
mov    $0x10,%esi
call   1040 <write_word@plt>
mov    $0x40,%edi
mov    $0x85,%esi
mov    $0x10,%edx
call   1050 <write_byte@plt>
mov    $0x40,%edi
mov    $0x87,%esi
mov    $0x60,%edx
call   1050 <write_byte@plt>
mov    $0x40,%edi
mov    $0x88,%esi
mov    $0xf9,%edx
call   1050 <write_byte@plt>
mov    $0x40,%edi
mov    $0x89,%esi
mov    $0x51,%edx
call   1050 <write_byte@plt>
mov    $0x40,%edi
mov    $0x65,%esi
mov    $0x9,%edx
call   1050 <write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_bios_area>:
push   %rax
mov    $0x40,%edi
mov    $0x10,%esi
call   1030 <read_word@plt>
and    $0xffcf,%eax
mov    $0x40,%edi
mov    $0x10,%esi
mov    %eax,%edx
call   1040 <write_word@plt>
mov    $0x40,%edi
mov    $0x85,%esi
mov    $0x10,%edx
call   1050 <write_byte@plt>
mov    $0x40,%edi
mov    $0x87,%esi
mov    $0x60,%edx
call   1050 <write_byte@plt>
mov    $0x40,%edi
mov    $0x88,%esi
mov    $0xf9,%edx
call   1050 <write_byte@plt>
mov    $0x40,%edi
mov    $0x89,%esi
mov    $0x51,%edx
call   1050 <write_byte@plt>
mov    $0x40,%edi
mov    $0x65,%esi
mov    $0x9,%edx
pop    %rax
jmp    1050 <write_byte@plt>

LLVM IR (-O0):
define void @init_bios_area() {
%1 = call i32 @read_word(i32 64, i32 16)
%2 = and i32 %1, 65487
%3 = call i32 @write_word(i32 64, i32 16, i32 %2)
%4 = call i32 @write_byte(i32 64, i32 133, i32 16)
%5 = call i32 @write_byte(i32 64, i32 135, i32 96)
%6 = call i32 @write_byte(i32 64, i32 136, i32 249)
%7 = call i32 @write_byte(i32 64, i32 137, i32 81)
%8 = call i32 @write_byte(i32 64, i32 101, i32 9)
ret void
}

LLVM IR (-O2):
define void @init_bios_area() {
%1 = tail call i32 @read_word(i32 64, i32 16)
%2 = and i32 %1, 65487
%3 = tail call i32 @write_word(i32 64, i32 16, i32 %2)
%4 = tail call i32 @write_byte(i32 64, i32 133, i32 16)
%5 = tail call i32 @write_byte(i32 64, i32 135, i32 96)
%6 = tail call i32 @write_byte(i32 64, i32 136, i32 249)
%7 = tail call i32 @write_byte(i32 64, i32 137, i32 81)
%8 = tail call i32 @write_byte(i32 64, i32 101, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ forward(int, int);
int getClientForwardReceiver(int);
int /*<<< orphan*/ incoming__wrappee__Base(int, int);
int /*<<< orphan*/ setEmailTo(int, int);
void incoming(int client, int msg) {
  int fwreceiver;
  int tmp;
  {
    {
      incoming__wrappee__Base(client, msg);
      tmp = getClientForwardReceiver(client);
      fwreceiver = tmp;
    }
    if (fwreceiver) {
      {
        setEmailTo(msg, fwreceiver);
        forward(client, msg);
      }
    } else {
    }
    return;
  }
}


x86 assembly (clang, -O0):
<incoming>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <incoming__wrappee__Base@plt>
mov    -0x4(%rbp),%edi
call   1030 <getClientForwardReceiver@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     118f <incoming+0x4f>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <setEmailTo@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <forward@plt>
jmp    1194 <incoming+0x54>
jmp    1194 <incoming+0x54>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incoming>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <incoming__wrappee__Base@plt>
mov    %ebp,%edi
call   1030 <getClientForwardReceiver@plt>
test   %eax,%eax
je     116f <incoming+0x2f>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <setEmailTo@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <forward@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @incoming(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @incoming__wrappee__Base(i32 %7, i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @getClientForwardReceiver(i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @setEmailTo(i32 %16, i32 %17)
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 @forward(i32 %19, i32 %20)
br label %23
22: ; preds = %2
br label %23
23: ; preds = %22, %15
ret void
}

LLVM IR (-O2):
define void @incoming(i32 %0, i32 %1) {
%3 = tail call i32 @incoming__wrappee__Base(i32 %0, i32 %1)
%4 = tail call i32 @getClientForwardReceiver(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @setEmailTo(i32 %1, i32 %4)
%8 = tail call i32 @forward(i32 %0, i32 %1)
br label %9
9: ; preds = %2, %6
ret void
}
double tref_conv_dt_ns(int tdc) { return tdc * 7.8125e-3; }


x86 assembly (clang, -O0):
<tref_conv_dt_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tref_conv_dt_ns>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @tref_conv_dt_ns(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 7.812500e-03
ret double %5
}

LLVM IR (-O2):
define double @tref_conv_dt_ns(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 7.812500e-03
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ atomic_set_int(int *, int /*<<< orphan*/);
void release(int *l) {
  ;
  atomic_set_int(l, 0);
}


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

x86 assembly (clang, -O2):
<release>:
xor    %esi,%esi
jmp    1030 <atomic_set_int@plt>

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

LLVM IR (-O2):
define void @release(i32* %0) {
%2 = tail call i32 @atomic_set_int(i32* %0, i32 0)
ret void
}
int multi_line_while_conditional(int a, int b, int c) {
  while (a && b && c) {
    a--, b--, c--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<multi_line_while_conditional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
je     1135 <multi_line_while_conditional+0x35>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1135 <multi_line_while_conditional+0x35>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1145 <multi_line_while_conditional+0x45>
jmp    1165 <multi_line_while_conditional+0x65>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110d <multi_line_while_conditional+0xd>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @multi_line_while_conditional(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int a = 3;
  int b = 5;
  int c = 12;
  float as = (a + b + c) / 3.0;
  printf("Aritmetichkata sredina e %2.f\n", as);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0xc,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeb7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"Aritmetichkata sredina e %2.f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
store i32 3, i32* %2
store i32 5, i32* %3
store i32 12, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 3.000000e+00
%13 = fptrunc double %12 to float
store float %13, float* %5
%14 = load float, float* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Aritmetichkata sredina e %2.f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float 0x401AAAAAA0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[] = {2, 4, 6, 8, 10};
  int *p = x;
  int **pp = &p;
  (*pp)++;
  (*(*pp))++;
  printf("%d\n", *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
int ld_ge_cr1(long double a1) { return (((100) >= (a1))); }


x86 assembly (clang, -O0):
<ld_ge_cr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ge_cr1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_ge_cr1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp oge x86_fp80 0xK4005C800000000000000, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_ge_cr1(x86_fp80 %0) {
%2 = fcmp ole x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_control_word(int /*<<< orphan*/);
int /*<<< orphan*/ x87FPU_fstcw();
void print_fpu_control(void) { print_control_word(x87FPU_fstcw()); }


x86 assembly (clang, -O0):
<print_fpu_control>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <x87FPU_fstcw@plt>
mov    %eax,%edi
call   1030 <print_control_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fpu_control>:
push   %rax
xor    %eax,%eax
call   1040 <x87FPU_fstcw@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <print_control_word@plt>

LLVM IR (-O0):
define void @print_fpu_control() {
%1 = call i32 (...) @x87FPU_fstcw()
%2 = call i32 @print_control_word(i32 %1)
ret void
}

LLVM IR (-O2):
define void @print_fpu_control() {
%1 = tail call i32 (...) @x87FPU_fstcw()
%2 = tail call i32 @print_control_word(i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
uint32_t UARTFlowControlGet(uint32_t ui32Base) {
  ASSERT(_UARTBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x00000030))) &
          (0x00008000 | 0x00004000));
}


x86 assembly (clang, -O0):
<UARTFlowControlGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%eax
and    $0xc000,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFlowControlGet>:
push   %rbx
mov    %edi,%ebx
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rcx
mov    $0xc000,%eax
and    0x30(%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UARTFlowControlGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_UARTBaseValid(i32 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 48
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 49152
ret i32 %11
}

LLVM IR (-O2):
define i32 @UARTFlowControlGet(i32 %0) {
%2 = tail call i32 @_UARTBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i32 %0, 48
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 49152
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t URM_Program_array_new_capacity(size_t c, size_t i) {
  assert(c == c);
  return i * 2;
}


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

x86 assembly (clang, -O2):
<URM_Program_array_new_capacity>:
push   %rbx
mov    %rsi,%rbx
mov    $0x1,%edi
call   1030 <assert@plt>
add    %rbx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @URM_Program_array_new_capacity(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i64, i64* %4
%11 = mul i64 %10, 2
ret i64 %11
}

LLVM IR (-O2):
define i64 @URM_Program_array_new_capacity(i64 %0, i64 %1) {
%3 = tail call i32 @assert(i32 1)
%4 = shl i64 %1, 1
ret i64 %4
}
void INT_Excep_TPU10_TCI10U(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU10_TCI10U() {
ret void
}
const char *plugin_api_info_color_ansi_regex_cb(const void *pointer, void *data,
                                                const char *info_name,
                                                const char *arguments) {
  (void)pointer;
  (void)data;
  (void)info_name;
  (void)arguments;
  return "\33("
         "([()].)|"
         "([<>])|"
         "(\\[[0-9;?]*[A-Za-z]))";
}


x86 assembly (clang, -O0):
<plugin_api_info_color_ansi_regex_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xee5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"\1B(([()].)|([<>])|(\\[[0-9;?]*[A-Za-z]))\00"
define i8* @plugin_api_info_color_ansi_regex_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [39 x i8] c"\1B(([()].)|([<>])|(\\[[0-9;?]*[A-Za-z]))\00"
define i8* @plugin_api_info_color_ansi_regex_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
int collatzLengthRec(int n, int l) {
  if (n <= 1)
    return l;
  else if (n % 2 == 0)
    return collatzLengthRec(n / 2, l + 1);
  else
    return collatzLengthRec(3 * n + 1, l + 1);
}


x86 assembly (clang, -O0):
<collatzLengthRec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1133 <collatzLengthRec+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <collatzLengthRec+0x6c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <collatzLengthRec+0x57>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <collatzLengthRec@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <collatzLengthRec+0x6c>
imul   $0x3,-0x8(%rbp),%edi
add    $0x1,%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <collatzLengthRec@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collatzLengthRec>:
mov    %esi,%eax
cmp    $0x2,%edi
jl     1127 <collatzLengthRec+0x27>
nopw   0x0(%rax,%rax,1)
mov    %edi,%ecx
shr    %ecx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%edi
cmove  %ecx,%edi
add    $0x1,%eax
cmp    $0x1,%edi
jg     1110 <collatzLengthRec+0x10>
ret

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

LLVM IR (-O2):
define i32 @collatzLengthRec(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %13, %4 ], [ %1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %0, %2 ]
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = lshr i32 %6, 1
%10 = mul nsw i32 %6, 3
%11 = add nsw i32 %10, 1
%12 = select i1 %8, i32 %9, i32 %11
%13 = add nsw i32 %5, 1
%14 = icmp slt i32 %12, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ %1, %2 ], [ %13, %4 ]
ret i32 %16
}
/* Variables and functions */
unsigned long genrand_real1();
unsigned long MyRand(unsigned long a, unsigned long b) {
  return a + (unsigned long)(genrand_real1() * (b - a + 1));
}


x86 assembly (clang, -O0):
<MyRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <genrand_real1@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdx
sub    -0x8(%rbp),%rdx
add    $0x1,%rdx
imul   %rdx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyRand>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <genrand_real1@plt>
sub    %r14,%rbx
add    $0x1,%rbx
imul   %rbx,%rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @MyRand(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i64 (...) @genrand_real1()
%7 = load i64, i64* %4
%8 = load i64, i64* %3
%9 = sub i64 %7, %8
%10 = add i64 %9, 1
%11 = mul i64 %6, %10
%12 = add i64 %5, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @MyRand(i64 %0, i64 %1) {
%3 = tail call i64 (...) @genrand_real1()
%4 = sub i64 1, %0
%5 = add i64 %4, %1
%6 = mul i64 %3, %5
%7 = add i64 %6, %0
ret i64 %7
}
int main() {
  double *p;
  char *c;
  printf("size of p is %d\n", sizeof(p));
  printf("size of p is %d\n", sizeof(c));
  printf("%d=%d,%d\n", *&p, &*p, p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"size of p is %d\0A\00"
@.str.1 = [10 x i8] c"%d=%d,%d\0A\00"
define i32 @main() {
%1 = alloca double*
%2 = alloca i8*
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 8)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 8)
%5 = load double*, double** %1
%6 = load double*, double** %1
%7 = load double*, double** %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %5, double* %6, double* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"size of p is %d\0A\00"
@.str.1 = [10 x i8] c"%d=%d,%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 8)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 8)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* undef, double* undef, double* undef)
ret i32 0
}
int __dlinfo(void *handle, int req, void *v) { return -1; }


x86 assembly (clang, -O0):
<__dlinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__dlinfo(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @__dlinfo(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_yday;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int date_get_dayofyear(void) {
  time_t t;
  struct tm *lt;
  t = time(NULL);
  lt = localtime(&t);
  return lt->tm_yday;
}


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

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

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

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

/* Variables and functions */
int edid_from_file(char const *, struct edid_info *);
int get_edid_info(const char *filename, struct edid_info *info) {
  return edid_from_file(filename, info);
}


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

x86 assembly (clang, -O2):
<get_edid_info>:
jmp    1030 <edid_from_file@plt>

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

LLVM IR (-O2):
%struct.edid_info = type { i32 }
define i32 @get_edid_info(i8* %0, %struct.edid_info* %1) {
%3 = tail call i32 @edid_from_file(i8* %0, %struct.edid_info* %1)
ret i32 %3
}
int fun119() { return 119; }


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

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

LLVM IR (-O0):
define i32 @fun119() {
ret i32 119
}

LLVM IR (-O2):
define i32 @fun119() {
ret i32 119
}
void __libc_init(void) {
  extern void __set_std_buffering(void);
  extern void __set_up_heap(void);
  __set_std_buffering();
  __set_up_heap();
}


x86 assembly (clang, -O0):
<__libc_init>:
push   %rbp
mov    %rsp,%rbp
call   1040 <__set_std_buffering@plt>
call   1030 <__set_up_heap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_init>:
push   %rax
call   1040 <__set_std_buffering@plt>
pop    %rax
jmp    1030 <__set_up_heap@plt>

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

LLVM IR (-O2):
define void @__libc_init() {
tail call void @__set_std_buffering()
tail call void @__set_up_heap()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ littleEndian();
float floatSwap(float floatIn) {
  if (littleEndian()) {
    uint32_t num32 = *(uint32_t *)&floatIn;
    num32 = ((num32 >> 3 * 8) & 0x000000ff) | ((num32 << 1 * 8) & 0x00ff0000) |
            ((num32 >> 1 * 8) & 0x0000ff00) | ((num32 << 3 * 8) & 0xff000000);
    floatIn = *(float *)&num32;
    return floatIn;
  } else {
    return floatIn;
  }
}


x86 assembly (clang, -O0):
<floatSwap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <littleEndian@plt>
cmp    $0x0,%rax
je     1185 <floatSwap+0x75>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x18,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118f <floatSwap+0x7f>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatSwap>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <littleEndian@plt>
test   %rax,%rax
je     1135 <floatSwap+0x25>
movd   0x4(%rsp),%xmm0
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
pop    %rax
ret
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @floatSwap(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = call i64 (...) @littleEndian()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %28
7: ; preds = %1
%8 = bitcast float* %3 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = ashr i32 %10, 24
%12 = and i32 %11, 255
%13 = load i32, i32* %4
%14 = shl i32 %13, 8
%15 = and i32 %14, 16711680
%16 = or i32 %12, %15
%17 = load i32, i32* %4
%18 = ashr i32 %17, 8
%19 = and i32 %18, 65280
%20 = or i32 %16, %19
%21 = load i32, i32* %4
%22 = shl i32 %21, 24
%23 = and i32 %22, -16777216
%24 = or i32 %20, %23
store i32 %24, i32* %4
%25 = bitcast i32* %4 to float*
%26 = load float, float* %25
store float %26, float* %3
%27 = load float, float* %3
store float %27, float* %2
br label %30
28: ; preds = %1
%29 = load float, float* %3
store float %29, float* %2
br label %30
30: ; preds = %28, %7
%31 = load float, float* %2
ret float %31
}

LLVM IR (-O2):
define float @floatSwap(float %0) {
%2 = tail call i64 (...) @littleEndian()
%3 = icmp eq i64 %2, 0
%4 = bitcast float %0 to i32
%5 = tail call i32 @llvm.bswap.i32(i32 %4)
%6 = bitcast i32 %5 to float
%7 = select i1 %3, float %0, float %6
ret float %7
}