xunge/DecIR huggingface dataset:
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  do {
    c = getchar();
    if (c != EOF)
      putchar(c);
  } while (c != EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    0x2ea4(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1158 <main+0x38>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    115d <main+0x3d>
movsbl -0x5(%rbp),%eax
mov    0x2e80(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%al
je     114b <main+0x2b>
mov    %eax,%ebx
movsbl %al,%edi
call   1030 <putchar@plt>
cmp    (%r14),%bl
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8, i8* %2
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %10, %3
br label %14
14: ; preds = %13
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = load i8, i8* @EOF
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %16, %18
br i1 %19, label %3, label %20
20: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
br label %1
1: ; preds = %5, %0
%2 = tail call signext i8 (...) @getchar()
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 @putchar(i8 signext %2)
%7 = load i8, i8* @EOF
%8 = icmp eq i8 %2, %7
br i1 %8, label %9, label %1
9: ; preds = %1, %5
ret i32 0
}
int search_first_pivot(long A[3][3]) {
  int i;
  for (i = 0; i < 3; i++) {
    if (A[i][0] != 0) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<search_first_pivot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1150 <search_first_pivot+0x50>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
cmpq   $0x0,(%rax)
je     113d <search_first_pivot+0x3d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <search_first_pivot+0x57>
jmp    1142 <search_first_pivot+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <search_first_pivot+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_first_pivot>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
je     1109 <search_first_pivot+0x9>
ret
mov    $0x1,%eax
cmpq   $0x0,0x18(%rdi)
jne    1108 <search_first_pivot+0x8>
cmpq   $0x1,0x30(%rdi)
sbb    %eax,%eax
or     $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @search_first_pivot([3 x i64]* nocapture %0) {
%2 = getelementptr inbounds [3 x i64], [3 x i64]* %0, i64 0, i64 0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = getelementptr inbounds [3 x i64], [3 x i64]* %0, i64 1, i64 0
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %0, i64 2, i64 0
%11 = load i64, i64* %10
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i32 -1, i32 2
br label %14
14: ; preds = %9, %5, %1
%15 = phi i32 [ 0, %1 ], [ 1, %5 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int *a, int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%u\t", a[i]);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\09\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ is_alpha(char const);
char *skip_alpha(const char *s, int sz) {
  while (sz > 0 && is_alpha(*s)) {
    s++;
    sz--;
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1144 <skip_alpha+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_alpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1154 <skip_alpha+0x44>
jmp    116e <skip_alpha+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <skip_alpha+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_alpha>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
jle    1139 <skip_alpha+0x29>
mov    %esi,%ebp
add    $0x1,%ebp
nop
movsbl (%rbx),%edi
call   1030 <is_alpha@plt>
test   %rax,%rax
je     1139 <skip_alpha+0x29>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     1120 <skip_alpha+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @skip_alpha(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %15, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i64 @is_alpha(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %20
15: ; preds = %13
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %5
20: ; preds = %13
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @skip_alpha(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %10
%5 = phi i32 [ %12, %10 ], [ %1, %2 ]
%6 = phi i8* [ %11, %10 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i64 @is_alpha(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = add nsw i32 %5, -1
%13 = icmp sgt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si128(int /*<<< orphan*/ const *);
int /*<<< orphan*/ _mm_set1_epi32(int);
int /*<<< orphan*/ _mm_shuffle_epi8(int /*<<< orphan*/ const,
                                    int /*<<< orphan*/ const);
void pack_8x1_2t_filter(const int16_t *filter, __m128i *f) {
  const __m128i h = _mm_loadu_si128((const __m128i *)filter);
  const __m128i p = _mm_set1_epi32(0x09080706);
  f[0] = _mm_shuffle_epi8(h, p);
}


x86 assembly (clang, -O0):
<pack_8x1_2t_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <_mm_loadu_si128@plt>
mov    %eax,-0x14(%rbp)
mov    $0x9080706,%edi
call   1040 <_mm_set1_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <_mm_shuffle_epi8@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_8x1_2t_filter>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1050 <_mm_loadu_si128@plt>
mov    %eax,%ebp
mov    $0x9080706,%edi
call   1040 <_mm_set1_epi32@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_shuffle_epi8@plt>
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @pack_8x1_2t_filter(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = call i32 @_mm_loadu_si128(i32* %7)
store i32 %8, i32* %5
%9 = call i32 @_mm_set1_epi32(i32 151521030)
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @_mm_shuffle_epi8(i32 %10, i32 %11)
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @pack_8x1_2t_filter(i32* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @_mm_loadu_si128(i32* %0)
%4 = tail call i32 @_mm_set1_epi32(i32 151521030)
%5 = tail call i32 @_mm_shuffle_epi8(i32 %3, i32 %4)
store i32 %5, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;
typedef int /*<<< orphan*/ xcb_atom_t;

/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ XCB_GET_PROPERTY_TYPE_ANY;
int /*<<< orphan*/
xcb_get_property_unchecked(int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
xcb_get_property_cookie_t
xcb_icccm_get_text_property_unchecked(xcb_connection_t *c, xcb_window_t window,
                                      xcb_atom_t property) {
  return xcb_get_property_unchecked(c, 0, window, property,
                                    XCB_GET_PROPERTY_TYPE_ANY, 0, UINT_MAX);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_text_property_unchecked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x2eb5(%rip),%rax
mov    (%rax),%r8d
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %eax,(%rsp)
call   1030 <xcb_get_property_unchecked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_text_property_unchecked>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2ecc(%rip),%rax
mov    (%rax),%r8d
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property_unchecked@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_GET_PROPERTY_TYPE_ANY = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_text_property_unchecked(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 = load i32, i32* @XCB_GET_PROPERTY_TYPE_ANY
%11 = load i32, i32* @UINT_MAX
%12 = call i32 @xcb_get_property_unchecked(i32* %7, i32 0, i32 %8, i32 %9, i32 %10, i32 0, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@XCB_GET_PROPERTY_TYPE_ANY = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_text_property_unchecked(i32* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @XCB_GET_PROPERTY_TYPE_ANY
%5 = load i32, i32* @UINT_MAX
%6 = tail call i32 @xcb_get_property_unchecked(i32* %0, i32 0, i32 %1, i32 %2, i32 %4, i32 0, i32 %5)
ret i32 %6
}
int tl1parsefile(const char *filename) {}


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

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

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

LLVM IR (-O2):
define i32 @tl1parsefile(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_get_wstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_get_wstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_get_wstr+0x2a>
jmp    1170 <cmd_get_wstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_get_wstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_get_wstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_get_wstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
void wait(int t) {
  int i = 0;
  int j = 0;
  int z = 0;
  for (i = 0; i < t; i++) {
    for (j = 0; j < t; j++) {
      z = i / 33;
    }
  }
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1171 <wait+0x71>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115e <wait+0x5e>
mov    -0x8(%rbp),%eax
mov    $0x21,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <wait+0x36>
jmp    1163 <wait+0x63>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <wait+0x23>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @wait(i32 %0) {
ret void
}
const int func1() { return 15; }


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

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

LLVM IR (-O0):
define i32 @func1() {
ret i32 15
}

LLVM IR (-O2):
define i32 @func1() {
ret i32 15
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool h265hvcc_array_get_completeness(const uint8_t *p) { return p[0] & 0x80; }


x86 assembly (clang, -O0):
<h265hvcc_array_get_completeness>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_array_get_completeness>:
mov    $0x80,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @h265hvcc_array_get_completeness(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 128
ret i32 %6
}

LLVM IR (-O2):
define i32 @h265hvcc_array_get_completeness(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 128
ret i32 %3
}
void free_string_array(char **arr) {
  if (!arr)
    return;
  for (char **current = arr; *current; current++) {
    free(*current);
  }
  free(arr);
}


x86 assembly (clang, -O0):
<free_string_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_string_array+0x1c>
jmp    1168 <free_string_array+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115f <free_string_array+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <free_string_array+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_string_array>:
test   %rdi,%rdi
je     1150 <free_string_array+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_string_array+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_string_array+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_string_array(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 %7, label %6
6: ; preds = %1
br label %22
7: ; preds = %1
%8 = load i8**, i8*** %2
store i8** %8, i8*** %3
br label %9
9: ; preds = %16, %7
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
br label %16
16: ; preds = %13
%17 = load i8**, i8*** %3
%18 = getelementptr inbounds i8*, i8** %17, i32 1
store i8** %18, i8*** %3
br label %9
19: ; preds = %9
%20 = load i8**, i8*** %2
%21 = bitcast i8** %20 to i8*
br label %22
22: ; preds = %19, %6
ret void
}

LLVM IR (-O2):
define void @free_string_array(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %8, %3
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
br label %14
8: ; preds = %3, %8
%9 = phi i8* [ %12, %8 ], [ %4, %3 ]
%10 = phi i8** [ %11, %8 ], [ %0, %3 ]
tail call void @free(i8* %9)
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %6, label %8
14: ; preds = %1, %6
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int fsfr_base_listxattr(char const *, char *, size_t);
int fsfr_filter_xattr(char *, int);
ssize_t listxattr(const char *path, char *list, size_t size) {
  int rtn = fsfr_base_listxattr(path, list, size);
  if (rtn > 0)
    return fsfr_filter_xattr(list, rtn);
  return rtn;
}


x86 assembly (clang, -O0):
<listxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <fsfr_base_listxattr@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    1166 <listxattr+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <fsfr_filter_xattr@plt>
mov    %eax,-0x4(%rbp)
jmp    116c <listxattr+0x4c>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listxattr>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fsfr_base_listxattr@plt>
test   %eax,%eax
jle    1138 <listxattr+0x18>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <fsfr_filter_xattr@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @listxattr(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @fsfr_base_listxattr(i8* %9, i8* %10, i64 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = load i32, i32* %8
%18 = call i32 @fsfr_filter_xattr(i8* %16, i32 %17)
store i32 %18, i32* %4
br label %21
19: ; preds = %3
%20 = load i32, i32* %8
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %15
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @listxattr(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @fsfr_base_listxattr(i8* %0, i8* %1, i64 %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @fsfr_filter_xattr(i8* %1, i32 %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %4, %3 ]
ret i32 %9
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ vec_len(struct vector const *);
int vec_isempty(const struct vector *v) {
  assert(v != NULL);
  return (vec_len(v) == 0);
}


x86 assembly (clang, -O0):
<vec_isempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <vec_len@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_isempty>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <vec_len@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vector = type { i32 }
define i32 @vec_isempty(%struct.vector* %0) {
%2 = alloca %struct.vector*
store %struct.vector* %0, %struct.vector** %2
%3 = load %struct.vector*, %struct.vector** %2
%4 = icmp ne %struct.vector* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.vector*, %struct.vector** %2
%8 = call i64 @vec_len(%struct.vector* %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define i32 @vec_isempty(%struct.vector* %0) {
%2 = icmp ne %struct.vector* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @vec_len(%struct.vector* %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int *);
void Delay(int sec) {
  time_t start, current;
  time(&start);
  do {
    time(&current);
  } while (current - start < sec);
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <time@plt>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1124 <Delay+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%rdi
call   1030 <time@plt>
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <time@plt>
mov    (%rsp),%eax
sub    0x4(%rsp),%eax
cmp    %ebx,%eax
jl     1130 <Delay+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @Delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @time(i32* %2)
br label %7
7: ; preds = %7, %1
%8 = call i32 @time(i32* %3)
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = sub nsw i32 %9, %10
%12 = icmp slt i32 %11, %0
br i1 %12, label %7, label %13
13: ; preds = %7
ret void
}
void f6(enum {A} * a) {}


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

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

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

LLVM IR (-O2):
define void @f6(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int linux_most_recent_in_path(char *, char *);
int wsys_most_recent_in_path(char *exename, char *wildcard) {
  return (linux_most_recent_in_path(exename, wildcard));
}


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

x86 assembly (clang, -O2):
<wsys_most_recent_in_path>:
jmp    1030 <linux_most_recent_in_path@plt>

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

LLVM IR (-O2):
define i32 @wsys_most_recent_in_path(i8* %0, i8* %1) {
%3 = tail call i32 @linux_most_recent_in_path(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ abort();
int config_get_abort();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printlog(char *, int);
void qexit(int status) {
  const int do_abort = config_get_abort();
  if ((EXIT_SUCCESS != status) && (do_abort)) {
    printlog("error handler called with status %d and abort config set true. "
             "Aborting..",
             status);
    abort();
  }
  exit(status);
}


x86 assembly (clang, -O0):
<qexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <config_get_abort@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
je     1187 <qexit+0x47>
cmpl   $0x0,-0x8(%rbp)
je     1187 <qexit+0x47>
mov    -0x4(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1060 <printlog@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<qexit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <config_get_abort@plt>
mov    0x2e8f(%rip),%rcx
cmp    %ebx,(%rcx)
je     116e <qexit+0x2e>
test   %eax,%eax
je     116e <qexit+0x2e>
lea    0xea0(%rip),%rdi
mov    %ebx,%esi
call   1060 <printlog@plt>
xor    %eax,%eax
call   1030 <abort@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@.str = [74 x i8] c"error handler called with status %d and abort config set true. Aborting..\00"
define void @qexit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @config_get_abort()
store i32 %4, i32* %3
%5 = load i32, i32* @EXIT_SUCCESS
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %2
%13 = call i32 @printlog(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %8, %1
%16 = load i32, i32* %2
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@.str = [74 x i8] c"error handler called with status %d and abort config set true. Aborting..\00"
define void @qexit(i32 %0) {
%2 = tail call i32 (...) @config_get_abort()
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp ne i32 %3, %0
%5 = icmp ne i32 %2, 0
%6 = select i1 %4, i1 %5, i1 false
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @printlog(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %0)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = tail call i32 @exit(i32 %0)
unreachable
}
void s5pv310_default_sdhci0(void) {}


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

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

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

LLVM IR (-O2):
define void @s5pv310_default_sdhci0() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *umem_alloc(size_t size, int flags) {
  void *ptr;
  do {
    ptr = malloc(size);
  } while (ptr == NULL && (flags & 0x0100));
  return ptr;
}


x86 assembly (clang, -O0):
<umem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jne    114d <umem_alloc+0x3d>
mov    -0xc(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    111f <umem_alloc+0xf>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umem_alloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <malloc@plt>
test   $0x100,%ebp
je     1135 <umem_alloc+0x25>
test   %rax,%rax
je     1120 <umem_alloc+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @umem_alloc(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8*
store i64 %0, i64* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %3
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
br label %9
9: ; preds = %6
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %4
%14 = and i32 %13, 256
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %12, %9
%17 = phi i1 [ false, %9 ], [ %15, %12 ]
br i1 %17, label %6, label %18
18: ; preds = %16
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @umem_alloc(i64 %0, i32 %1) {
%3 = and i32 %1, 256
%4 = icmp ne i32 %3, 0
br label %5
5: ; preds = %5, %2
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
%8 = and i1 %4, %7
br i1 %8, label %5, label %9
9: ; preds = %5
ret i8* %6
}
unsigned int from_733(unsigned char *s) {
  unsigned int ret = 0;
  ret |= s[0];
  ret |= s[1] << 8;
  ret |= s[2] << 16;
  ret |= s[3] << 24;
  return ret;
}


x86 assembly (clang, -O0):
<from_733>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @from_733(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ read_irc(char *, int);
int /*<<< orphan*/ *strstr(char *, char const *);
void read_irc_till(char buffer[], int sockfd, const char *keyword) {
  do {
    read_irc(buffer, sockfd);
  } while (strstr(buffer, keyword) == NULL);
}


x86 assembly (clang, -O0):
<read_irc_till>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <read_irc@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1133 <read_irc_till+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_irc_till>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <read_irc@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1130 <read_irc_till+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @read_irc_till(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
br label %7
7: ; preds = %11, %3
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @read_irc(i8* %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i8*, i8** %6
%14 = call i32* @strstr(i8* %12, i8* %13)
%15 = icmp eq i32* %14, null
br i1 %15, label %7, label %16
16: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @read_irc_till(i8* %0, i32 %1, i8* nocapture %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @read_irc(i8* %0, i32 %1)
%6 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %2)
%7 = icmp eq i32* %6, null
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x51() {
  Assert_real((isascii(81)),
              "/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_isascii.c",
              410, ("isascii should be 1 for Q"));
}


x86 assembly (clang, -O0):
<t_isascii_0x51>:
push   %rbp
mov    %rsp,%rbp
mov    $0x51,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x19a,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x51>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x19a,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for Q\00"
define void @t_isascii_0x51() {
%1 = call i32 @isascii(i32 81)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 410, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for Q\00"
define void @t_isascii_0x51() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 410, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void log_kevent_timer_off(void) {
  report(LOG_ERR, "Unable to delete timer for watchtab: %s", strerror(errno));
}


x86 assembly (clang, -O0):
<log_kevent_timer_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xeb2(%rip),%rsi
call   1030 <report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_kevent_timer_off>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec1(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [40 x i8] c"Unable to delete timer for watchtab: %s\00"
@errno = global i32 0
define void @log_kevent_timer_off() {
%1 = load i32, i32* @LOG_ERR
%2 = load i32, i32* @errno
%3 = call i32 @strerror(i32 %2)
%4 = call i32 @report(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [40 x i8] c"Unable to delete timer for watchtab: %s\00"
@errno = global i32 0
define void @log_kevent_timer_off() {
%1 = load i32, i32* @LOG_ERR
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @report(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
__attribute__((no, noclone)) void fn2(int k) {
  if (k != 1)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     112a <fn2+0x1a>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
cmp    $0x1,%edi
jne    1116 <fn2+0x6>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fn2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
unreachable
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @fn2(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t udp_get_dstport(const uint8_t *p_udp) {
  return (p_udp[2] << 8) | p_udp[3];
}


x86 assembly (clang, -O0):
<udp_get_dstport>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_get_dstport>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @udp_get_dstport(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @udp_get_dstport(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ errorout(char *);
int /*<<< orphan*/ exit(int);
__attribute__((noreturn)) void OutOfMemory(void) {
  errorout("Fatal: Out of memory");
  exit(!0);
}


x86 assembly (clang, -O0):
<OutOfMemory>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <errorout@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<OutOfMemory>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <errorout@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Fatal: Out of memory\00"
define void @OutOfMemory() {
%1 = call i32 @errorout(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"Fatal: Out of memory\00"
define void @OutOfMemory() {
%1 = tail call i32 @errorout(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char *encode16(unsigned char *buffer, unsigned int data) {
  buffer[1] = data & 0xff;
  buffer[0] = (data >> 8) & 0xff;
  return buffer;
}


x86 assembly (clang, -O0):
<encode16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode16>:
mov    %rdi,%rax
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define i8* @encode16(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 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @encode16(i8* returned writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %4
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ duplicate_input();
int /*<<< orphan*/ read_file(int, char **);
int main(int argc, char **argv) {
  if (argc < 2)
    duplicate_input();
  else
    read_file(argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114c <main+0x2c>
mov    $0x0,%al
call   1030 <duplicate_input@plt>
jmp    1158 <main+0x38>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <read_file@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     112f <main+0xf>
xor    %eax,%eax
call   1030 <duplicate_input@plt>
jmp    1134 <main+0x14>
call   1040 <read_file@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @duplicate_input()
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @read_file(i32 %11, i8** %12)
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @duplicate_input()
br label %8
6: ; preds = %2
%7 = tail call i32 @read_file(i32 %0, i8** %1)
br label %8
8: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void xmlError(int err) { printf("    <err>%d</err>\n", err); }


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

x86 assembly (clang, -O2):
<xmlError>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c" <err>%d</err>\0A\00"
define void @xmlError(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c" <err>%d</err>\0A\00"
define void @xmlError(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}