xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; argv[i] != NULL; i++) {
    printf("argv[%d]:%s\n", i, argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1169 <main+0x59>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    (%rsi),%rdx
test   %rdx,%rdx
je     1148 <main+0x38>
mov    %rsi,%r14
xor    %ebx,%ebx
lea    0xed7(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x8(%r14,%rbx,8),%rdx
add    $0x1,%rbx
test   %rdx,%rdx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"argv[%d]:%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %22, %2
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %25
14: ; preds = %7
%15 = load i32, i32* %6
%16 = load i8**, i8*** %5
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %20)
br label %22
22: ; preds = %14
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %7
25: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"argv[%d]:%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = phi i8* [ %12, %5 ], [ %3, %2 ]
%8 = trunc i64 %6 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %7)
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int yesno(int /*<<< orphan*/);
bool is_really_quiet(void) { return yesno(getenv("EERROR_QUIET")); }


x86 assembly (clang, -O0):
<is_really_quiet>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1040 <yesno@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_really_quiet>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <yesno@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"EERROR_QUIET\00"
define i32 @is_really_quiet() {
%1 = call i32 @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @yesno(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [13 x i8] c"EERROR_QUIET\00"
define i32 @is_really_quiet() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @yesno(i32 %1)
ret i32 %2
}
float *mat2(float *result, float m11, float m12, float m21, float m22) {
  result[0] = m11;
  result[1] = m21;
  result[2] = m12;
  result[3] = m22;
  return result;
}


x86 assembly (clang, -O0):
<mat2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat2>:
mov    %rdi,%rax
movss  %xmm0,(%rdi)
movss  %xmm2,0x4(%rdi)
movss  %xmm1,0x8(%rdi)
movss  %xmm3,0xc(%rdi)
ret

LLVM IR (-O0):
define float* @mat2(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %7
%12 = load float*, float** %6
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float, float* %9
%15 = load float*, float** %6
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float, float* %8
%18 = load float*, float** %6
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float, float* %10
%21 = load float*, float** %6
%22 = getelementptr inbounds float, float* %21, i64 3
store float %20, float* %22
%23 = load float*, float** %6
ret float* %23
}

LLVM IR (-O2):
define float* @mat2(float* returned writeonly %0, float %1, float %2, float %3, float %4) {
store float %1, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
store float %3, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
store float %2, float* %7
%8 = getelementptr inbounds float, float* %0, i64 3
store float %4, float* %8
ret float* %0
}
/* Variables and functions */
scalar_t__ __builtin_lceilf(float);
int /*<<< orphan*/ link_failure_builtin_lceilf();
void test_builtin_lceilf(float f) {
  if (__builtin_lceilf(f) != __builtin_lceilf(f))
    link_failure_builtin_lceilf();
}


x86 assembly (clang, -O0):
<test_builtin_lceilf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <__builtin_lceilf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <__builtin_lceilf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_lceilf+0x3c>
mov    $0x0,%al
call   1030 <link_failure_builtin_lceilf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_lceilf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <__builtin_lceilf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <__builtin_lceilf@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_lceilf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_lceilf@plt>

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

LLVM IR (-O2):
define void @test_builtin_lceilf(float %0) {
%2 = tail call i64 @__builtin_lceilf(float %0)
%3 = tail call i64 @__builtin_lceilf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_lceilf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trace_initialize();
void trace_memory_init(void) { trace_initialize(); }


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

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

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

LLVM IR (-O2):
define void @trace_memory_init() {
%1 = tail call i32 (...) @trace_initialize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char const *, int /*<<< orphan*/);
bool exists(const char *filename) { return access(filename, F_OK) != -1; }


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ignoresig();
int /*<<< orphan*/ tty_reset();
void onintr(int sig) {
  ignoresig();
  tty_reset();
  exit(1);
}


x86 assembly (clang, -O0):
<onintr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ignoresig@plt>
mov    $0x0,%al
call   1050 <tty_reset@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<onintr>:
push   %rax
xor    %eax,%eax
call   1030 <ignoresig@plt>
xor    %eax,%eax
call   1050 <tty_reset@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @onintr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ignoresig()
%4 = call i32 (...) @tty_reset()
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @onintr(i32 %0) {
%2 = tail call i32 (...) @ignoresig()
%3 = tail call i32 (...) @tty_reset()
%4 = tail call i32 @exit(i32 1)
unreachable
}
void ft_striter(char *s, void (*f)(char *)) {
  if (!s)
    return;
  while (*s) {
    f(&(*s));
    s++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1120 <ft_striter+0x20>
jmp    114d <ft_striter+0x4d>
jmp    1125 <ft_striter+0x25>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <ft_striter+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1125 <ft_striter+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %9, %7 ], [ %0, %4 ]
tail call void %1(i8* %8)
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %4, %2
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
scalar_t__ strcasestr(char const *, char const *);
int strfind(const char *str1, const char *str2) {
  if ((strcasestr(str1, str2)) != 0) {
    if ((strcasecmp(str1, str2)) == 0)
      return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<strfind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcasestr@plt>
cmp    $0x0,%rax
je     116f <strfind+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    116a <strfind+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1176 <strfind+0x56>
jmp    116f <strfind+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strfind>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strcasestr@plt>
test   %rax,%rax
je     1144 <strfind+0x24>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     114b <strfind+0x2b>
mov    $0xffffffff,%eax
jmp    114d <strfind+0x2d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @strfind(i8* %0, i8* %1) {
%3 = tail call i64 @strcasestr(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5, %2
br label %9
9: ; preds = %5, %8
%10 = phi i32 [ -1, %8 ], [ 0, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ iswalnum(int /*<<< orphan*/);
void uninitvar_iswalnum(void) {
  wint_t i;
  (void)iswalnum(i);
}


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

x86 assembly (clang, -O2):
<uninitvar_iswalnum>:
jmp    1030 <iswalnum@plt>

LLVM IR (-O0):
define void @uninitvar_iswalnum() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @iswalnum(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_iswalnum() {
%1 = tail call i32 @iswalnum(i32 undef)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void bitops_setb(uint8_t *a, uint8_t sh, uint8_t l, uint8_t v) {
  *a &= ~(((1 << (l)) - 1) << sh);
  *a |= (v << sh);
}


x86 assembly (clang, -O0):
<bitops_setb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitops_setb>:
mov    %ecx,%eax
mov    %edx,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
mov    %esi,%ecx
shl    %cl,%edx
not    %edx
shl    %cl,%eax
and    (%rdi),%edx
or     %edx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @bitops_setb(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = shl i32 1, %9
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %6
%13 = shl i32 %11, %12
%14 = xor i32 %13, -1
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = and i32 %16, %14
store i32 %17, i32* %15
%18 = load i32, i32* %8
%19 = load i32, i32* %6
%20 = shl i32 %18, %19
%21 = load i32*, i32** %5
%22 = load i32, i32* %21
%23 = or i32 %22, %20
store i32 %23, i32* %21
ret void
}

LLVM IR (-O2):
define void @bitops_setb(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = shl i32 %6, %1
%8 = xor i32 %7, -1
%9 = load i32, i32* %0
%10 = and i32 %9, %8
%11 = shl i32 %3, %1
%12 = or i32 %10, %11
store i32 %12, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add_edc(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ add_header(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
void convert_track_xa_form_2_2332(uint8_t *sector, uint32_t adr) {
  add_header(sector, adr, 2);
  add_edc(sector + 16, 8 + 2324, sector + 2348);
}


x86 assembly (clang, -O0):
<convert_track_xa_form_2_2332>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x2,%edx
call   1040 <add_header@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rdx
add    $0x24b0,%rdx
mov    $0x91c,%esi
call   1030 <add_edc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_track_xa_form_2_2332>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edx
call   1040 <add_header@plt>
lea    0x40(%rbx),%rdi
add    $0x24b0,%rbx
mov    $0x91c,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <add_edc@plt>

LLVM IR (-O0):
define void @convert_track_xa_form_2_2332(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 @add_header(i32* %5, i32 %6, i32 2)
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 16
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 2348
%12 = call i32 @add_edc(i32* %9, i32 2332, i32* %11)
ret void
}

LLVM IR (-O2):
define void @convert_track_xa_form_2_2332(i32* %0, i32 %1) {
%3 = tail call i32 @add_header(i32* %0, i32 %1, i32 2)
%4 = getelementptr inbounds i32, i32* %0, i64 16
%5 = getelementptr inbounds i32, i32* %0, i64 2348
%6 = tail call i32 @add_edc(i32* %4, i32 2332, i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tokenizer_new() {
  printf("NOT IMPLEMENTED:"
         "pa_tokenizer_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_tokenizer_new\0A\00"
define i32 @pa_tokenizer_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_tokenizer_new\00"
define i32 @pa_tokenizer_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int pak_file_close(void *handle) {
  free(handle);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pak_file_close(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
char *s0f(char *s) { return ((s) ? (s) : "(null)"); }


x86 assembly (clang, -O0):
<s0f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <s0f+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <s0f+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <s0f+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s0f>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define i8* @s0f(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
void inthandler(sig) int sig;
{
  printf("\nControl-C pressed, quitting...\n");
  exit_program(1);
}


x86 assembly (clang, -O0):
<inthandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <exit_program@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inthandler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <exit_program@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0AControl-C pressed, quitting...\0A\00"
define void @inthandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i32, ...) bitcast (i32 (...)* @exit_program to i32 (i32, ...)*)(i32 1)
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"\0AControl-C pressed, quitting...\00"
define void @inthandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @exit_program to i32 (i32, ...)*)(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_error(const char *msg) { fputs(msg, stderr); }


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define void @print_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
bool is_ascii(char c) {
  unsigned char uc = c;
  return (uc < 0x80);
}


x86 assembly (clang, -O0):
<is_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x80,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ascii>:
not    %dil
shr    $0x7,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @is_ascii(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, 128
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_ascii(i8 signext %0) {
%2 = xor i8 %0, -1
%3 = lshr i8 %2, 7
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t inw(uint16_t port) {
  uint16_t val;
  __asm__ __volatile__("inw %%dx, %%ax" : "=a"(val) : "d"(port));
  return val;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
in     (%dx),%ax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %rdi,%rdx
in     (%dx),%ax
ret

LLVM IR (-O0):
define i8* @inw(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "inw %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inw(i8* %0) {
%2 = tail call i8* asm sideeffect "inw %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Type definitions */
struct ifaddrs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeifaddrs(struct ifaddrs *);
int getifaddrs(struct ifaddrs **);
int main(void) {
  struct ifaddrs *addrs;
  int ret;
  ret = getifaddrs(&addrs);
  freeifaddrs(addrs);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <getifaddrs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <freeifaddrs@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <getifaddrs@plt>
mov    (%rsp),%rdi
call   1040 <freeifaddrs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ifaddrs = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.ifaddrs*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @getifaddrs(%struct.ifaddrs** %2)
store i32 %4, i32* %3
%5 = load %struct.ifaddrs*, %struct.ifaddrs** %2
%6 = call i32 @freeifaddrs(%struct.ifaddrs* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.ifaddrs = type { i32 }
define i32 @main() {
%1 = alloca %struct.ifaddrs*
%2 = bitcast %struct.ifaddrs** %1 to i8*
%3 = call i32 @getifaddrs(%struct.ifaddrs** %1)
%4 = load %struct.ifaddrs*, %struct.ifaddrs** %1
%5 = call i32 @freeifaddrs(%struct.ifaddrs* %4)
ret i32 0
}
unsigned short readw(const volatile void *addr) {
  unsigned short ret;
  asm volatile("mov"
               "w"
               " %1,%0"
               : "=r"(ret)
               : "m"(*(volatile unsigned short *)addr)
               : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<readw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readw>:
mov    (%rdi),%ax
ret

LLVM IR (-O0):
define zeroext i16 @readw(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i16*
%6 = call i16 asm sideeffect "movw $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %5)
store i16 %6, i16* %3
%7 = load i16, i16* %3
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @readw(i8* %0) {
%2 = bitcast i8* %0 to i16*
%3 = tail call i16 asm sideeffect "movw $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %2)
ret i16 %3
}
int count_bytes(char byte) {
  int count;
  int bit;
  count = 0;
  bit = 0;
  while (bit <= 4) {
    if (((byte << bit++) & 0x80) == 0x80) {
      count++;
    } else {
      break;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<count_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jg     115b <count_bytes+0x5b>
movsbl -0x1(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
shl    %cl,%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    1151 <count_bytes+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <count_bytes+0x56>
jmp    115b <count_bytes+0x5b>
jmp    1118 <count_bytes+0x18>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bytes>:
xor    %eax,%eax
test   $0x80,%dil
je     113b <count_bytes+0x3b>
mov    $0x1,%eax
test   $0x40,%dil
je     113b <count_bytes+0x3b>
mov    $0x2,%eax
test   $0x20,%dil
je     113b <count_bytes+0x3b>
mov    $0x3,%eax
test   $0x10,%dil
je     113b <count_bytes+0x3b>
movzbl %dil,%eax
and    $0x8,%eax
cmp    $0x1,%eax
mov    $0x5,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @count_bytes(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %1
%6 = and i32 %2, 64
%7 = icmp eq i32 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %5
%9 = and i32 %2, 32
%10 = icmp eq i32 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8
%12 = and i32 %2, 16
%13 = icmp eq i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = and i32 %2, 8
%16 = icmp eq i32 %15, 0
%17 = select i1 %16, i32 4, i32 5
br label %18
18: ; preds = %14, %11, %8, %5, %1
%19 = phi i32 [ 0, %1 ], [ 1, %5 ], [ 2, %8 ], [ 3, %11 ], [ %17, %14 ]
ret i32 %19
}
/* Variables and functions */
char req_swa_char(char *, char const *, char const *, char const *);
char switch_off(const char *hostname, const char *session_id, const char *ain) {
  return req_swa_char("setswitchoff", hostname, session_id, ain);
}


x86 assembly (clang, -O0):
<switch_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdi
call   1030 <req_swa_char@plt>
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_off>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <req_swa_char@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"setswitchoff\00"
define signext i8 @switch_off(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call signext i8 @req_swa_char(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret i8 %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"setswitchoff\00"
define signext i8 @switch_off(i8* %0, i8* %1, i8* %2) {
%4 = tail call signext i8 @req_swa_char(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret i8 %4
}
/* Variables and functions */
int send_msg(int, char *);
int INTERNAL_SERVER_ERROR(int fd) {
  return send_msg(fd, "HTTP/1.1 500 Internal Server Error\r\n\r\n");
}


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

x86 assembly (clang, -O2):
<INTERNAL_SERVER_ERROR>:
lea    0xee9(%rip),%rsi
jmp    1030 <send_msg@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"HTTP/1.1 500 Internal Server Error\0D\0A\0D\0A\00"
define i32 @INTERNAL_SERVER_ERROR(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @send_msg(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [39 x i8] c"HTTP/1.1 500 Internal Server Error\0D\0A\0D\0A\00"
define i32 @INTERNAL_SERVER_ERROR(i32 %0) {
%2 = tail call i32 @send_msg(i32 %0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
scalar_t__ isalpha(char);
bool kw_ident_start(char c) { return isalpha(c) || c == '_'; }


x86 assembly (clang, -O0):
<kw_ident_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <kw_ident_start+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %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):
<kw_ident_start>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @kw_ident_start(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(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 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
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 @kw_ident_start(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  scanf("%d", &i);
  if (i == 0x1337) {
    printf("Winner!");
  } else {
    printf("Nope!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1337,-0x8(%rbp)
jne    115d <main+0x3d>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x49>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1337,0x4(%rsp)
lea    0xec2(%rip),%rax
lea    0xec3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Winner!\00"
@.str.2 = [6 x i8] c"Nope!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 4919
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Winner!\00"
@.str.2 = [6 x i8] c"Nope!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 4919
%6 = select i1 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int strlen(char const *);
int endswith(const char *s, const char *s2) {
  return !strcmp(s + strlen(s) - strlen(s2), s2);
}


x86 assembly (clang, -O0):
<endswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
movslq %eax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endswith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
movslq %eax,%rbx
add    %r15,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
sub    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @endswith(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** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = sext i32 %11 to i64
%13 = sub i64 0, %12
%14 = getelementptr inbounds i8, i8* %9, i64 %13
%15 = load i8*, i8** %4
%16 = call i32 @strcmp(i8* %14, i8* %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @endswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strlen(i8* %1)
%7 = sext i32 %6 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local2;
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] - 371143069UL) - (unsigned short)30093;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x16(%rbp)
movzwl -0x16(%rbp),%eax
cmp    $0x1,%rax
jae    1166 <RandomFunc+0x66>
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x1,%rax
jae    1155 <RandomFunc+0x55>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1136 <RandomFunc+0x36>
movzwl -0x16(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x16(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
sub    $0x161f319d,%rax
sub    $0x758d,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0x641b,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
%7 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%8 = load i16*, i16** %3
%9 = getelementptr inbounds i16, i16* %8, i64 0
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
%12 = add nsw i32 %11, 2885
%13 = trunc i32 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %7
br label %15
15: ; preds = %29, %2
%16 = load i16, i16* %7
%17 = zext i16 %16 to i64
%18 = icmp ult i64 %17, 1
br i1 %18, label %19, label %34
19: ; preds = %15
store i16 0, i16* %6
br label %20
20: ; preds = %24, %19
%21 = load i16, i16* %6
%22 = zext i16 %21 to i64
%23 = icmp ult i64 %22, 1
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i16, i16* %6
%26 = zext i16 %25 to i64
%27 = add i64 %26, 2
%28 = trunc i64 %27 to i16
store i16 %28, i16* %6
br label %20
29: ; preds = %20
%30 = load i16, i16* %7
%31 = zext i16 %30 to i64
%32 = add i64 %31, 2
%33 = trunc i64 %32 to i16
store i16 %33, i16* %7
br label %15
34: ; preds = %15
%35 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%36 = load i16, i16* %35
%37 = zext i16 %36 to i64
%38 = sub i64 %37, 371143069
%39 = sub i64 %38, 30093
%40 = trunc i64 %39 to i16
%41 = load i16*, i16** %4
%42 = getelementptr inbounds i16, i16* %41, i64 0
store i16 %40, i16* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 25627
store i16 %4, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
nonews() { printf("No new news.\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"No new news.\0A\00"
define i32 @nonews() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [13 x i8] c"No new news.\00"
define i32 @nonews() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void gtk_tree_view_set_destroy_count_func() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_destroy_count_func() {
ret void
}
float ocad_color_scale_rgbf(int value) {
  float v = 0.005f * value;
  if (v < 0)
    v = 0;
  if (v > 1)
    v = 1;
  return v;
}


x86 assembly (clang, -O0):
<ocad_color_scale_rgbf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm1
movss  0xeec(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <ocad_color_scale_rgbf+0x32>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xec5(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1155 <ocad_color_scale_rgbf+0x55>
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ocad_color_scale_rgbf>:
cvtsi2ss %edi,%xmm0
mulss  0xef4(%rip),%xmm0
xorps  %xmm1,%xmm1
maxss  %xmm0,%xmm1
movss  0xee9(%rip),%xmm0
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ocad_color_scale_rgbf(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
%6 = fmul float 0x3F747AE140000000, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = fcmp olt float %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %1
store float 0.000000e+00, float* %3
br label %10
10: ; preds = %9, %1
%11 = load float, float* %3
%12 = fcmp ogt float %11, 1.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %10
store float 1.000000e+00, float* %3
br label %14
14: ; preds = %13, %10
%15 = load float, float* %3
ret float %15
}

LLVM IR (-O2):
define float @ocad_color_scale_rgbf(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fmul float %2, 0x3F747AE140000000
%4 = fcmp olt float %3, 0.000000e+00
%5 = select i1 %4, float 0.000000e+00, float %3
%6 = fcmp ogt float %5, 1.000000e+00
%7 = select i1 %6, float 1.000000e+00, float %5
ret float %7
}
__attribute__((no, noclone)) unsigned __int128 t120_5mul(signed __int128 x) {
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, (signed __int128)(-1), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t120_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rdi
mov    %rdi,%rsi
sar    $0x3f,%rsi
xor    %eax,%eax
neg    %rdx
mov    %rax,%rcx
sbb    %rdi,%rcx
sbb    %rsi,%rax
and    $0x1,%al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1164 <t120_5mul+0x54>
jmp    116b <t120_5mul+0x5b>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t120_5mul>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
mov    %rdi,%rbx
neg    %rbx
sbb    %rsi,%r14
cmp    $0x1,%rdi
sbb    $0x0,%rsi
jl     1131 <t120_5mul+0x21>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t120_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.smul.with.overflow.i129(i129 %12, i129 -1)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t120_5mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = sub nsw i129 0, %7
%9 = icmp sgt i128 %6, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}