xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __coverity_free__(void *);
int /*<<< orphan*/ __coverity_mark_as_afm_freed__(void *, char *);
void *av_free(void *ptr) {
  __coverity_free__(ptr);
  __coverity_mark_as_afm_freed__(ptr, "av_free");
}


x86 assembly (clang, -O0):
<av_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__coverity_free__@plt>
mov    -0x10(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1030 <__coverity_mark_as_afm_freed__@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <__coverity_free__@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__coverity_mark_as_afm_freed__@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"av_free\00"
define i8* @av_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @__coverity_free__(i8* %4)
%6 = load i8*, i8** %3
%7 = call i32 @__coverity_mark_as_afm_freed__(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"av_free\00"
define noalias i8* @av_free(i8* %0) {
%2 = tail call i32 @__coverity_free__(i8* %0)
%3 = tail call i32 @__coverity_mark_as_afm_freed__(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* undef
}
int getopt_long_r(argc, argv, options, long_options, opt_index, opt)
int argc;
char *const *argv;
const char *options;
const struct option *long_options;
int *opt_index;
struct opt_r *opt;
{
  return _getopt_r_internal(argc, argv, options, long_options, opt_index, 0,
                            opt);
}


x86 assembly (clang, -O0):
<getopt_long_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%rax
xor    %r9d,%r9d
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <_getopt_r_internal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long_r>:
push   %rax
mov    %r9,(%rsp)
xor    %r9d,%r9d
xor    %eax,%eax
call   1030 <_getopt_r_internal@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.option = type opaque
%struct.opt_r = type opaque
define i32 @getopt_long_r(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, %struct.opt_r* %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8*
%10 = alloca %struct.option*
%11 = alloca i32*
%12 = alloca %struct.opt_r*
store i32 %0, i32* %7
store i8** %1, i8*** %8
store i8* %2, i8** %9
store %struct.option* %3, %struct.option** %10
store i32* %4, i32** %11
store %struct.opt_r* %5, %struct.opt_r** %12
%13 = load i32, i32* %7
%14 = load i8**, i8*** %8
%15 = load i8*, i8** %9
%16 = load %struct.option*, %struct.option** %10
%17 = load i32*, i32** %11
%18 = load %struct.opt_r*, %struct.opt_r** %12
%19 = call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, %struct.opt_r*, ...) bitcast (i32 (...)* @_getopt_r_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, %struct.opt_r*, ...)*)(i32 %13, i8** %14, i8* %15, %struct.option* %16, i32* %17, i32 0, %struct.opt_r* %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.option = type opaque
%struct.opt_r = type opaque
define i32 @getopt_long_r(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, %struct.opt_r* %5) {
%7 = tail call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, %struct.opt_r*, ...) bitcast (i32 (...)* @_getopt_r_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, %struct.opt_r*, ...)*)(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0, %struct.opt_r* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ decrRefCount(void *);
void sdsDictValDestructor(void *privdata, void *val) {
  ((void)privdata);
  decrRefCount(val);
}


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

x86 assembly (clang, -O2):
<sdsDictValDestructor>:
mov    %rsi,%rdi
jmp    1030 <decrRefCount@plt>

LLVM IR (-O0):
define void @sdsDictValDestructor(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 @decrRefCount(i8* %6)
ret void
}

LLVM IR (-O2):
define void @sdsDictValDestructor(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @decrRefCount(i8* %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int is_set_structure_supporting(int *inout) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(118, inout, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<is_set_structure_supporting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x76,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_set_structure_supporting>:
mov    %rdi,%rsi
mov    $0x76,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @is_set_structure_supporting(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 118, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_set_structure_supporting(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 118, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int foo() { printf("never reach this line"); }


x86 assembly (clang, -O0):
<foo>:
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):
<foo>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"never reach this line\00"
define i32 @foo() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [22 x i8] c"never reach this line\00"
define i32 @foo() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void entity_Blit(void) {}


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

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

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

LLVM IR (-O2):
define void @entity_Blit() {
ret void
}
const char *onoff(int bool) { return (bool ? "on" : "off"); }


x86 assembly (clang, -O0):
<onoff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef2(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onoff>:
test   %edi,%edi
lea    0xefa(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define i8* @onoff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define i8* @onoff(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fb_move_cursor(unsigned short);
void fb_move_cursor_rc(unsigned short row, unsigned short col) {
  unsigned short position = (row * (80)) + col;
  fb_move_cursor(position);
}


x86 assembly (clang, -O0):
<fb_move_cursor_rc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
imul   $0x50,%eax,%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%edi
call   1030 <fb_move_cursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_move_cursor_rc>:
lea    (%rdi,%rdi,4),%eax
shl    $0x4,%eax
add    %esi,%eax
movzwl %ax,%edi
jmp    1030 <fb_move_cursor@plt>

LLVM IR (-O0):
define void @fb_move_cursor_rc(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = mul nsw i32 %7, 80
%9 = load i16, i16* %4
%10 = zext i16 %9 to i32
%11 = add nsw i32 %8, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %5
%13 = load i16, i16* %5
%14 = call i32 @fb_move_cursor(i16 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @fb_move_cursor_rc(i16 zeroext %0, i16 zeroext %1) {
%3 = mul i16 %0, 80
%4 = add i16 %3, %1
%5 = tail call i32 @fb_move_cursor(i16 zeroext %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glGetLightiv(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
void GetLightiv(GLenum light, GLenum pname, GLint *params) {
  glGetLightiv(light, pname, params);
}


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

x86 assembly (clang, -O2):
<GetLightiv>:
jmp    1030 <glGetLightiv@plt>

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

LLVM IR (-O2):
define void @GetLightiv(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @glGetLightiv(i32 %0, i32 %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_space(int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<print_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <print_space+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_space+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_space>:
push   %rbx
test   %edi,%edi
jle    112f <print_space+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_space+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_space(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ load_list();
int /*<<< orphan*/ save_list();
int /*<<< orphan*/ send_next_notification();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sort_list();
int /*<<< orphan*/ stdout;
void notification_service(int sleep_seconds) {
  while (1) {
    load_list();
    sort_list();
    send_next_notification();
    fflush(stdout);
    save_list();
    sleep(sleep_seconds);
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<notification_service>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <load_list@plt>
mov    $0x0,%al
call   1070 <sort_list@plt>
mov    $0x0,%al
call   1060 <send_next_notification@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <save_list@plt>
mov    -0x4(%rbp),%edi
call   1080 <sleep@plt>
jmp    116b <notification_service+0xb>

x86 assembly (clang, -O2):
<notification_service>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2e73(%rip),%r14
nopl   (%rax)
xor    %eax,%eax
call   1030 <load_list@plt>
xor    %eax,%eax
call   1070 <sort_list@plt>
xor    %eax,%eax
call   1060 <send_next_notification@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <save_list@plt>
mov    %ebx,%edi
call   1080 <sleep@plt>
jmp    1170 <notification_service+0x10>

LLVM IR (-O0):
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @notification_service(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @load_list()
%5 = call i32 (...) @sort_list()
%6 = call i32 (...) @send_next_notification()
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = call i32 (...) @save_list()
%10 = load i32, i32* %2
%11 = call i32 @sleep(i32 %10)
br label %3
}

LLVM IR (-O2):
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @notification_service(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @load_list()
%4 = tail call i32 (...) @sort_list()
%5 = tail call i32 (...) @send_next_notification()
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 (...) @save_list()
%9 = tail call i32 @sleep(i32 %0)
br label %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265hvcc_array_set_nal_unit_type(uint8_t *p, uint8_t val) {
  p[0] &= ~0x3f;
  p[0] |= val;
}


x86 assembly (clang, -O0):
<h265hvcc_array_set_nal_unit_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xffffffc0,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_array_set_nal_unit_type>:
mov    (%rdi),%eax
and    $0xffffffc0,%eax
or     %esi,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @h265hvcc_array_set_nal_unit_type(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = and i32 %7, -64
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = or i32 %12, %9
store i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @h265hvcc_array_set_nal_unit_type(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, -64
%5 = or i32 %4, %1
store i32 %5, i32* %0
ret void
}
void process(int x, int y, int (*fun)()) {
  int result;
  result = (*fun)(x, y);
  printf("%d\n", result);
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   *%rcx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rax
xor    %eax,%eax
call   *%rdx
lea    0xee4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @process(i32 %0, i32 %1, i32 (...)* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32 (...)*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 (...)* %2, i32 (...)** %6
%8 = load i32 (...)*, i32 (...)** %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = bitcast i32 (...)* %8 to i32 (i32, i32, ...)*
%12 = call i32 (i32, i32, ...) %11(i32 %9, i32 %10)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @process(i32 %0, i32 %1, i32 (...)* nocapture %2) {
%4 = bitcast i32 (...)* %2 to i32 (i32, i32, ...)*
%5 = tail call i32 (i32, i32, ...) %4(i32 %0, i32 %1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
void fb_ConsoleViewUpdate(void) {}


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

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

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

LLVM IR (-O2):
define void @fb_ConsoleViewUpdate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enable_hight_vectors();
int /*<<< orphan*/ fs_init();
int /*<<< orphan*/ gic_init();
int /*<<< orphan*/ mmu_enable();
int /*<<< orphan*/ mmu_init();
int /*<<< orphan*/ page_init();
int /*<<< orphan*/ pipe_init();
int /*<<< orphan*/ process_init();
int /*<<< orphan*/ timer_enable();
int /*<<< orphan*/ tty_init();
void system_init(void) {
  enable_hight_vectors();
  gic_init();
  page_init();
  fs_init();
  tty_init();
  mmu_init();
  mmu_enable();
  timer_enable();
  pipe_init();
  process_init();
}


x86 assembly (clang, -O0):
<system_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10a0 <enable_hight_vectors@plt>
mov    $0x0,%al
call   1050 <gic_init@plt>
mov    $0x0,%al
call   1070 <page_init@plt>
mov    $0x0,%al
call   1090 <fs_init@plt>
mov    $0x0,%al
call   1060 <tty_init@plt>
mov    $0x0,%al
call   10c0 <mmu_init@plt>
mov    $0x0,%al
call   1080 <mmu_enable@plt>
mov    $0x0,%al
call   10b0 <timer_enable@plt>
mov    $0x0,%al
call   1030 <pipe_init@plt>
mov    $0x0,%al
call   1040 <process_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_init>:
push   %rax
xor    %eax,%eax
call   10a0 <enable_hight_vectors@plt>
xor    %eax,%eax
call   1050 <gic_init@plt>
xor    %eax,%eax
call   1070 <page_init@plt>
xor    %eax,%eax
call   1090 <fs_init@plt>
xor    %eax,%eax
call   1060 <tty_init@plt>
xor    %eax,%eax
call   10c0 <mmu_init@plt>
xor    %eax,%eax
call   1080 <mmu_enable@plt>
xor    %eax,%eax
call   10b0 <timer_enable@plt>
xor    %eax,%eax
call   1030 <pipe_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <process_init@plt>

LLVM IR (-O0):
define void @system_init() {
%1 = call i32 (...) @enable_hight_vectors()
%2 = call i32 (...) @gic_init()
%3 = call i32 (...) @page_init()
%4 = call i32 (...) @fs_init()
%5 = call i32 (...) @tty_init()
%6 = call i32 (...) @mmu_init()
%7 = call i32 (...) @mmu_enable()
%8 = call i32 (...) @timer_enable()
%9 = call i32 (...) @pipe_init()
%10 = call i32 (...) @process_init()
ret void
}

LLVM IR (-O2):
define void @system_init() {
%1 = tail call i32 (...) @enable_hight_vectors()
%2 = tail call i32 (...) @gic_init()
%3 = tail call i32 (...) @page_init()
%4 = tail call i32 (...) @fs_init()
%5 = tail call i32 (...) @tty_init()
%6 = tail call i32 (...) @mmu_init()
%7 = tail call i32 (...) @mmu_enable()
%8 = tail call i32 (...) @timer_enable()
%9 = tail call i32 (...) @pipe_init()
%10 = tail call i32 (...) @process_init()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void write_bits(int, unsigned int, int /*<<< orphan*/ *);
void a1_write_4bit(unsigned int c, FILE *out) { return write_bits(4, c, out); }


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

x86 assembly (clang, -O2):
<a1_write_4bit>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4,%edi
jmp    1030 <write_bits@plt>

LLVM IR (-O0):
define void @a1_write_4bit(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
ret void
}

LLVM IR (-O2):
define void @a1_write_4bit(i32 %0, i32* %1) {
tail call void @write_bits(i32 4, i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void texteffect(int effect) { printf("\033[%02dm", effect); }


x86 assembly (clang, -O0):
<texteffect>:
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):
<texteffect>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[%02dm\00"
define void @texteffect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[%02dm\00"
define void @texteffect(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void decode_cert(struct msg_digest *md) {}


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

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

LLVM IR (-O0):
%struct.msg_digest = type opaque
define void @decode_cert(%struct.msg_digest* %0) {
%2 = alloca %struct.msg_digest*
store %struct.msg_digest* %0, %struct.msg_digest** %2
ret void
}

LLVM IR (-O2):
%struct.msg_digest = type opaque
define void @decode_cert(%struct.msg_digest* nocapture %0) {
ret void
}
int add(int i, int j) { return i + j; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char *msg) { printf("%s zhaoweiwei\n", msg); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s zhaoweiwei\0A\00"
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s zhaoweiwei\0A\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1, j = 0, k;
  k = i & j;
  k |= !!k;
  printf("%d", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = and i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = load i32, i32* %4
%14 = or i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
scalar_t__ smbw_fd(int);
int /*<<< orphan*/ smbw_read(int, void *, size_t);
int /*<<< orphan*/ stub1(int, void *, size_t);
ssize_t readx(int fd, void *buf, size_t count,
              ssize_t (*f)(int, void *, size_t)) {
  if (smbw_fd(fd)) {
    return smbw_read(fd, buf, count);
  }
  return (*f)(fd, buf, count);
}


x86 assembly (clang, -O0):
<readx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <smbw_fd@plt>
cmp    $0x0,%rax
je     1161 <readx+0x41>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <smbw_read@plt>
mov    %eax,-0x4(%rbp)
jmp    1175 <readx+0x55>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   *%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readx>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <smbw_fd@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
test   %rax,%rax
je     1153 <readx+0x33>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <smbw_read@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    *%rax

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

LLVM IR (-O2):
define i32 @readx(i32 %0, i8* %1, i64 %2, i32 (i32, i8*, i64)* nocapture %3) {
%5 = tail call i64 @smbw_fd(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @smbw_read(i32 %0, i8* %1, i64 %2)
br label %11
9: ; preds = %4
%10 = tail call i32 %3(i32 %0, i8* %1, i64 %2)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ isdigit(char);
int strlen(char const *);
int host_prefix_end(const char *hostname) {
  int idx = strlen(hostname) - 1;
  while (idx >= 0 && isdigit((char)hostname[idx]))
    idx--;
  return idx;
}


x86 assembly (clang, -O0):
<host_prefix_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1165 <host_prefix_end+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1175 <host_prefix_end+0x55>
jmp    1183 <host_prefix_end+0x63>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <host_prefix_end+0x1b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_prefix_end>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%ebx
nop
mov    %rbx,%r15
test   %r15d,%r15d
jle    114d <host_prefix_end+0x2d>
lea    -0x1(%r15),%rbx
mov    %ebx,%eax
movsbl (%r14,%rax,1),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1130 <host_prefix_end+0x10>
add    $0xffffffff,%r15d
mov    %r15d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @host_prefix_end(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = zext i32 %2 to i64
br label %4
4: ; preds = %9, %1
%5 = phi i64 [ %6, %9 ], [ %3, %1 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = and i64 %6, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i64 @isdigit(i8 signext %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %9
%16 = trunc i64 %6 to i32
ret i32 %16
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int wait(int /*<<< orphan*/ *);
void parent_code(pid_t pid) {
  int ret;
  ret = wait(NULL);
  printf("done waiting for %d, wait() return: %d\n", pid, ret);
}


x86 assembly (clang, -O0):
<parent_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent_code>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <wait@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"done waiting for %d, wait() return: %d\0A\00"
define void @parent_code(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @wait(i32* null)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"done waiting for %d, wait() return: %d\0A\00"
define void @parent_code(i32 %0) {
%2 = tail call i32 @wait(i32* null)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
unsigned int unused_integer_underflow2_Good_FP() {
  unsigned int n = 0;
  return n--;
}


x86 assembly (clang, -O0):
<unused_integer_underflow2_Good_FP>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @unused_integer_underflow2_Good_FP() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add i32 %2, -1
store i32 %3, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @unused_integer_underflow2_Good_FP() {
ret i32 0
}
int lineCommentCharPredicate(char c) { return c != '\n'; }


x86 assembly (clang, -O0):
<lineCommentCharPredicate>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineCommentCharPredicate>:
xor    %eax,%eax
cmp    $0xa,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @lineCommentCharPredicate(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @lineCommentCharPredicate(i8 signext %0) {
%2 = icmp ne i8 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int main() {
  FILE *fp;
  fp = fopen("file.txt", "w+");
  fputs("This is a system programming language.", fp);
  fputs("This is c programming.", fp);
  fclose(fp);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
lea    0xecc(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [39 x i8] c"This is a system programming language.\00"
@.str.3 = [23 x i8] c"This is c programming.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fputs(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @fputs(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @fclose(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [39 x i8] c"This is a system programming language.\00"
@.str.3 = [23 x i8] c"This is c programming.\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i64 38, i64 1, i32* %1)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 22, i64 1, i32* %1)
%4 = tail call i32 @fclose(i32* %1)
ret i32 0
}
int foo(int i) {
  int r;
  r = (80 - 4 * i) / 20;
  return r;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
shl    $0x2,%edi
mov    $0x50,%eax
sub    %edi,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 4, %4
%6 = sub nsw i32 80, %5
%7 = sdiv i32 %6, 20
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul i32 %0, -4
%3 = add i32 %2, 80
%4 = sdiv i32 %3, 20
ret i32 %4
}
void port_unlock_from_isr(void) { __asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @port_unlock_from_isr() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void _M2_npn_finish(__attribute__((unused)) int argc,
                    __attribute__((unused)) char *argv[]) {}


x86 assembly (clang, -O0):
<_M2_npn_finish>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_M2_npn_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Ws(char *);
int WinstA(int i, int code) {
  Ws("Inst Axxx");
  return 0;
}


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

x86 assembly (clang, -O2):
<WinstA>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <Ws@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Inst Axxx\00"
define i32 @WinstA(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @Ws(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Inst Axxx\00"
define i32 @WinstA(i32 %0, i32 %1) {
%3 = tail call i32 @Ws(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int,
                           int /*<<< orphan*/);
char *plot_func(int);
void draw_func_name(FILE *fp, int x, int index) {
  char *string = plot_func(index);
  fprintf(fp, "(%s) %d %d name\n", string, x, 0);
}


x86 assembly (clang, -O0):
<draw_func_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <plot_func@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeb0(%rip),%rsi
xor    %r8d,%r8d
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_func_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <plot_func@plt>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
mov    %ebp,%ecx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"(%s) %d %d name\0A\00"
define void @draw_func_name(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i8* @plot_func(i32 %8)
store i8* %9, i8** %7
%10 = load i32*, i32** %4
%11 = load i8*, i8** %7
%12 = load i32, i32* %5
%13 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"(%s) %d %d name\0A\00"
define void @draw_func_name(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i8* @plot_func(i32 %2)
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %1, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ load_xmm(int, void *);
int /*<<< orphan*/ print_vec_uint8_hex(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
void print_xmm_uint8_hex(int i) {
  static uint8_t v[16];
  load_xmm(i, (void *)v);
  printf("xmm%d = ", i);
  print_vec_uint8_hex(v);
}


x86 assembly (clang, -O0):
<print_xmm_uint8_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
call   1050 <load_xmm@plt>
mov    -0x4(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0x2ef0(%rip),%rdi
call   1030 <print_vec_uint8_hex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xmm_uint8_hex>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x2f13(%rip),%r14
mov    %r14,%rsi
call   1050 <load_xmm@plt>
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <print_vec_uint8_hex@plt>

LLVM IR (-O0):
@print_xmm_uint8_hex.v = internal global [16 x i32] zeroinitializer
@.str = [9 x i8] c"xmm%d = \00"
define void @print_xmm_uint8_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @load_xmm(i32 %3, i8* bitcast ([16 x i32]* @print_xmm_uint8_hex.v to i8*))
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @print_vec_uint8_hex(i32* getelementptr inbounds ([16 x i32], [16 x i32]* @print_xmm_uint8_hex.v, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@print_xmm_uint8_hex.v = internal global [16 x i32] zeroinitializer
@.str = [9 x i8] c"xmm%d = \00"
define void @print_xmm_uint8_hex(i32 %0) {
%2 = tail call i32 @load_xmm(i32 %0, i8* bitcast ([16 x i32]* @print_xmm_uint8_hex.v to i8*))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @print_vec_uint8_hex(i32* getelementptr inbounds ([16 x i32], [16 x i32]* @print_xmm_uint8_hex.v, i64 0, i64 0))
ret void
}
int main(int argc, char **argv) {
  const volatile int v = argc;
  return v - argc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
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
%7 = load i32, i32* %4
store volatile i32 %7, i32* %6
%8 = load volatile i32, i32* %6
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 %0, i32* %3
%5 = load volatile i32, i32* %3
%6 = sub nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ mat3f_rotateQuatVec_new(float *, float const *);
int /*<<< orphan*/ mat4f_from_mat3f(float *, float *);
void mat4f_rotateQuatVec_new(float matrix[16], const float quat[4]) {
  float tmpMat[9];
  mat3f_rotateQuatVec_new(tmpMat, quat);
  mat4f_from_mat3f(matrix, tmpMat);
}


x86 assembly (clang, -O0):
<mat4f_rotateQuatVec_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mat3f_rotateQuatVec_new@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <mat4f_from_mat3f@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4f_rotateQuatVec_new>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <mat3f_rotateQuatVec_new@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <mat4f_from_mat3f@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mat4f_rotateQuatVec_new(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [9 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = getelementptr inbounds [9 x float], [9 x float]* %5, i64 0, i64 0
%7 = load float*, float** %4
%8 = call i32 @mat3f_rotateQuatVec_new(float* %6, float* %7)
%9 = load float*, float** %3
%10 = getelementptr inbounds [9 x float], [9 x float]* %5, i64 0, i64 0
%11 = call i32 @mat4f_from_mat3f(float* %9, float* %10)
ret void
}

LLVM IR (-O2):
define void @mat4f_rotateQuatVec_new(float* %0, float* %1) {
%3 = alloca [9 x float]
%4 = bitcast [9 x float]* %3 to i8*
%5 = getelementptr inbounds [9 x float], [9 x float]* %3, i64 0, i64 0
%6 = call i32 @mat3f_rotateQuatVec_new(float* %5, float* %1)
%7 = call i32 @mat4f_from_mat3f(float* %0, float* %5)
ret void
}
int fun685() { return 685; }


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

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

LLVM IR (-O0):
define i32 @fun685() {
ret i32 685
}

LLVM IR (-O2):
define i32 @fun685() {
ret i32 685
}
void bork() { int Qux[33] = {0}; }


x86 assembly (clang, -O0):
<bork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x84,%edx
call   1030 <memset@plt>
add    $0x90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bork() {
%1 = alloca [33 x i32]
%2 = bitcast [33 x i32]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @bork() {
ret void
}
int icache_status(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @icache_status() {
ret i32 0
}