xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ seq_engine_live_stop_all_notes(int);
void seq_engine_stop_live_notes(void) {
  int track;
  for (track = 0; track < 6; track++) {
    seq_engine_live_stop_all_notes(track);
  }
}


x86 assembly (clang, -O0):
<seq_engine_stop_live_notes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
jge    113f <seq_engine_stop_live_notes+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <seq_engine_live_stop_all_notes@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <seq_engine_stop_live_notes+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_engine_stop_live_notes>:
push   %rax
xor    %edi,%edi
call   1030 <seq_engine_live_stop_all_notes@plt>
mov    $0x1,%edi
call   1030 <seq_engine_live_stop_all_notes@plt>
mov    $0x2,%edi
call   1030 <seq_engine_live_stop_all_notes@plt>
mov    $0x3,%edi
call   1030 <seq_engine_live_stop_all_notes@plt>
mov    $0x4,%edi
call   1030 <seq_engine_live_stop_all_notes@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <seq_engine_live_stop_all_notes@plt>

LLVM IR (-O0):
define void @seq_engine_stop_live_notes() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 6
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @seq_engine_live_stop_all_notes(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @seq_engine_stop_live_notes() {
%1 = tail call i32 @seq_engine_live_stop_all_notes(i32 0)
%2 = tail call i32 @seq_engine_live_stop_all_notes(i32 1)
%3 = tail call i32 @seq_engine_live_stop_all_notes(i32 2)
%4 = tail call i32 @seq_engine_live_stop_all_notes(i32 3)
%5 = tail call i32 @seq_engine_live_stop_all_notes(i32 4)
%6 = tail call i32 @seq_engine_live_stop_all_notes(i32 5)
ret void
}
int innerlib(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @innerlib() {
ret i32 0
}
/* Type definitions */
typedef double clock_t;

/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
double clock();
double aclock_current_time() {
  clock_t ct = clock();
  double ct_secs = (double)(ct / (double)CLOCKS_PER_SEC);
  return ct_secs;
}


x86 assembly (clang, -O0):
<aclock_current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2eb8(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aclock_current_time>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define double @aclock_current_time() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @clock()
store double %3, double* %1
%4 = load double, double* %1
%5 = load i64, i64* @CLOCKS_PER_SEC
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
store double %7, double* %2
%8 = load double, double* %2
ret double %8
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define double @aclock_current_time() {
%1 = tail call double (...) @clock()
%2 = load i64, i64* @CLOCKS_PER_SEC
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRC6_set(void) { return U_WMRCORENONE_set("U_WMRC6"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRC6\00"
define i8* @U_WMRC6_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC6\00"
define i8* @U_WMRC6_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
char *time_frame_to_mmssff(long);
void cue_print_index(long i, FILE *fp) {
  fprintf(fp, "%s\n", time_frame_to_mmssff(i));
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @cue_print_index(i64 %0, i32* nocapture %1) {
%3 = tail call i8* @time_frame_to_mmssff(i64 %0)
%4 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int isNum(char c) {
  return (c == '0' || c == '1' || c == '2' || c == '3' || c == '4' ||
          c == '5' || c == '6' || c == '7' || c == '8' || c == '9');
}


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
je     11b9 <isNum+0xb9>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x31,%ecx
mov    %al,-0x2(%rbp)
je     11b9 <isNum+0xb9>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x32,%ecx
mov    %al,-0x2(%rbp)
je     11b9 <isNum+0xb9>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x33,%ecx
mov    %al,-0x2(%rbp)
je     11b9 <isNum+0xb9>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x34,%ecx
mov    %al,-0x2(%rbp)
je     11b9 <isNum+0xb9>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x35,%ecx
mov    %al,-0x2(%rbp)
je     11b9 <isNum+0xb9>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x36,%ecx
mov    %al,-0x2(%rbp)
je     11b9 <isNum+0xb9>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x37,%ecx
mov    %al,-0x2(%rbp)
je     11b9 <isNum+0xb9>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x38,%ecx
mov    %al,-0x2(%rbp)
je     11b9 <isNum+0xb9>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 48
br i1 %5, label %42, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 49
br i1 %9, label %42, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 50
br i1 %13, label %42, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 51
br i1 %17, label %42, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 52
br i1 %21, label %42, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 53
br i1 %25, label %42, label %26
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 54
br i1 %29, label %42, label %30
30: ; preds = %26
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 55
br i1 %33, label %42, label %34
34: ; preds = %30
%35 = load i8, i8* %2
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 56
br i1 %37, label %42, label %38
38: ; preds = %34
%39 = load i8, i8* %2
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 57
br label %42
42: ; preds = %38, %34, %30, %26, %22, %18, %14, %10, %6, %1
%43 = phi i1 [ true, %34 ], [ true, %30 ], [ true, %26 ], [ true, %22 ], [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %41, %38 ]
%44 = zext i1 %43 to i32
ret i32 %44
}

LLVM IR (-O2):
define i32 @isNum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int CgosStrLen(const char *s) {
  const char *ss = s;
  if (!s)
    return 0;
  while (*s++)
    ;
  return s - ss - 1;
}


x86 assembly (clang, -O0):
<CgosStrLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1127 <CgosStrLen+0x27>
movl   $0x0,-0x4(%rbp)
jmp    115b <CgosStrLen+0x5b>
jmp    112c <CgosStrLen+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     1149 <CgosStrLen+0x49>
jmp    112c <CgosStrLen+0x2c>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CgosStrLen>:
test   %rdi,%rdi
je     111d <CgosStrLen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <CgosStrLen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @CgosStrLen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 0, i32* %2
br label %24
9: ; preds = %1
br label %10
10: ; preds = %15, %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
%13 = load i8, i8* %11
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
br label %10
16: ; preds = %10
%17 = load i8*, i8** %3
%18 = load i8*, i8** %4
%19 = ptrtoint i8* %17 to i64
%20 = ptrtoint i8* %18 to i64
%21 = sub i64 %19, %20
%22 = sub nsw i64 %21, 1
%23 = trunc i64 %22 to i32
store i32 %23, i32* %2
br label %24
24: ; preds = %16, %8
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @CgosStrLen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %5, %3 ], [ %0, %1 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %5 to i64
%10 = ptrtoint i8* %0 to i64
%11 = xor i64 %10, -1
%12 = add i64 %9, %11
%13 = trunc i64 %12 to i32
br label %14
14: ; preds = %1, %8
%15 = phi i32 [ %13, %8 ], [ 0, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *);
void printbottombettingbox(void) {
  move(17, 42);
  printw("|x = toggle information box        |");
  move(17 + 1, 42);
  printw("|i = list playing instructions     |");
  move(17 + 2, 42);
  printw("*----------------------------------*");
}


x86 assembly (clang, -O0):
<printbottombettingbox>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec6(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xed0(%rip),%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xeda(%rip),%rdi
call   1030 <printw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printbottombettingbox>:
push   %rax
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec9(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xed3(%rip),%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"|x = toggle information box |\00"
@.str.1 = [37 x i8] c"|i = list playing instructions |\00"
@.str.2 = [37 x i8] c"*----------------------------------*\00"
define void @printbottombettingbox() {
%1 = call i32 @move(i32 17, i32 42)
%2 = call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @move(i32 18, i32 42)
%4 = call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @move(i32 19, i32 42)
%6 = call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"|x = toggle information box |\00"
@.str.1 = [37 x i8] c"|i = list playing instructions |\00"
@.str.2 = [37 x i8] c"*----------------------------------*\00"
define void @printbottombettingbox() {
%1 = tail call i32 @move(i32 17, i32 42)
%2 = tail call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @move(i32 18, i32 42)
%4 = tail call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @move(i32 19, i32 42)
%6 = tail call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int isakmp_validate_situation(u_int8_t *buf, size_t *sz, size_t len) {
  *sz = 0;
  return 0;
}


x86 assembly (clang, -O0):
<isakmp_validate_situation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isakmp_validate_situation>:
movq   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isakmp_validate_situation(i32* nocapture readnone %0, i64* nocapture writeonly %1, i64 %2) {
store i64 0, i64* %1
ret i32 0
}
void ConvertToI420() {}


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

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

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

LLVM IR (-O2):
define void @ConvertToI420() {
ret void
}
/* Variables and functions */
void floatmin(float *in, size_t size, float *min) {
  float tmin = 1e30, *fpt;
  fpt = in + size;
  do
    if (*in < tmin)
      tmin = *in;
  while (++in < fpt);
  *min = tmin;
}


x86 assembly (clang, -O0):
<floatmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  0xee8(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1153 <floatmin+0x53>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1158 <floatmin+0x58>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
cmp    -0x28(%rbp),%rax
jb     1130 <floatmin+0x30>
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatmin>:
lea    (%rdi,%rsi,4),%rax
movss  0xef4(%rip),%xmm0
nopl   0x0(%rax)
movaps %xmm0,%xmm1
movss  (%rdi),%xmm0
minss  %xmm1,%xmm0
add    $0x4,%rdi
cmp    %rax,%rdi
jb     1110 <floatmin+0x10>
movss  %xmm0,(%rdx)
ret

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

LLVM IR (-O2):
define void @floatmin(float* %0, i64 %1, float* nocapture writeonly %2) {
%4 = getelementptr inbounds float, float* %0, i64 %1
br label %5
5: ; preds = %5, %3
%6 = phi float [ 0x46293E5940000000, %3 ], [ %10, %5 ]
%7 = phi float* [ %0, %3 ], [ %11, %5 ]
%8 = load float, float* %7
%9 = fcmp olt float %8, %6
%10 = select i1 %9, float %8, float %6
%11 = getelementptr inbounds float, float* %7, i64 1
%12 = icmp ult float* %11, %4
br i1 %12, label %5, label %13
13: ; preds = %5
store float %10, float* %2
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ count;
};
struct TYPE_4__ {
  TYPE_1__ xexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xexpose_count(void *_p) {
  return (int)((XEvent *)_p)->xexpose.count;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xexpose_count>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xexpose_count(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xexpose_count(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigalrm() { exit(-1); }


x86 assembly (clang, -O0):
<sigalrm>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigalrm>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigalrm() {
%1 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @sigalrm() {
%1 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
char *add_nl(char const *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
void say(const char *s) {
  char *new = add_nl(s);
  printf(new);
  free(new);
}


x86 assembly (clang, -O0):
<say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <add_nl@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say>:
push   %rbx
call   1050 <add_nl@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @say(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @add_nl(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @say(i8* %0) {
%2 = tail call i8* @add_nl(i8* %0)
%3 = tail call i32 @printf(i8* dereferenceable(1) %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mmcau_sha256_hash_n(unsigned int *, int, unsigned int *);
int /*<<< orphan*/ mmcau_sha256_initialize_output(unsigned int *);
void mmcau_sha256_update(unsigned int input[], int num_blks,
                         unsigned int output[]) {
  mmcau_sha256_initialize_output(output);
  mmcau_sha256_hash_n(input, num_blks, output);
}


x86 assembly (clang, -O0):
<mmcau_sha256_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <mmcau_sha256_initialize_output@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <mmcau_sha256_hash_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmcau_sha256_update>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <mmcau_sha256_initialize_output@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mmcau_sha256_hash_n@plt>

LLVM IR (-O0):
define void @mmcau_sha256_update(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = call i32 @mmcau_sha256_initialize_output(i32* %7)
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = load i32*, i32** %6
%12 = call i32 @mmcau_sha256_hash_n(i32* %9, i32 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @mmcau_sha256_update(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 @mmcau_sha256_initialize_output(i32* %2)
%5 = tail call i32 @mmcau_sha256_hash_n(i32* %0, i32 %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test0();
void test1(void **ptr) {
  if (ptr)
    test0();
  *ptr = NULL;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112e <test1+0x1e>
mov    $0x0,%al
call   1030 <test0@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1120 <test1+0x10>
xor    %eax,%eax
call   1030 <test0@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @test1(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @test0()
br label %7
7: ; preds = %5, %1
%8 = load i8**, i8*** %2
store i8* null, i8** %8
ret void
}

LLVM IR (-O2):
define void @test1(i8** writeonly %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @test0()
br label %5
5: ; preds = %3, %1
store i8* null, i8** %0
ret void
}
int test_imm_03int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x03 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_03int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 3
%7 = icmp ne i64 %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_03int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12884901888
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_func_00(int a) { return __builtin_bswap32(a); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bswap  %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @test_func_00(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.bswap.i32(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_func_00(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("Hello %s!", argv[1]);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int _write_sysfs_int(char *, char *, int, int /*<<< orphan*/, int, int);
int write_sysfs_int2(char *filename, char *basedir, int val, int val2) {
  return _write_sysfs_int(filename, basedir, val, 0, 1, val2);
}


x86 assembly (clang, -O0):
<write_sysfs_int2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%r9d
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <_write_sysfs_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sysfs_int2>:
mov    %ecx,%r9d
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <_write_sysfs_int@plt>

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

LLVM IR (-O2):
define i32 @write_sysfs_int2(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @_write_sysfs_int(i8* %0, i8* %1, i32 %2, i32 0, i32 1, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void neubot_xfree(void *ptr) {
  if (ptr != NULL)
    free(ptr);
}


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

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

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

LLVM IR (-O2):
define void @neubot_xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <gcd+0x34>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
test   %esi,%esi
je     111b <gcd+0x1b>
mov    %esi,%edx
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @gcd(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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @gcd(i32 %11, i32 %14)
br label %16
16: ; preds = %8, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gcd(i32 returned %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 %0
}
/* Variables and functions */
void putc(int c) {
  volatile int t;
  ((volatile unsigned char *)0x400003f8)[0] = c;
  t = 0x10000;
  while (t--)
    ;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x400003f8,%eax
mov    %cl,(%rax)
movl   $0x10000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1133 <putc+0x33>
jmp    111a <putc+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
mov    %dil,0x400003f8
40
movl   $0x10000,-0x4(%rsp)
subl   $0x1,-0x4(%rsp)
jae    1110 <putc+0x10>
ret

LLVM IR (-O0):
define void @putc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store volatile i8 %5, i8* inttoptr (i64 1073742840 to i8*)
store volatile i32 65536, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load volatile i32, i32* %3
%8 = add nsw i32 %7, -1
store volatile i32 %8, i32* %3
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @putc(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = trunc i32 %0 to i8
store volatile i8 %4, i8* inttoptr (i64 1073742840 to i8*)
store volatile i32 65536, i32* %2
br label %5
5: ; preds = %5, %1
%6 = load volatile i32, i32* %2
%7 = add nsw i32 %6, -1
store volatile i32 %7, i32* %2
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %5
9: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_command(int);
void test_le_read_white_list_size(const void *test_data) {
  test_command(0x200f);
}


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

x86 assembly (clang, -O2):
<test_le_read_white_list_size>:
mov    $0x200f,%edi
jmp    1030 <test_command@plt>

LLVM IR (-O0):
define void @test_le_read_white_list_size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @test_command(i32 8207)
ret void
}

LLVM IR (-O2):
define void @test_le_read_white_list_size(i8* nocapture readnone %0) {
%2 = tail call i32 @test_command(i32 8207)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_stacktrace();
int /*<<< orphan*/ stderr;
void sighandle_sigill(int signo) {
  fprintf(stderr, "Illegal instruction in child:\n");
  print_stacktrace();
}


x86 assembly (clang, -O0):
<sighandle_sigill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <print_stacktrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandle_sigill>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <print_stacktrace@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Illegal instruction in child:\0A\00"
define void @sighandle_sigill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @print_stacktrace()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Illegal instruction in child:\0A\00"
define void @sighandle_sigill(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @print_stacktrace()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main(void) {
  int len = 11;
  char str[4] = {0};
  gets(str);
  printf("\n len = [%d] \n", len);
  printf("\n len of string entered is : [%d]\n", strlen(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
lea    -0xc(%rbp),%rdi
call   1060 <gets@plt>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xeaf(%rip),%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0A len = [%d] \0A\00"
@.str.1 = [35 x i8] c"\0A len of string entered is : [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 0, i32* %1
store i32 11, i32* %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0A len = [%d] \0A\00"
@.str.1 = [35 x i8] c"\0A len of string entered is : [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 11)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int gcd(int a, int b) {
  int c;
  b = ((b) >= 0 ? (b) : -(b));
  if (b > a)
    c = a, a = b, b = c;
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111f <gcd+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <gcd+0x27>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    114b <gcd+0x4b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <gcd+0x50>
cmpl   $0x0,-0x8(%rbp)
je     1175 <gcd+0x75>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <gcd+0x50>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
neg    %edx
cmovs  %esi,%edx
cmp    %edi,%edx
mov    %edi,%eax
cmovg  %edx,%eax
cmovg  %edi,%edx
test   %edx,%edx
je     112d <gcd+0x2d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1120 <gcd+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
br label %13
13: ; preds = %10, %8
%14 = phi i32 [ %9, %8 ], [ %12, %10 ]
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i32, i32* %3
store i32 %19, i32* %5
%20 = load i32, i32* %4
store i32 %20, i32* %3
%21 = load i32, i32* %5
store i32 %21, i32* %4
br label %22
22: ; preds = %18, %13
br label %23
23: ; preds = %26, %22
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = srem i32 %27, %28
store i32 %29, i32* %5
%30 = load i32, i32* %4
store i32 %30, i32* %3
%31 = load i32, i32* %5
store i32 %31, i32* %4
br label %23
32: ; preds = %23
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%4 = icmp sgt i32 %3, %0
%5 = select i1 %4, i32 %3, i32 %0
%6 = select i1 %4, i32 %0, i32 %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ %6, %2 ]
%10 = phi i32 [ %9, %8 ], [ %5, %2 ]
%11 = srem i32 %10, %9
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %2
%14 = phi i32 [ %5, %2 ], [ %9, %8 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ isgraph(int);
int FwdLockConv_IsMimeHeaderValueChar(int ch) {
  return isgraph(ch) && ch != ';';
}


x86 assembly (clang, -O0):
<FwdLockConv_IsMimeHeaderValueChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isgraph@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     113f <FwdLockConv_IsMimeHeaderValueChar+0x2f>
cmpl   $0x3b,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FwdLockConv_IsMimeHeaderValueChar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isgraph@plt>
test   %rax,%rax
setne  %al
cmp    $0x3b,%ebx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @FwdLockConv_IsMimeHeaderValueChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isgraph(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 59
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @FwdLockConv_IsMimeHeaderValueChar(i32 %0) {
%2 = tail call i64 @isgraph(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp ne i32 %0, 59
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int STC31xx_WriteByte8(int, int);
int STC31xx_AlarmClear(void) {
  int res;
  res = STC31xx_WriteByte8(0x01, 0x01);
  if (res != 0)
    return (res);
  return (res);
}


x86 assembly (clang, -O0):
<STC31xx_AlarmClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <STC31xx_WriteByte8@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113c <STC31xx_AlarmClear+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <STC31xx_AlarmClear+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC31xx_AlarmClear>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <STC31xx_WriteByte8@plt>

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

LLVM IR (-O2):
define i32 @STC31xx_AlarmClear() {
%1 = tail call i32 @STC31xx_WriteByte8(i32 1, i32 1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void cealtesthook_input_print(FILE *file) {}


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

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

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

LLVM IR (-O2):
define void @cealtesthook_input_print(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int fputs(int /*<<< orphan*/, char *);
int puts(char *str) { return fputs(0, str); }


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

x86 assembly (clang, -O2):
<puts>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @fputs(i32 0, i8* %0)
ret i32 %2
}
int int_equal(void *vlocation1, void *vlocation2) {
  int *location1;
  int *location2;
  location1 = (int *)vlocation1;
  location2 = (int *)vlocation2;
  return *location1 == *location2;
}


x86 assembly (clang, -O0):
<int_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_equal>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @int_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @int_equal(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int foo() {
foo:;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EMACTimestampPPSSimpleModeSet(uint32_t ui32Base, uint32_t ui32FreqConfig) {
  bool bDigital;
  ;
  bDigital = ((*((volatile uint32_t *)(ui32Base + 0x00000700))) & 0x00000200)
                 ? true
                 : false;
  ;
  ;
  if ((ui32FreqConfig != 0x00000000) && !bDigital) {
    ui32FreqConfig--;
  }
  (*((volatile uint32_t *)(ui32Base + 0x0000072C))) = ui32FreqConfig;
}


x86 assembly (clang, -O0):
<EMACTimestampPPSSimpleModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x700,%eax
cltq
mov    (%rax),%edx
and    $0x200,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1149 <EMACTimestampPPSSimpleModeSet+0x49>
cmpl   $0x0,-0xc(%rbp)
jne    1149 <EMACTimestampPPSSimpleModeSet+0x49>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x72c,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTimestampPPSSimpleModeSet>:
movslq %edi,%rax
testl  $0x200,0x700(%rax)
sete   %cl
test   %esi,%esi
setne  %dl
and    %cl,%dl
movzbl %dl,%ecx
sub    %ecx,%esi
mov    %esi,0x72c(%rax)
ret

LLVM IR (-O0):
define void @EMACTimestampPPSSimpleModeSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1792
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 512
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
store i32 %14, i32* %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = icmp ne i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %4
%22 = add nsw i32 %21, -1
store i32 %22, i32* %4
br label %23
23: ; preds = %20, %17, %2
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1836
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i32*
store volatile i32 %24, i32* %28
ret void
}

LLVM IR (-O2):
define void @EMACTimestampPPSSimpleModeSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1792
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 512
%8 = icmp eq i32 %7, 0
%9 = icmp ne i32 %1, 0
%10 = select i1 %9, i1 %8, i1 false
%11 = sext i1 %10 to i32
%12 = add nsw i32 %11, %1
%13 = add nsw i32 %0, 1836
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %12, i32* %15
ret void
}