xunge/DecIR huggingface dataset:
int a(int n) {
  char x[1];
  if (n != 0)
    return 2;
  else
    return x;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <a+0x1d>
movl   $0x2,-0x4(%rbp)
jmp    1124 <a+0x24>
lea    -0x9(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
test   %edi,%edi
lea    -0x1(%rsp),%rcx
mov    $0x2,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @a(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1 x i8]
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 2, i32* %2
br label %11
8: ; preds = %1
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
%10 = ptrtoint i8* %9 to i32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
%5 = ptrtoint [1 x i8]* %2 to i64
%6 = trunc i64 %5 to i32
%7 = select i1 %4, i32 %6, i32 2
ret i32 %7
}
/* Variables and functions */
char *strrchr(const char *s, int c) {
  char *res = NULL;
  while (*s) {
    if (*s == c)
      res = (char *)s;
    ++s;
  }
  return res;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <strrchr+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1138 <strrchr+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <strrchr+0x25>
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ null, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = select i1 %10, i8* %8, i8* %7
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ null, %2 ], [ %11, %5 ]
ret i8* %16
}
double ran1() {
  double drand48();
  return (drand48());
}


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

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

LLVM IR (-O0):
define double @ran1() {
%1 = call double (...) @drand48()
ret double %1
}

LLVM IR (-O2):
define double @ran1() {
%1 = tail call double (...) @drand48()
ret double %1
}
void incr(int *f, int *fb, int *rc, int j) {
  int i, jj;
  do {
    i = rc[j];
    fb[j] = i;
    jj = f[i];
    f[i] = j;
    j = jj;
  } while (j >= 0);
}


x86 assembly (clang, -O0):
<incr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1113 <incr+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<incr>:
movslq %ecx,%r8
movslq (%rdx,%r8,4),%rax
mov    %eax,(%rsi,%r8,4)
mov    (%rdi,%rax,4),%ecx
mov    %r8d,(%rdi,%rax,4)
test   %ecx,%ecx
jns    1100 <incr>
ret

LLVM IR (-O0):
define void @incr(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
br label %11
11: ; preds = %33, %4
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
store i32 %16, i32* %9
%17 = load i32, i32* %9
%18 = load i32*, i32** %6
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32*, i32** %5
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
store i32 %26, i32* %10
%27 = load i32, i32* %8
%28 = load i32*, i32** %5
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
store i32 %27, i32* %31
%32 = load i32, i32* %10
store i32 %32, i32* %8
br label %33
33: ; preds = %11
%34 = load i32, i32* %8
%35 = icmp sge i32 %34, 0
br i1 %35, label %11, label %36
36: ; preds = %33
ret void
}

