xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strrchr(char *, char);
char *get_progname(char *argv0) {
  char *p;
  if (argv0 == NULL)
    return "unknown";
  p = strrchr(argv0, '/');
  if (p == NULL)
    p = argv0;
  else
    p++;
  return p;
}


x86 assembly (clang, -O0):
<get_progname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <get_progname+0x27>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <get_progname+0x65>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <get_progname+0x51>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    116d <get_progname+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_progname>:
test   %rdi,%rdi
je     1133 <get_progname+0x23>
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @get_progname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strrchr(i8* %9, i8 signext 47)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %3
store i8* %14, i8** %4
br label %18
15: ; preds = %8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
br label %18
18: ; preds = %15, %13
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %7
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @get_progname(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %0, i8* %6
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %9
}
void RTLinuxSysFsOpenV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLinuxSysFsOpenV() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void ILibDeleteFileFromDisk(char *FileName) { remove(FileName); }


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

x86 assembly (clang, -O2):
<ILibDeleteFileFromDisk>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define void @ILibDeleteFileFromDisk(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ load_the_world(char *);
void genesis(void) { load_the_world("default-world.csv"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"default-world.csv\00"
define void @genesis() {
%1 = call i32 @load_the_world(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"default-world.csv\00"
define void @genesis() {
%1 = tail call i32 @load_the_world(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pca_group_heapsort_heapify(char **, unsigned long,
                                              int /*<<< orphan*/);
char *pca_group_heapsort_deroot(char **memb, unsigned long *n) {
  char *sroot;
  sroot = memb[0];
  memb[0] = memb[*n - 1];
  (*n)--;
  pca_group_heapsort_heapify(memb, *n, 0);
  return sroot;
}


x86 assembly (clang, -O0):
<pca_group_heapsort_deroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
xor    %edx,%edx
call   1030 <pca_group_heapsort_heapify@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pca_group_heapsort_deroot>:
push   %rbx
mov    (%rdi),%rbx
mov    (%rsi),%rax
mov    -0x8(%rdi,%rax,8),%rcx
add    $0xffffffffffffffff,%rax
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <pca_group_heapsort_heapify@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @pca_group_heapsort_deroot(i8** %0, i64* %1) {
%3 = alloca i8**
%4 = alloca i64*
%5 = alloca i8*
store i8** %0, i8*** %3
store i64* %1, i64** %4
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
store i8* %8, i8** %5
%9 = load i8**, i8*** %3
%10 = load i64*, i64** %4
%11 = load i64, i64* %10
%12 = sub i64 %11, 1
%13 = getelementptr inbounds i8*, i8** %9, i64 %12
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %3
%16 = getelementptr inbounds i8*, i8** %15, i64 0
store i8* %14, i8** %16
%17 = load i64*, i64** %4
%18 = load i64, i64* %17
%19 = add i64 %18, -1
store i64 %19, i64* %17
%20 = load i8**, i8*** %3
%21 = load i64*, i64** %4
%22 = load i64, i64* %21
%23 = call i32 @pca_group_heapsort_heapify(i8** %20, i64 %22, i32 0)
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @pca_group_heapsort_deroot(i8** %0, i64* nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i64, i64* %1
%5 = add i64 %4, -1
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
store i8* %7, i8** %0
store i64 %5, i64* %1
%8 = tail call i32 @pca_group_heapsort_heapify(i8** %0, i64 %5, i32 0)
ret i8* %3
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
int main() {
  printf("hello, my process id is %ld\n", (long)getpid());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"hello, my process id is %ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"hello, my process id is %ld\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ is_ko_point(int);
int autohelperowl_vital_apat45(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  (void)transformation;
  (void)patt;
  (void)color;
  (void)action;
  return !is_ko_point(move);
}


x86 assembly (clang, -O0):
<autohelperowl_vital_apat45>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <is_ko_point@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_vital_apat45(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %7
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = call i32 @is_ko_point(i32 %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_vital_apat45(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @is_ko_point(i32 %2)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
const char *get_os() { return "Win32"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Win32\00"
define i8* @get_os() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
int /*<<< orphan*/ f();
void a(int x) {
  if (!x) {
    b();
    c();
  } else {
    b();
    f();
  }
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1158 <a+0x28>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x0,%al
call   1050 <c@plt>
jmp    1166 <a+0x36>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x0,%al
call   1040 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
test   %ebx,%ebx
je     1146 <a+0x16>
pop    %rbx
jmp    1040 <f@plt>
pop    %rbx
jmp    1050 <c@plt>

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

LLVM IR (-O2):
define void @a(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = tail call i32 (...) @b()
br i1 %2, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @c()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @f()
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
struct state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_timeout(int /*<<< orphan*/, int /*<<< orphan*/, void *);
void do_resume(void *data) {
  struct state *state = data;
  do_timeout(0, 0, (void *)state);
}


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

x86 assembly (clang, -O2):
<do_resume>:
mov    %rdi,%rdx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <do_timeout@plt>

LLVM IR (-O0):
%struct.state = type { i32 }
define void @do_resume(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.state*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.state*
store %struct.state* %5, %struct.state** %3
%6 = load %struct.state*, %struct.state** %3
%7 = bitcast %struct.state* %6 to i8*
%8 = call i32 @do_timeout(i32 0, i32 0, i8* %7)
ret void
}

LLVM IR (-O2):
define void @do_resume(i8* %0) {
%2 = tail call i32 @do_timeout(i32 0, i32 0, i8* %0)
ret void
}
void gtk_curve_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_curve_new() {
ret void
}
any(chr, stg) char chr, *stg;
{
  register char c, *s;
  c = chr;
  for (s = stg; *s;)
    if (*s++ == c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <any+0x58>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1153 <any+0x53>
movl   $0x1,-0x4(%rbp)
jmp    115f <any+0x5f>
jmp    111c <any+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
movsbl %dil,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rsi),%ecx
test   %ecx,%ecx
je     1125 <any+0x25>
add    $0x1,%rsi
cmp    %ecx,%eax
jne    1110 <any+0x10>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i32 %0, i8* nocapture %1) {
%3 = shl i32 %0, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %9, %2
%6 = phi i8* [ %1, %2 ], [ %10, %9 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = sext i8 %7 to i32
%12 = icmp eq i32 %4, %11
br i1 %12, label %13, label %5
13: ; preds = %5, %9
%14 = phi i32 [ 1, %9 ], [ 0, %5 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int ehrpwm_read(int /*<<< orphan*/, int);
int ehrpwm_et_read_int_status(uint8_t module, unsigned long *status) {
  *status = ehrpwm_read(module, 0x36) & (1 << 0);
  return 0;
}


x86 assembly (clang, -O0):
<ehrpwm_et_read_int_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x36,%esi
call   1030 <ehrpwm_read@plt>
and    $0x1,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehrpwm_et_read_int_status>:
push   %rbx
mov    %rsi,%rbx
mov    $0x36,%esi
call   1030 <ehrpwm_read@plt>
and    $0x1,%eax
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ehrpwm_et_read_int_status(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = call i32 @ehrpwm_read(i32 %5, i32 54)
%7 = and i32 %6, 1
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %4
store i64 %8, i64* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @ehrpwm_et_read_int_status(i32 %0, i64* nocapture writeonly %1) {
%3 = tail call i32 @ehrpwm_read(i32 %0, i32 54)
%4 = and i32 %3, 1
%5 = zext i32 %4 to i64
store i64 %5, i64* %1
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
unsigned long timediff(struct timeval s, struct timeval e) {
  unsigned long s_us, e_us;
  s_us = s.tv_sec * 1000000 + s.tv_usec;
  e_us = e.tv_sec * 1000000 + e.tv_usec;
  if (s_us > e_us)
    return 0;
  return e_us - s_us;
}


x86 assembly (clang, -O0):
<timediff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
imul   $0xf4240,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
mov    %rax,-0x20(%rbp)
imul   $0xf4240,-0x18(%rbp),%eax
add    -0x14(%rbp),%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    1147 <timediff+0x47>
movq   $0x0,-0x8(%rbp)
jmp    1153 <timediff+0x53>
mov    -0x28(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timediff>:
movabs $0xf424000000001,%rcx
imul   %rcx,%rdi
sar    $0x20,%rdi
imul   %rsi,%rcx
sar    $0x20,%rcx
xor    %eax,%eax
sub    %rdi,%rcx
cmovae %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @timediff(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = alloca i64
%7 = alloca i64
%8 = bitcast %struct.timeval* %4 to i64*
store i64 %0, i64* %8
%9 = bitcast %struct.timeval* %5 to i64*
store i64 %1, i64* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = mul nsw i32 %11, 1000000
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%14 = load i32, i32* %13
%15 = add nsw i32 %12, %14
%16 = sext i32 %15 to i64
store i64 %16, i64* %6
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%18 = load i32, i32* %17
%19 = mul nsw i32 %18, 1000000
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%21 = load i32, i32* %20
%22 = add nsw i32 %19, %21
%23 = sext i32 %22 to i64
store i64 %23, i64* %7
%24 = load i64, i64* %6
%25 = load i64, i64* %7
%26 = icmp ugt i64 %24, %25
br i1 %26, label %27, label %28
27: ; preds = %2
store i64 0, i64* %3
br label %32
28: ; preds = %2
%29 = load i64, i64* %7
%30 = load i64, i64* %6
%31 = sub i64 %29, %30
store i64 %31, i64* %3
br label %32
32: ; preds = %28, %27
%33 = load i64, i64* %3
ret i64 %33
}

LLVM IR (-O2):
define i64 @timediff(i64 %0, i64 %1) {
%3 = mul i64 %0, 4294967296000001
%4 = ashr i64 %3, 32
%5 = mul i64 %1, 4294967296000001
%6 = ashr i64 %5, 32
%7 = tail call i64 @llvm.usub.sat.i64(i64 %6, i64 %4)
ret i64 %7
}
/* Variables and functions */
int find_ignore(char const *, char const *, char const *);
char check_ignore(const char *channel, const char *nick,
                  const char *name_complete) {
  return find_ignore(channel, nick, name_complete) != -1;
}


x86 assembly (clang, -O0):
<check_ignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <find_ignore@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ignore>:
push   %rax
call   1030 <find_ignore@plt>
cmp    $0xffffffff,%eax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @check_ignore(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 @find_ignore(i8* %7, i8* %8, i8* %9)
%11 = icmp ne i32 %10, -1
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @check_ignore(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @find_ignore(i8* %0, i8* %1, i8* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i8
ret i8 %6
}
/* Variables and functions */
float tancotf(float, int /*<<< orphan*/);
float tandgf(float x) { return (tancotf(x, 0)); }


x86 assembly (clang, -O0):
<tandgf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %edi,%edi
call   1030 <tancotf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tandgf>:
xor    %edi,%edi
jmp    1030 <tancotf@plt>

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

LLVM IR (-O2):
define float @tandgf(float %0) {
%2 = tail call float @tancotf(float %0, i32 0)
ret float %2
}
int iswordchar(int c) {
  return c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
         (c >= '0' && c <= '9');
}


x86 assembly (clang, -O0):
<iswordchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x5f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1167 <iswordchar+0x67>
cmpl   $0x61,-0x4(%rbp)
jl     112f <iswordchar+0x2f>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1167 <iswordchar+0x67>
cmpl   $0x41,-0x4(%rbp)
jl     1148 <iswordchar+0x48>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1167 <iswordchar+0x67>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1161 <iswordchar+0x61>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswordchar>:
cmp    $0x5f,%edi
sete   %al
mov    %edi,%ecx
and    $0xffffffdf,%ecx
add    $0xffffffbf,%ecx
cmp    $0x1a,%ecx
setb   %cl
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @iswordchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 95
br i1 %4, label %25, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 122
br i1 %10, label %25, label %11
11: ; preds = %8, %5
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 90
br i1 %16, label %25, label %17
17: ; preds = %14, %11
%18 = load i32, i32* %2
%19 = icmp sge i32 %18, 48
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 57
br label %23
23: ; preds = %20, %17
%24 = phi i1 [ false, %17 ], [ %22, %20 ]
br label %25
25: ; preds = %23, %14, %8, %1
%26 = phi i1 [ true, %14 ], [ true, %8 ], [ true, %1 ], [ %24, %23 ]
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @iswordchar(i32 %0) {
%2 = icmp eq i32 %0, 95
%3 = and i32 %0, -33
%4 = add i32 %3, -65
%5 = icmp ult i32 %4, 26
%6 = or i1 %2, %5
%7 = add i32 %0, -48
%8 = icmp ult i32 %7, 10
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
int prime(int n) {
  int i;
  for (i = 2; i <= n / 2; i++)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     115b <prime+0x5b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1148 <prime+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1162 <prime+0x62>
jmp    114d <prime+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     1137 <prime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <prime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <prime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ clog_init();
void CLOG_INIT(void) { clog_init(); }


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

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

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

LLVM IR (-O2):
define void @CLOG_INIT() {
%1 = tail call i32 (...) @clog_init()
ret void
}
int pl_read_var_(float *mem, int *lengths) { return 0; }


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

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

LLVM IR (-O0):
define i32 @pl_read_var_(float* %0, i32* %1) {
%3 = alloca float*
%4 = alloca i32*
store float* %0, float** %3
store i32* %1, i32** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @pl_read_var_(float* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
int exists(int *avlpop, int pop, int size) {
  int i, foundit;
  foundit = 0;
  for (i = 0; i < size && !foundit; i++) {
    if (avlpop[i] == pop)
      foundit = 1;
  }
  return foundit;
}


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x19(%rbp)
jge    1139 <exists+0x39>
cmpl   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1149 <exists+0x49>
jmp    1177 <exists+0x77>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
jne    1164 <exists+0x64>
movl   $0x1,-0x18(%rbp)
jmp    1169 <exists+0x69>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <exists+0x1c>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
test   %edx,%edx
jle    1129 <exists+0x29>
mov    %edx,%eax
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rdi,%rcx,4),%edx
cmp    %rax,%rcx
jae    1121 <exists+0x21>
add    $0x1,%rcx
cmp    %esi,%edx
jne    1110 <exists+0x10>
xor    %eax,%eax
cmp    %esi,%edx
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @exists(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %1
%12 = add nuw nsw i64 %8, 1
%13 = icmp ult i64 %12, %6
%14 = xor i1 %11, true
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %7, label %16
16: ; preds = %7
%17 = zext i1 %11 to i32
br label %18
18: ; preds = %16, %3
%19 = phi i32 [ 0, %3 ], [ %17, %16 ]
ret i32 %19
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int HASHTAB_STRKEYCMP(void *key1, void *key2) {
  return (strcmp((char *)key1, (char *)key2) == 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<HASHTAB_STRKEYCMP>:
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 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @HASHTAB_STRKEYCMP(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int asprintf(char **, char *, char *, char);
char *append(char *oldstring, char c) {
  int result;
  char *newstring;
  result = asprintf(&newstring, "%s%c", oldstring, c);
  if (result == -1)
    newstring = NULL;
  return newstring;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xecf(%rip),%rsi
movsbl -0x9(%rbp),%ecx
call   1030 <asprintf@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    114f <append+0x3f>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
cmp    $0xffffffff,%eax
je     1130 <append+0x20>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s%c\00"
define i8* @append(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %1)
%6 = icmp eq i32 %5, -1
%7 = load i8*, i8** %3
%8 = select i1 %6, i8* null, i8* %7
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void ADCComparatorIntClear(unsigned long ulBase, unsigned long ulStatus) {
  DEBUG_ASSERT((ulBase == 0x40038000) || (ulBase == 0x40039000));
  (*((volatile unsigned long *)(ulBase + 0x00000034))) = ulStatus;
}


x86 assembly (clang, -O0):
<ADCComparatorIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x40038000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     1141 <ADCComparatorIntClear+0x31>
cmpq   $0x40039000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x34(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCComparatorIntClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40038000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0x34(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ADCComparatorIntClear(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 = icmp eq i64 %5, 1073971200
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1073975296
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = add i64 %15, 52
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
ret void
}

LLVM IR (-O2):
define void @ADCComparatorIntClear(i64 %0, i64 %1) {
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073971200
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = add i64 %0, 52
%8 = inttoptr i64 %7 to i64*
store volatile i64 %1, i64* %8
ret void
}
void int2buf(unsigned char *buf, int inv) {
  buf[0] = (inv >> 0) & 0xff;
  buf[1] = (inv >> 8) & 0xff;
  buf[2] = (inv >> 16) & 0xff;
  buf[3] = (inv >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<int2buf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2buf>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @int2buf(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
char chrcaps(char c) { return ((c >= 0x61) && (c <= 0x7A)) ? (c - 0x20) : c; }


x86 assembly (clang, -O0):
<chrcaps>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <chrcaps+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <chrcaps+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <chrcaps+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrcaps>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @chrcaps(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 32
br label %17
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @chrcaps(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
void benchSVML512_SPTrig() {}


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

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

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

LLVM IR (-O2):
define void @benchSVML512_SPTrig() {
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum(int ch) { return isalpha(ch) || isdigit(ch); }


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
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):
<isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ ftell(int /*<<< orphan*/ *);
unsigned int getFileSize(char *file) {
  unsigned int len;
  FILE *f;
  f = fopen(file, "rb");
  fseek(f, 0, SEEK_END);
  len = (unsigned long)ftell(f);
  fclose(f);
  return len;
}


x86 assembly (clang, -O0):
<getFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSize>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i32 @getFileSize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %4
%11 = call i64 @ftell(i32* %10)
%12 = trunc i64 %11 to i32
store i32 %12, i32* %3
%13 = load i32*, i32** %4
%14 = call i32 @fclose(i32* %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i32 @getFileSize(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %2, i32 0, i32 %3)
%5 = tail call i64 @ftell(i32* %2)
%6 = trunc i64 %5 to i32
%7 = tail call i32 @fclose(i32* %2)
ret i32 %6
}
int Write_outbuf_to_OF(struct job *job, char *title, int of_fd, char *buffer,
                       int outlen, int of_error, char *msg, int msgmax,
                       int timeout, int poll_for_status, char *status_file) {}


x86 assembly (clang, -O0):
<Write_outbuf_to_OF>:
push   %rbp
mov    %rsp,%rbp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.job = type opaque
define i32 @Write_outbuf_to_OF(%struct.job* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, i8* %6, i32 %7, i32 %8, i32 %9, i8* %10) {
%12 = alloca i32
%13 = alloca %struct.job*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i8*
store %struct.job* %0, %struct.job** %13
store i8* %1, i8** %14
store i32 %2, i32* %15
store i8* %3, i8** %16
store i32 %4, i32* %17
store i32 %5, i32* %18
store i8* %6, i8** %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i32 %9, i32* %22
store i8* %10, i8** %23
%24 = load i32, i32* %12
ret i32 %24
}

LLVM IR (-O2):
%struct.job = type opaque
define i32 @Write_outbuf_to_OF(%struct.job* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4, i32 %5, i8* nocapture readnone %6, i32 %7, i32 %8, i32 %9, i8* nocapture readnone %10) {
ret i32 undef
}
/* Variables and functions */
int syscall(int, unsigned int, unsigned int, unsigned int);
int close_range(unsigned int fd, unsigned int max_fd, unsigned int flags) {
  return syscall(436, fd, max_fd, flags);
}


x86 assembly (clang, -O0):
<close_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1b4,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_range>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1b4,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @close_range(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @syscall(i32 436, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @close_range(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 436, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
int /*<<< orphan*/ system(char *);
void write_data(int chip_address, int register_address, int value) {
  int bus_id;
  bus_id = 1;
  char command[50];
  sprintf(command, "i2cset -y %i %i %i %i", bus_id, chip_address,
          register_address, value);
  system(command);
}


x86 assembly (clang, -O0):
<write_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xeaf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <system@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_data>:
push   %rbx
sub    $0x40,%rsp
mov    %edx,%r9d
mov    %esi,%r8d
mov    %edi,%ecx
lea    0xecc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"i2cset -y %i %i %i %i\00"
define void @write_data(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [50 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1, i32* %7
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%10 = load i32, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%16 = call i32 @system(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"i2cset -y %i %i %i %i\00"
define void @write_data(i32 %0, i32 %1, i32 %2) {
%4 = alloca [50 x i8]
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1, i32 %0, i32 %1, i32 %2)
%7 = call i32 @system(i8* %5)
ret void
}