xunge/DecIR huggingface dataset:
__attribute__((no, noclone)) unsigned __int128 t102_2sub(unsigned short y) {
  signed char x = (5);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t102_2sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %di,%ax
mov    %ax,-0x12(%rbp)
movb   $0x5,-0x13(%rbp)
movsbq -0x13(%rbp),%rdx
mov    %rdx,%r9
sar    $0x3f,%r9
movzwl -0x12(%rbp),%eax
sub    %rax,%rdx
mov    %r9,%rcx
sbb    $0x0,%rcx
mov    %r9,%r8
sbb    $0x0,%r8
sbb    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    117d <t102_2sub+0x6d>
jmp    1184 <t102_2sub+0x74>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t102_2sub>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%eax
xor    %r14d,%r14d
mov    $0x5,%ebx
sub    %rax,%rbx
sbb    %r14,%r14
cmp    $0x6,%di
jb     1131 <t102_2sub+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 } @t102_2sub(i16 zeroext %0) {
%2 = alloca i128
%3 = alloca i16
%4 = alloca i8
%5 = alloca i128
store i16 %0, i16* %3
store i8 5, i8* %4
%6 = load i8, i8* %4
%7 = load i16, i16* %3
%8 = sext i8 %6 to i129
%9 = zext i16 %7 to i129
%10 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %8, i129 %9)
%11 = extractvalue { i129, i1 } %10, 1
%12 = extractvalue { i129, i1 } %10, 0
%13 = trunc i129 %12 to i128
%14 = zext i128 %13 to i129
%15 = icmp ne i129 %12, %14
%16 = or i1 %11, %15
store i128 %13, i128* %5
br i1 %16, label %17, label %19
17: ; preds = %1
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %1
%20 = load i128, i128* %5
store i128 %20, i128* %2
%21 = bitcast i128* %2 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t102_2sub(i16 zeroext %0) {
%2 = zext i16 %0 to i129
%3 = sub nsw i129 5, %2
%4 = icmp ugt i16 %0, 5
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @bar()
br label %7
7: ; preds = %5, %1
%8 = trunc i129 %3 to i64
%9 = lshr i129 %3, 64
%10 = trunc i129 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
/* Variables and functions */
int /*<<< orphan*/ msf_frame_to_msf(long, int *, int *, int *);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
char *time_frame_to_mmssff(long f) {
  static char msf[10];
  int minutes, seconds, frames;
  msf_frame_to_msf(f, &minutes, &seconds, &frames);
  sprintf(msf, "%02d:%02d:%02d", minutes, seconds, frames);
  return msf;
}


x86 assembly (clang, -O0):
<time_frame_to_mmssff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <msf_frame_to_msf@plt>
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0x2edf(%rip),%rdi
lea    0xea7(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ecc(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_frame_to_mmssff>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1030 <msf_frame_to_msf@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
lea    0x2ee4(%rip),%rbx
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@time_frame_to_mmssff.msf = internal global [10 x i8] zeroinitializer
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define i8* @time_frame_to_mmssff(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %2
%6 = load i64, i64* %2
%7 = call i32 @msf_frame_to_msf(i64 %6, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @time_frame_to_mmssff.msf, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @time_frame_to_mmssff.msf, i64 0, i64 0)
}

LLVM IR (-O2):
@time_frame_to_mmssff.msf = internal global [10 x i8] zeroinitializer
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define i8* @time_frame_to_mmssff(i64 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @msf_frame_to_msf(i64 %0, i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @time_frame_to_mmssff.msf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @time_frame_to_mmssff.msf, i64 0, i64 0)
}
int rb_isdigit(int c) { return '0' <= c && c <= '9'; }


x86 assembly (clang, -O0):
<rb_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <rb_isdigit+0x24>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @rb_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rb_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XCirculateRequestEvent;

/* Variables and functions */
int get_XCirculateRequestEvent_type(void *_p) {
  return (int)((XCirculateRequestEvent *)_p)->type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCirculateRequestEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XCirculateRequestEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int ntlibc_tolower(int c) {
  if (('A' <= c) && (c <= 'Z')) {
    int diff = 'a' - 'A';
    return c + diff;
  }
  return c;
}


x86 assembly (clang, -O0):
<ntlibc_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     1134 <ntlibc_tolower+0x34>
cmpl   $0x5a,-0x8(%rbp)
jg     1134 <ntlibc_tolower+0x34>
movl   $0x20,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <ntlibc_tolower+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntlibc_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ntlibc_tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 65, %5
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %14
10: ; preds = %7
store i32 32, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
store i32 %13, i32* %2
br label %16
14: ; preds = %7, %1
%15 = load i32, i32* %3
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ntlibc_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(char);
int print_sign(int n) {
  if (n > 0) {
    _putchar('+');
    return (1);
  } else if (n == 0) {
    _putchar('0');
    return (0);
  } else {
    _putchar('-');
    return (-1);
  }
}


x86 assembly (clang, -O0):
<print_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    113b <print_sign+0x2b>
mov    $0x2b,%edi
call   1030 <_putchar@plt>
movl   $0x1,-0x4(%rbp)
jmp    116c <print_sign+0x5c>
cmpl   $0x0,-0x8(%rbp)
jne    115b <print_sign+0x4b>
mov    $0x30,%edi
call   1030 <_putchar@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <print_sign+0x5c>
mov    $0x2d,%edi
call   1030 <_putchar@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sign>:
push   %rbx
xor    %eax,%eax
test   %edi,%edi
setne  %al
neg    %eax
xor    %ecx,%ecx
test   %edi,%edi
sete   %cl
lea    0x2d(%rcx,%rcx,2),%ecx
mov    $0x2b,%edx
cmovle %ecx,%edx
mov    $0x1,%ebx
cmovle %eax,%ebx
movzbl %dl,%edi
call   1030 <_putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @print_sign(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @_putchar(i8 signext 43)
store i32 1, i32* %2
br label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @_putchar(i8 signext 48)
store i32 0, i32* %2
br label %15
13: ; preds = %8
%14 = call i32 @_putchar(i8 signext 45)
store i32 -1, i32* %2
br label %15
15: ; preds = %13, %11, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @print_sign(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8 48, i8 45
%5 = xor i1 %3, true
%6 = sext i1 %5 to i32
%7 = select i1 %2, i8 43, i8 %4
%8 = select i1 %2, i32 1, i32 %6
%9 = tail call i32 @_putchar(i8 signext %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_unfree_pawns(int, int);
void w_unfree_pawns_test(void **state) {
  assert_int_equal(0x0000000010000000ul,
                   w_unfree_pawns(0x0000000018000000ul, 0x0000001000000000ul));
}


x86 assembly (clang, -O0):
<w_unfree_pawns_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x18000000,%edi
xor    %esi,%esi
call   1040 <w_unfree_pawns@plt>
mov    %eax,%esi
mov    $0x10000000,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_unfree_pawns_test>:
push   %rax
mov    $0x18000000,%edi
xor    %esi,%esi
call   1040 <w_unfree_pawns@plt>
mov    $0x10000000,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_unfree_pawns_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_unfree_pawns(i32 402653184, i32 0)
%4 = call i32 @assert_int_equal(i32 268435456, i32 %3)
ret void
}

LLVM IR (-O2):
define void @w_unfree_pawns_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_unfree_pawns(i32 402653184, i32 0)
%3 = tail call i32 @assert_int_equal(i32 268435456, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) wrong_type(int arg_index) {
  fflush(NULL);
  fprintf(stderr, "Wrong argument type in index %d\n", arg_index);
  exit(1);
}


x86 assembly (clang, -O0):
<wrong_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<wrong_type>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <fflush@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Wrong argument type in index %d\0A\00"
define void @wrong_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @fflush(i32* null)
%4 = load i32, i32* @stderr
%5 = load i32, i32* %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Wrong argument type in index %d\0A\00"
define void @wrong_type(i32 %0) {
%2 = tail call i32 @fflush(i32* null)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct Layer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_layer_arrays(struct Layer const *);
void neural_layer_softmax_free(const struct Layer *l) { free_layer_arrays(l); }


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

x86 assembly (clang, -O2):
<neural_layer_softmax_free>:
jmp    1030 <free_layer_arrays@plt>

LLVM IR (-O0):
%struct.Layer = type { i32 }
define void @neural_layer_softmax_free(%struct.Layer* %0) {
%2 = alloca %struct.Layer*
store %struct.Layer* %0, %struct.Layer** %2
%3 = load %struct.Layer*, %struct.Layer** %2
%4 = call i32 @free_layer_arrays(%struct.Layer* %3)
ret void
}

LLVM IR (-O2):
%struct.Layer = type { i32 }
define void @neural_layer_softmax_free(%struct.Layer* %0) {
%2 = tail call i32 @free_layer_arrays(%struct.Layer* %0)
ret void
}
/* Variables and functions */
int isxdigit(int);
bool invalidFunctionArgBool_isxdigit(bool b, int c) {
  (void)isxdigit(b);
  return isxdigit(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <isxdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArgBool_isxdigit>:
xor    %edi,%edi
test   %esi,%esi
setne  %dil
jmp    1030 <isxdigit@plt>

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_isxdigit(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 = call i32 @isxdigit(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @isxdigit(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_isxdigit(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @isxdigit(i32 %4)
ret i32 %5
}
void main() {
  int z = "oiee";
  int a = 2343433555;
  printf(z);
  getch();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rax
movslq %eax,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getch@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"oiee\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 ptrtoint ([5 x i8]* @.str to i32), i32* %1
store i32 -1951533741, i32* %2
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = call i32 (i8*, ...) @printf(i8* %5)
%7 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"oiee\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 sext (i32 ptrtoint ([5 x i8]* @.str to i32) to i64) to i8*))
%2 = tail call i32 (...) @getch()
ret void
}
/* Variables and functions */
int **buildMat123(int, int);
int /*<<< orphan*/ deleteMat(int **, int);
int /*<<< orphan*/ outMat(int **, int, int);
int /*<<< orphan*/ rotateMat(int **, int);
void testRotateMat() {
  int size = 4;
  int **xs = buildMat123(size, size);
  outMat(xs, size, size);
  rotateMat(xs, size);
  outMat(xs, size, size);
  deleteMat(xs, size);
}


x86 assembly (clang, -O0):
<testRotateMat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <buildMat123@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <outMat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <rotateMat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <outMat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <deleteMat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testRotateMat>:
push   %rbx
mov    $0x4,%edi
mov    $0x4,%esi
call   1060 <buildMat123@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1030 <outMat@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <rotateMat@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1030 <outMat@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
pop    %rbx
jmp    1050 <deleteMat@plt>

LLVM IR (-O0):
define void @testRotateMat() {
%1 = alloca i32
%2 = alloca i32**
store i32 4, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = call i32** @buildMat123(i32 %3, i32 %4)
store i32** %5, i32*** %2
%6 = load i32**, i32*** %2
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @outMat(i32** %6, i32 %7, i32 %8)
%10 = load i32**, i32*** %2
%11 = load i32, i32* %1
%12 = call i32 @rotateMat(i32** %10, i32 %11)
%13 = load i32**, i32*** %2
%14 = load i32, i32* %1
%15 = load i32, i32* %1
%16 = call i32 @outMat(i32** %13, i32 %14, i32 %15)
%17 = load i32**, i32*** %2
%18 = load i32, i32* %1
%19 = call i32 @deleteMat(i32** %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @testRotateMat() {
%1 = tail call i32** @buildMat123(i32 4, i32 4)
%2 = tail call i32 @outMat(i32** %1, i32 4, i32 4)
%3 = tail call i32 @rotateMat(i32** %1, i32 4)
%4 = tail call i32 @outMat(i32** %1, i32 4, i32 4)
%5 = tail call i32 @deleteMat(i32** %1, i32 4)
ret void
}
void shift_rgb(char r, char g, char b) {}


x86 assembly (clang, -O0):
<shift_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @shift_rgb(i8 signext %0, i8 signext %1, i8 signext %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
ret void
}

LLVM IR (-O2):
define void @shift_rgb(i8 signext %0, i8 signext %1, i8 signext %2) {
ret void
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glutSolidSphere(1.0, 20, 16);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xead(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   1050 <glutSolidSphere@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xeb0(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   1050 <glutSolidSphere@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glutSolidSphere(double 1.000000e+00, i32 20, i32 16)
%6 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glutSolidSphere(double 1.000000e+00, i32 20, i32 16)
%6 = tail call i32 (...) @glFlush()
ret void
}
int check_parameter(char str, char *tab, int size) {
  int i = 0;
  while (i < size) {
    if (str == tab[i]) {
      return 1;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_parameter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1156 <check_parameter+0x56>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1148 <check_parameter+0x48>
movl   $0x1,-0x4(%rbp)
jmp    115d <check_parameter+0x5d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <check_parameter+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_parameter>:
test   %edx,%edx
jle    111f <check_parameter+0x1f>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %dil,(%rsi,%rcx,1)
je     1122 <check_parameter+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <check_parameter+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct addrinfo *);
void freeaddrinfo(struct addrinfo *ai) {
  while (ai != NULL) {
    struct addrinfo *next = ai->ai_next;
    free(ai);
    ai = next;
  };
}


x86 assembly (clang, -O0):
<freeaddrinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <freeaddrinfo+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    111c <freeaddrinfo+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeaddrinfo>:
push   %rbx
test   %rdi,%rdi
je     1130 <freeaddrinfo+0x20>
cs nopw 0x0(%rax,%rax,1)
mov    (%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
test   %rbx,%rbx
jne    1120 <freeaddrinfo+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.addrinfo = type { %struct.addrinfo* }
define void @freeaddrinfo(%struct.addrinfo* %0) {
%2 = alloca %struct.addrinfo*
%3 = alloca %struct.addrinfo*
store %struct.addrinfo* %0, %struct.addrinfo** %2
br label %4
4: ; preds = %7, %1
%5 = load %struct.addrinfo*, %struct.addrinfo** %2
%6 = icmp ne %struct.addrinfo* %5, null
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load %struct.addrinfo*, %struct.addrinfo** %2
%9 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %8, i32 0, i32 0
%10 = load %struct.addrinfo*, %struct.addrinfo** %9
store %struct.addrinfo* %10, %struct.addrinfo** %3
%11 = load %struct.addrinfo*, %struct.addrinfo** %2
%12 = call i32 @free(%struct.addrinfo* %11)
%13 = load %struct.addrinfo*, %struct.addrinfo** %3
store %struct.addrinfo* %13, %struct.addrinfo** %2
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { %struct.addrinfo* }
define void @freeaddrinfo(%struct.addrinfo* %0) {
%2 = icmp eq %struct.addrinfo* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi %struct.addrinfo* [ %6, %3 ], [ %0, %1 ]
%5 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %4, i64 0, i32 0
%6 = load %struct.addrinfo*, %struct.addrinfo** %5
%7 = tail call i32 @free(%struct.addrinfo* %4)
%8 = icmp eq %struct.addrinfo* %6, null
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
int wrenUtf8NumBytes(int value) {
  do {
  } while (0);
  if (value <= 0x7f)
    return 1;
  if (value <= 0x7ff)
    return 2;
  if (value <= 0xffff)
    return 3;
  if (value <= 0x10ffff)
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<wrenUtf8NumBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
jmp    110c <wrenUtf8NumBytes+0xc>
cmpl   $0x7f,-0x8(%rbp)
jg     1122 <wrenUtf8NumBytes+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1174 <wrenUtf8NumBytes+0x74>
cmpl   $0x7ff,-0x8(%rbp)
jg     113b <wrenUtf8NumBytes+0x3b>
movl   $0x2,-0x4(%rbp)
jmp    1174 <wrenUtf8NumBytes+0x74>
cmpl   $0xffff,-0x8(%rbp)
jg     1154 <wrenUtf8NumBytes+0x54>
movl   $0x3,-0x4(%rbp)
jmp    1174 <wrenUtf8NumBytes+0x74>
cmpl   $0x10ffff,-0x8(%rbp)
jg     116d <wrenUtf8NumBytes+0x6d>
movl   $0x4,-0x4(%rbp)
jmp    1174 <wrenUtf8NumBytes+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrenUtf8NumBytes>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1135 <wrenUtf8NumBytes+0x35>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1135 <wrenUtf8NumBytes+0x35>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1135 <wrenUtf8NumBytes+0x35>
xor    %eax,%eax
cmp    $0x110000,%edi
setb   %al
shl    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @wrenUtf8NumBytes(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 1114112
%9 = select i1 %8, i32 4, i32 0
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("syntax: spec2def [<options> ...] <spec file>\n"
         "Possible options:\n"
         "  -h --help       prints this screen\n"
         "  -l=<file>       generates an asm lib stub\n"
         "  -d=<file>       generates a def file\n"
         "  -s=<file>       generates a stub file\n"
         "  --ms            msvc compatibility\n"
         "  -n=<name>       name of the dll\n"
         "  --implib        generate a def file for an import library\n"
         "  -a=<arch>       Set architecture to <arch>. (i386, x86_64, arm)\n"
         "  --with-tracing generates wine-like \"+relay\" trace trampolines. "
         "(necessitates -s)\n");
}


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

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

LLVM IR (-O0):
@.str = [504 x i8] c"syntax: spec2def [<options> ...] <spec file>\0APossible options:\0A -h --help prints this screen\0A -l=<file> generates an asm lib stub\0A -d=<file> generates a def file\0A -s=<file> generates a stub file\0A --ms msvc compatibility\0A -n=<name> name of the dll\0A --implib generate a def file for an import library\0A -a=<arch> Set architecture to <arch>. (i386, x86_64, arm)\0A --with-tracing generates wine-like \22+relay\22 trace trampolines. (necessitates -s)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([504 x i8], [504 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [503 x i8] c"syntax: spec2def [<options> ...] <spec file>\0APossible options:\0A -h --help prints this screen\0A -l=<file> generates an asm lib stub\0A -d=<file> generates a def file\0A -s=<file> generates a stub file\0A --ms msvc compatibility\0A -n=<name> name of the dll\0A --implib generate a def file for an import library\0A -a=<arch> Set architecture to <arch>. (i386, x86_64, arm)\0A --with-tracing generates wine-like \22+relay\22 trace trampolines. (necessitates -s)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([503 x i8], [503 x i8]* @str, i64 0, i64 0))
ret void
}
void test5() {
  int foo(char *i) __attribute__((enable_if(1, ""), overloadable));
  int foo(char *i __attribute__((pass_object_size(0))))
      __attribute__((enable_if(1, ""), overloadable));
  foo((void *)0);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffffffffffffffff,%rsi
call   1030 <_Z3fooUa9enable_ifILi1EEPcU17pass_object_size0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
xor    %edi,%edi
mov    $0xffffffffffffffff,%rsi
jmp    1030 <_Z3fooUa9enable_ifILi1EEPcU17pass_object_size0@plt>

LLVM IR (-O0):
define void @test5() {
%1 = call i64 @llvm.objectsize.i64.p0i8(i8* null, i1 false, i1 true, i1 false)
%2 = call i32 @_Z3fooUa9enable_ifILi1EEPcU17pass_object_size0(i8* null, i64 %1)
ret void
}

LLVM IR (-O2):
define void @test5() {
%1 = tail call i32 @_Z3fooUa9enable_ifILi1EEPcU17pass_object_size0(i8* null, i64 -1)
ret void
}
/* Variables and functions */
int read(int, unsigned int *, int);
int read_int4(int f, int *i) {
  unsigned int n;
  if (read(f, &n, 4) == 4) {
    *i = ((n & 0xff000000) >> 24 | (n & 0x00ff0000) >> 8 |
          (n & 0x0000ff00) << 8 | (n & 0x000000ff) << 24);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<read_int4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
cmp    $0x4,%eax
jne    117e <read_int4+0x6e>
mov    -0x14(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
mov    -0x14(%rbp),%eax
and    $0xff0000,%eax
shr    $0x8,%eax
or     %eax,%ecx
mov    -0x14(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x14(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1185 <read_int4+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int4>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
jne    113d <read_int4+0x2d>
mov    0xc(%rsp),%eax
bswap  %eax
mov    %eax,(%rbx)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_int4(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%7 = load i32, i32* %4
%8 = call i32 @read(i32 %7, i32* %6, i32 4)
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %27
10: ; preds = %2
%11 = load i32, i32* %6
%12 = and i32 %11, -16777216
%13 = lshr i32 %12, 24
%14 = load i32, i32* %6
%15 = and i32 %14, 16711680
%16 = lshr i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %6
%19 = and i32 %18, 65280
%20 = shl i32 %19, 8
%21 = or i32 %17, %20
%22 = load i32, i32* %6
%23 = and i32 %22, 255
%24 = shl i32 %23, 24
%25 = or i32 %21, %24
%26 = load i32*, i32** %5
store i32 %25, i32* %26
store i32 1, i32* %3
br label %28
27: ; preds = %2
store i32 0, i32* %3
br label %28
28: ; preds = %27, %10
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @read_int4(i32 %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @read(i32 %0, i32* %3, i32 4)
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = tail call i32 @llvm.bswap.i32(i32 %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %11
}
void genbgtz() {}


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

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

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

LLVM IR (-O2):
define void @genbgtz() {
ret void
}
/* Variables and functions */
scalar_t__ Fork();
int /*<<< orphan*/ printf(char *);
void doit() {
  if (Fork() == 0) {
    Fork();
    printf("hello\n");
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Fork@plt>
cmp    $0x0,%rax
jne    114d <doit+0x2d>
mov    $0x0,%al
call   1030 <Fork@plt>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
jmp    1152 <doit+0x32>
jmp    1152 <doit+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
push   %rax
xor    %eax,%eax
call   1030 <Fork@plt>
test   %rax,%rax
je     112f <doit+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1030 <Fork@plt>
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define void @doit() {
%1 = call i64 (...) @Fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 (...) @Fork()
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
6: ; preds = %0
br label %7
7: ; preds = %6, %3
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @doit() {
%1 = tail call i64 (...) @Fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 (...) @Fork()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBHostReset(uint32_t ui32Base, bool bStart) {
  ;
  if (bStart) {
    (*((volatile unsigned char *)(ui32Base + 0x00000001))) |= 0x00000008;
  } else {
    (*((volatile unsigned char *)(ui32Base + 0x00000001))) &= ~0x00000008;
  }
}


x86 assembly (clang, -O0):
<USBHostReset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112a <USBHostReset+0x2a>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
movzbl %cl,%ecx
or     $0x8,%ecx
mov    %cl,0x1(%rax)
jmp    113a <USBHostReset+0x3a>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
movzbl %cl,%ecx
and    $0xfffffff7,%ecx
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostReset>:
test   %esi,%esi
setne  %al
mov    0x1(%rdi),%cl
and    $0xf7,%cl
shl    $0x3,%al
or     %cl,%al
mov    %al,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBHostReset(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
%10 = inttoptr i64 %9 to i8*
%11 = load volatile i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %12, 8
%14 = trunc i32 %13 to i8
store volatile i8 %14, i8* %10
br label %23
15: ; preds = %2
%16 = load i64, i64* %3
%17 = add nsw i64 %16, 1
%18 = inttoptr i64 %17 to i8*
%19 = load volatile i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %20, -9
%22 = trunc i32 %21 to i8
store volatile i8 %22, i8* %18
br label %23
23: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @USBHostReset(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add nsw i64 %0, 1
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
%7 = and i8 %6, -9
%8 = select i1 %3, i8 0, i8 8
%9 = or i8 %7, %8
store volatile i8 %9, i8* %5
ret void
}
int test_imm_B3int16_reg(short val) {
  return ((val) & (0xB3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B3int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xb3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B3int16_reg>:
test   $0xb3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B3int16_reg(i16 signext %0) {
%2 = and i16 %0, 179
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct fa_status {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_error(char *);
bool read_replay_status(struct fa_status *status) {
  return ({
    print_error("Sniffer status unavailable in replay mode");
    false;
  });
}


x86 assembly (clang, -O0):
<read_replay_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fa_status = type { i32 }
@.str = [42 x i8] c"Sniffer status unavailable in replay mode\00"
define i32 @read_replay_status(%struct.fa_status* %0) {
%2 = alloca %struct.fa_status*
%3 = alloca i32
store %struct.fa_status* %0, %struct.fa_status** %2
%4 = call i32 @print_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
%struct.fa_status = type { i32 }
@.str = [42 x i8] c"Sniffer status unavailable in replay mode\00"
define i32 @read_replay_status(%struct.fa_status* nocapture readnone %0) {
%2 = tail call i32 @print_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned BKDRHash(char *str) {
  unsigned seed = 131;
  unsigned hash = 0;
  while (*str)
    hash = hash * seed + (*str++);
  return (hash & 0x7fffffff);
}


x86 assembly (clang, -O0):
<BKDRHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x83,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <BKDRHash+0x46>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <BKDRHash+0x16>
mov    -0x10(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BKDRHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <BKDRHash+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x83,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <BKDRHash+0x10>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @BKDRHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 131
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ data();
int /*<<< orphan*/ data2();
int /*<<< orphan*/ different(int);
int /*<<< orphan*/ invalid(int /*<<< orphan*/);
int /*<<< orphan*/ validity(int, int /*<<< orphan*/);
int main() {
  different(5);
  validity(5, data());
  invalid(data2());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <different@plt>
mov    $0x0,%al
call   1050 <data@plt>
mov    %eax,%esi
mov    $0x5,%edi
call   1040 <validity@plt>
mov    $0x0,%al
call   1060 <data2@plt>
mov    %eax,%edi
call   1070 <invalid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <different@plt>
xor    %eax,%eax
call   1050 <data@plt>
mov    $0x5,%edi
mov    %eax,%esi
call   1040 <validity@plt>
xor    %eax,%eax
call   1060 <data2@plt>
mov    %eax,%edi
call   1070 <invalid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @different(i32 5)
%3 = call i32 (...) @data()
%4 = call i32 @validity(i32 5, i32 %3)
%5 = call i32 (...) @data2()
%6 = call i32 @invalid(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @different(i32 5)
%2 = tail call i32 (...) @data()
%3 = tail call i32 @validity(i32 5, i32 %2)
%4 = tail call i32 (...) @data2()
%5 = tail call i32 @invalid(i32 %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ ReadReg(int);
int VPU_IsBusy() { return ReadReg((0xC0700000 + 0x160)) != 0; }


x86 assembly (clang, -O0):
<VPU_IsBusy>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc0700160,%edi
call   1030 <ReadReg@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VPU_IsBusy>:
push   %rax
mov    $0xc0700160,%edi
call   1030 <ReadReg@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @VPU_IsBusy() {
%1 = call i64 @ReadReg(i32 -1066401440)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @VPU_IsBusy() {
%1 = tail call i64 @ReadReg(i32 -1066401440)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __cxa_finalize(int /*<<< orphan*/ *);
int /*<<< orphan*/ __cxa_thread_finalize();
int /*<<< orphan*/ _exit(int);
void exit(int status) {
  __cxa_thread_finalize();
  __cxa_finalize(NULL);
  _exit(status);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__cxa_thread_finalize@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <__cxa_finalize@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <__cxa_thread_finalize@plt>
xor    %edi,%edi
call   1050 <__cxa_finalize@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__cxa_thread_finalize()
%4 = call i32 @__cxa_finalize(i32* null)
%5 = load i32, i32* %2
%6 = call i32 @_exit(i32 %5)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @__cxa_thread_finalize()
%3 = tail call i32 @__cxa_finalize(i32* null)
%4 = tail call i32 @_exit(i32 %0)
unreachable
}
int main() {
  int a = 2;
  int b = 5;
  int c = a + b;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 7
}
/* Variables and functions */
unsigned long long *malloc(size_t);
int /*<<< orphan*/ memcpy(unsigned long long *, unsigned long long const *,
                          size_t);
unsigned long long *zlludup(unsigned long long const *src, size_t len) {
  unsigned long long *p = malloc(len * sizeof(unsigned long long));
  memcpy(p, src, len * sizeof(unsigned long long));
  return p;
}


x86 assembly (clang, -O0):
<zlludup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
shl    $0x3,%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zlludup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x0(,%rsi,8),%r15
mov    %r15,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64* @zlludup(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64*
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = mul i64 %6, 8
%8 = call i64* @malloc(i64 %7)
store i64* %8, i64** %5
%9 = load i64*, i64** %5
%10 = load i64*, i64** %3
%11 = load i64, i64* %4
%12 = mul i64 %11, 8
%13 = call i32 @memcpy(i64* %9, i64* %10, i64 %12)
%14 = load i64*, i64** %5
ret i64* %14
}

LLVM IR (-O2):
define i64* @zlludup(i64* %0, i64 %1) {
%3 = shl i64 %1, 3
%4 = tail call i64* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i64* %4, i64* %0, i64 %3)
ret i64* %4
}