LLVM IR (-O2):
define void @incr(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture %2, i32 %3) {
br label %5
5: ; preds = %5, %4
%6 = phi i32 [ %3, %4 ], [ %13, %5 ]
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %2, i64 %7
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %1, i64 %7
store i32 %9, i32* %10
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
store i32 %6, i32* %12
%14 = icmp sgt i32 %13, -1
br i1 %14, label %5, label %15
15: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glXWaitX(int /*<<< orphan*/ *);
void glXWaitX() {
  { mock_push(pack_glXWaitX(NULL)); };
}


x86 assembly (clang, -O0):
<glXWaitX>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pack_glXWaitX@plt>
mov    %eax,%edi
call   1030 <mock_push@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glXWaitX() {
%1 = call i32 @pack_glXWaitX(i32* null)
%2 = call i32 @mock_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @glXWaitX() {
%1 = tail call i32 @pack_glXWaitX(i32* null)
%2 = tail call i32 @mock_push(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("USAGE : G6 -f (config_pathfilename) [ -t (forward_thread_size) ] [ "
         "-s (forward_session_size) ] [ --log-level "
         "(DEBUG|INFO|WARN|ERROR|FATAL) ] [ --log-filename (logfilename) ] [ "
         "--close-log ] [ --no-daemon ] [ --set-cpu-affinity ]\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [230 x i8] c"USAGE : G6 -f (config_pathfilename) [ -t (forward_thread_size) ] [ -s (forward_session_size) ] [ --log-level (DEBUG|INFO|WARN|ERROR|FATAL) ] [ --log-filename (logfilename) ] [ --close-log ] [ --no-daemon ] [ --set-cpu-affinity ]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [229 x i8] c"USAGE : G6 -f (config_pathfilename) [ -t (forward_thread_size) ] [ -s (forward_session_size) ] [ --log-level (DEBUG|INFO|WARN|ERROR|FATAL) ] [ --log-filename (logfilename) ] [ --close-log ] [ --no-daemon ] [ --set-cpu-affinity ]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([229 x i8], [229 x i8]* @str, i64 0, i64 0))
ret void
}
int main() {
  int a = 1;
  int b = 2;
  int c = (a + 1) ? (b - 2) ? b-- : b++ : 42;
  int d = 0 ? 1 : 2;
  return c + a + b + d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
je     1163 <main+0x63>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
cmp    $0x0,%eax
je     114a <main+0x4a>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x18(%rbp)
jmp    1158 <main+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1170 <main+0x70>
mov    $0x2a,%eax
mov    %eax,-0x1c(%rbp)
jmp    1170 <main+0x70>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
int foo1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @foo1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @foo1() {
ret i32 1
}
/* Variables and functions */
void epr_make_os_compatible_path(char *path) {
  if (path != NULL) {
    char *pc = path;
    while (*pc != '\0') {
      if (*pc == '\\')
        *pc = '/';
      pc++;
    }
  }
}


x86 assembly (clang, -O0):
<epr_make_os_compatible_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <epr_make_os_compatible_path+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <epr_make_os_compatible_path+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1142 <epr_make_os_compatible_path+0x42>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111b <epr_make_os_compatible_path+0x1b>
jmp    1158 <epr_make_os_compatible_path+0x58>
pop    %rbp
ret

x86 assembly (clang, -O2):
<epr_make_os_compatible_path>:
test   %rdi,%rdi
jne    1117 <epr_make_os_compatible_path+0x17>
jmp    1122 <epr_make_os_compatible_path+0x22>
nopw   0x0(%rax,%rax,1)
movb   $0x2f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x5c,%al
je     1110 <epr_make_os_compatible_path+0x10>
test   %al,%al
jne    1113 <epr_make_os_compatible_path+0x13>
ret

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

LLVM IR (-O2):
define void @epr_make_os_compatible_path(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 92, label %6
]
6: ; preds = %3
store i8 47, i8* %4
br label %7
7: ; preds = %3, %6
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3, %1
ret void
}
void umocktypes_free_short(short *value) { (void)value; }


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

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

LLVM IR (-O0):
define void @umocktypes_free_short(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
ret void
}

LLVM IR (-O2):
define void @umocktypes_free_short(i16* nocapture %0) {
ret void
}
/* Variables and functions */
int second_level_function(int);
int first_level_function(int i) { return second_level_function(i); }


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

x86 assembly (clang, -O2):
<first_level_function>:
jmp    1030 <second_level_function@plt>

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

LLVM IR (-O2):
define i32 @first_level_function(i32 %0) {
%2 = tail call i32 @second_level_function(i32 %0)
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void strncat_symbolic_dst_length(char *dst) {
  strncat(dst, "1234", 5);
  if (strlen(dst) < 4)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncat_symbolic_dst_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncat@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jge    1153 <strncat_symbolic_dst_length+0x33>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_symbolic_dst_length>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncat@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"1234\00"
define void @strncat_symbolic_dst_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8, i8* null
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"1234\00"
define void @strncat_symbolic_dst_length(i8* %0) {
%2 = tail call i32 @strncat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i32 @strlen(i8* %0)
ret void
}
unsigned xrop3_98_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T | D;
  stk2 = S & stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_98_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_98_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
shl    $0x8,%esi
lea    0xff(%rsi),%eax
and    %ecx,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_98_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %5
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_98_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, 255
%8 = and i32 %7, %4
%9 = xor i32 %8, 255
ret i32 %9
}
int XVendorRelease() {}


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

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

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

LLVM IR (-O2):
define i32 @XVendorRelease() {
ret i32 undef
}
char encode_quartet(char c) {
  if (c < 10)
    return c + '0';
  return c - 10 + 'a';
}


x86 assembly (clang, -O0):
<encode_quartet>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1126 <encode_quartet+0x26>
movsbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1133 <encode_quartet+0x33>
movsbl -0x2(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_quartet>:
cmp    $0xa,%dil
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

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

LLVM IR (-O2):
define signext i8 @encode_quartet(i8 signext %0) {
%2 = icmp slt i8 %0, 10
%3 = select i1 %2, i8 48, i8 87
%4 = add i8 %3, %0
ret i8 %4
}
/* Type definitions */
struct state {
  int dummy;
};
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ linnea_core_connection_recv(struct state *,
                                               struct connection *);
void linnea_cb_connection_init(struct state *state,
                               struct connection *connection) {
  linnea_core_connection_recv(state, connection);
}


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

x86 assembly (clang, -O2):
<linnea_cb_connection_init>:
jmp    1030 <linnea_core_connection_recv@plt>

LLVM IR (-O0):
%struct.state = type { i32 }
%struct.connection = type { i32 }
define void @linnea_cb_connection_init(%struct.state* %0, %struct.connection* %1) {
%3 = alloca %struct.state*
%4 = alloca %struct.connection*
store %struct.state* %0, %struct.state** %3
store %struct.connection* %1, %struct.connection** %4
%5 = load %struct.state*, %struct.state** %3
%6 = load %struct.connection*, %struct.connection** %4
%7 = call i32 @linnea_core_connection_recv(%struct.state* %5, %struct.connection* %6)
ret void
}

LLVM IR (-O2):
%struct.state = type { i32 }
%struct.connection = type { i32 }
define void @linnea_cb_connection_init(%struct.state* %0, %struct.connection* %1) {
%3 = tail call i32 @linnea_core_connection_recv(%struct.state* %0, %struct.connection* %1)
ret void
}
/* Variables and functions */
int _flasherase(int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_flasherase(int snum) {
  int ret;
  monLock();
  ret = _flasherase(snum);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_flasherase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x4(%rbp),%edi
call   1050 <_flasherase@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_flasherase>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %ebx,%edi
call   1050 <_flasherase@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mon_flasherase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @monLock()
%5 = load i32, i32* %2
%6 = call i32 @_flasherase(i32 %5)
store i32 %6, i32* %3
%7 = call i32 (...) @monUnlock()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @mon_flasherase(i32 %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call i32 @_flasherase(i32 %0)
%4 = tail call i32 (...) @monUnlock()
ret i32 %3
}
/* Type definitions */
struct utmp {
  int ut_pid;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int main(void) {
  struct utmp ut = {0};
  return ut.ut_pid;
}


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

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

LLVM IR (-O0):
%struct.utmp = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.utmp
store i32 0, i32* %1
%3 = bitcast %struct.utmp* %2 to i8*
%4 = getelementptr inbounds %struct.utmp, %struct.utmp* %2, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ not_implemented_error();
char *getenv(char *name) {
  not_implemented_error();
  return 0;
}


x86 assembly (clang, -O0):
<getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <not_implemented_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @getenv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @not_implemented_error()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @getenv(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @not_implemented_error()
ret i8* null
}
/* Variables and functions */
int jzrtc_readl(int);
void wait_write_ready() {
  int timeout = 0x100000;
  while (!(jzrtc_readl((0x00)) & (1 << (7))) && timeout--)
    ;
  if (timeout <= 0)
    do {
    } while (0);
}


x86 assembly (clang, -O0):
<wait_write_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x100000,-0x4(%rbp)
xor    %edi,%edi
call   1030 <jzrtc_readl@plt>
mov    %eax,%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1150 <wait_write_ready+0x40>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1160 <wait_write_ready+0x50>
jmp    1165 <wait_write_ready+0x55>
jmp    111f <wait_write_ready+0xf>
cmpl   $0x0,-0x4(%rbp)
jg     117e <wait_write_ready+0x6e>
jmp    1174 <wait_write_ready+0x64>
jmp    1179 <wait_write_ready+0x69>
jmp    117e <wait_write_ready+0x6e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_write_ready>:
push   %rbx
mov    $0xfff00000,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <jzrtc_readl@plt>
test   $0x80,%al
jne    1134 <wait_write_ready+0x24>
lea    0x1(%rbx),%eax
test   %ebx,%ebx
mov    %eax,%ebx
jne    1120 <wait_write_ready+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @wait_write_ready() {
%1 = alloca i32
store i32 1048576, i32* %1
br label %2
2: ; preds = %12, %0
%3 = call i32 @jzrtc_readl(i32 0)
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, -1
store i32 %8, i32* %1
%9 = icmp ne i32 %7, 0
br label %10
10: ; preds = %6, %2
%11 = phi i1 [ false, %2 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %2
13: ; preds = %10
%14 = load i32, i32* %1
%15 = icmp sle i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
br label %17
17: ; preds = %16
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18, %13
ret void
}

LLVM IR (-O2):
define void @wait_write_ready() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1048576, %0 ], [ %6, %1 ]
%3 = tail call i32 @jzrtc_readl(i32 0)
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
%6 = add nsw i32 %2, -1
%7 = icmp eq i32 %2, 0
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
int test_imm_1Dint32_mem(int *val) {
  return ((*val) & (0x1D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Dint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 29
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double tick(void) {
  struct timeval t;
  gettimeofday(&t, 0);
  return t.tv_sec + 1E-6 * t.tv_usec;
}


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

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

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @tick() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %7, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @tick() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Variables and functions */
float tanf(float);
float __ocl_native_tan_float(float src) { return tanf(src); }


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

x86 assembly (clang, -O2):
<__ocl_native_tan_float>:
jmp    1030 <tanf@plt>

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

LLVM IR (-O2):
define float @__ocl_native_tan_float(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
/* Variables and functions */
int print_header(char *);
int header_opal_event_log(void) {
  return print_header("ID       Date       Time     SRC        Creator         "
                      "  Event Severity      ");
}


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

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

LLVM IR (-O0):
@.str = [79 x i8] c"ID Date Time SRC Creator Event Severity \00"
define i32 @header_opal_event_log() {
%1 = call i32 @print_header(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [79 x i8] c"ID Date Time SRC Creator Event Severity \00"
define i32 @header_opal_event_log() {
%1 = tail call i32 @print_header(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int count(int *mas, int n) {
  int i = 0, count = 0;
  while (i < n) {
    if (mas[i] != 0)
      count += 1;
    else
      break;
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <count+0x58>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1145 <count+0x45>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <count+0x4a>
jmp    1158 <count+0x58>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <count+0x19>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
test   %esi,%esi
jle    1122 <count+0x22>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,(%rdi,%rax,4)
je     1121 <count+0x21>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <count+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ], [ %1, %11 ]
ret i32 %17
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_getpid(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_getpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_getpid>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_getpid(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ deviceIf_getFrameBuffer(void **, int *, unsigned int *);
void get_fbuf(void **start, unsigned int *used) {
  int length;
  deviceIf_getFrameBuffer(start, &length, used);
}


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

x86 assembly (clang, -O2):
<get_fbuf>:
push   %rax
mov    %rsi,%rdx
lea    0x4(%rsp),%rsi
call   1030 <deviceIf_getFrameBuffer@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @get_fbuf(i8** %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @deviceIf_getFrameBuffer(i8** %0, i32* %3, i32* %1)
ret void
}
/* Variables and functions */
void *allocator_6137D196(size_t, size_t);
void *memalign(size_t alignment, size_t size) {
  return allocator_6137D196(alignment, size);
}


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

x86 assembly (clang, -O2):
<memalign>:
jmp    1030 <allocator_6137D196@plt>

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

LLVM IR (-O2):
define i8* @memalign(i64 %0, i64 %1) {
%3 = tail call i8* @allocator_6137D196(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
scalar_t__ _is_first_name(char);
scalar_t__ is_digit(char);
int _is_next_name(char c) { return _is_first_name(c) || is_digit(c); }


x86 assembly (clang, -O0):
<_is_next_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <_is_first_name@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <_is_next_name+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <is_digit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_next_name>:
push   %rbx
mov    %edi,%ebx
call   1030 <_is_first_name@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <_is_next_name+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <is_digit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_is_next_name(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @_is_first_name(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_digit(i8 signext %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 @_is_next_name(i8 signext %0) {
%2 = tail call i64 @_is_first_name(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_digit(i8 signext %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
}
/* Variables and functions */
int /*<<< orphan*/ bad_access(int *, int);
void call_bad_access() {
  int buf[100];
  bad_access(buf, 100);
}


x86 assembly (clang, -O0):
<call_bad_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
lea    -0x190(%rbp),%rdi
mov    $0x64,%esi
call   1030 <bad_access@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_bad_access>:
sub    $0x198,%rsp
mov    %rsp,%rdi
mov    $0x64,%esi
call   1030 <bad_access@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
define void @call_bad_access() {
%1 = alloca [100 x i32]
%2 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%3 = call i32 @bad_access(i32* %2, i32 100)
ret void
}

LLVM IR (-O2):
define void @call_bad_access() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%4 = call i32 @bad_access(i32* %3, i32 100)
ret void
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int, int);
int shim_ioprio_get(int which, int who) { return shim_enosys(0, which, who); }


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

x86 assembly (clang, -O2):
<shim_ioprio_get>:
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

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

/* Variables and functions */
int wget(char *url, FILE *output) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @wget(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xf4() {
  Assert_real((isprint(244) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1225, ("isprint should be 0 for 0xf4"));
}


x86 assembly (clang, -O0):
<t_isprint_0xf4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf4,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4c9,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xf4>:
push   %rax
mov    $0xf4,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4c9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xf4\00"
define void @t_isprint_0xf4() {
%1 = call i64 @isprint(i32 244)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1225, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xf4\00"
define void @t_isprint_0xf4() {
%1 = tail call i64 @isprint(i32 244)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1225, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void __attribute__((destructor)) fini(void) { putchar('3'); }


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
mov    $0x33,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = call i32 @putchar(i8 signext 51)
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = tail call i32 @putchar(i8 signext 51)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _f_free_tosys(void *data, size_t len) {
  (void)len;
  free(data);
}


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

x86 assembly (clang, -O2):
<_f_free_tosys>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_f_free_tosys(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int test_decode_int();
int test_encode_int();
int test_hpack_encode_huff_str();
int test_hpack_encode_raw_str();
int main() {
  return test_decode_int() + test_encode_int() + test_hpack_encode_raw_str() +
         test_hpack_encode_huff_str();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_decode_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_encode_int@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <test_hpack_encode_raw_str@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <test_hpack_encode_huff_str@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <test_decode_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <test_encode_int@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1050 <test_hpack_encode_raw_str@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1060 <test_hpack_encode_huff_str@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_decode_int()
%3 = call i32 (...) @test_encode_int()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @test_hpack_encode_raw_str()
%6 = add nsw i32 %4, %5
%7 = call i32 (...) @test_hpack_encode_huff_str()
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_decode_int()
%2 = tail call i32 (...) @test_encode_int()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @test_hpack_encode_raw_str()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @test_hpack_encode_huff_str()
%7 = add nsw i32 %5, %6
ret i32 %7
}
int compare(const void *x, const void *y) { return *(int *)x < *(int *)y; }


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

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

LLVM IR (-O0):
define i32 @compare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp slt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void optimized_1_marker(void) {}


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

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

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

LLVM IR (-O2):
define void @optimized_1_marker() {
ret void
}