xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ xcb_get_property_reply_t;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ xcb_ewmh_get_cardinal_from_reply(int /*<<< orphan*/ *,
                                                    int /*<<< orphan*/ *);
uint8_t xcb_ewmh_get_current_desktop_from_reply(uint32_t *current_desktop,
                                                xcb_get_property_reply_t *r) {
  return xcb_ewmh_get_cardinal_from_reply(current_desktop, r);
}


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

x86 assembly (clang, -O2):
<xcb_ewmh_get_current_desktop_from_reply>:
jmp    1030 <xcb_ewmh_get_cardinal_from_reply@plt>

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

LLVM IR (-O2):
define i32 @xcb_ewmh_get_current_desktop_from_reply(i32* %0, i32* %1) {
%3 = tail call i32 @xcb_ewmh_get_cardinal_from_reply(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int f481(int *);
int f482(int *p) { return f481(p); }


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

x86 assembly (clang, -O2):
<f482>:
jmp    1030 <f481@plt>

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

LLVM IR (-O2):
define i32 @f482(i32* %0) {
%2 = tail call i32 @f481(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_ivector(int *v, long nl, long nh) { free((char *)(v + nl - 1)); }


x86 assembly (clang, -O0):
<free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ivector>:
lea    (%rdi,%rsi,4),%rdi
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_ivector(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i32, i32* %7, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 -1
%11 = bitcast i32* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_ivector(i32* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
%5 = getelementptr inbounds i32, i32* %4, i64 -1
%6 = bitcast i32* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
/* Variables and functions */
int _pb_print_bits(unsigned short *, int);
int _pb_print_bits_us(unsigned short value) {
  return _pb_print_bits(&value, sizeof(unsigned short));
  ;
}


x86 assembly (clang, -O0):
<_pb_print_bits_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <_pb_print_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pb_print_bits_us>:
push   %rax
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <_pb_print_bits@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_pb_print_bits_us(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @_pb_print_bits(i16* %2, i32 2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @_pb_print_bits_us(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @_pb_print_bits(i16* %2, i32 2)
ret i32 %3
}
/* Variables and functions */
int memcmp(void const *, void const *, size_t);
int memcmp_fast(const void *a, const void *b, size_t len) {
  return memcmp(a, b, len);
}


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

x86 assembly (clang, -O2):
<memcmp_fast>:
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @memcmp_fast(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ __pgrp;
};
typedef TYPE_1__ posix_spawnattr_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int posix_spawnattr_getpgroup(const posix_spawnattr_t *restrict attr,
                              pid_t *restrict pgrp) {
  *pgrp = attr->__pgrp;
  return 0;
}


x86 assembly (clang, -O0):
<posix_spawnattr_getpgroup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_getpgroup(%struct.TYPE_3__* noalias %0, i32* noalias %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i32*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i32* %1, i32** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_getpgroup(%struct.TYPE_3__* noalias nocapture %0, i32* noalias nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%4 = load i32, i32* %3
store i32 %4, i32* %1
ret i32 0
}
void Console_Flush(void) {}


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

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

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

LLVM IR (-O2):
define void @Console_Flush() {
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ uart_puthexn(unsigned int, int);
int /*<<< orphan*/ uart_puts(char *);
void exception_handler(unsigned exception_index, uint32_t lr) {
  uart_puts("Exception ");
  uart_puthexn(exception_index, 1);
  uart_puts(" at ");
  uart_puthexn(lr, 8);
  uart_puts(" occured.\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exception_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
call   1040 <uart_puts@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <uart_puthexn@plt>
lea    0xebd(%rip),%rdi
call   1040 <uart_puts@plt>
mov    -0x8(%rbp),%edi
mov    $0x8,%esi
call   1030 <uart_puthexn@plt>
lea    0xea9(%rip),%rdi
call   1040 <uart_puts@plt>
jmp    116c <exception_handler+0x4c>

x86 assembly (clang, -O2):
<exception_handler>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1040 <uart_puts@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1030 <uart_puthexn@plt>
lea    0xec5(%rip),%rdi
call   1040 <uart_puts@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <uart_puthexn@plt>
lea    0xeb2(%rip),%rdi
call   1040 <uart_puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1170 <exception_handler+0x50>

LLVM IR (-O0):
@.str = [11 x i8] c"Exception \00"
@.str.1 = [5 x i8] c" at \00"
@.str.2 = [11 x i8] c" occured.\0A\00"
define void @exception_handler(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @uart_puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = call i32 @uart_puthexn(i32 %6, i32 1)
%8 = call i32 @uart_puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = call i32 @uart_puthexn(i32 %9, i32 8)
%11 = call i32 @uart_puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %2, %12
br label %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"Exception \00"
@.str.1 = [5 x i8] c" at \00"
@.str.2 = [11 x i8] c" occured.\0A\00"
define void @exception_handler(i32 %0, i32 %1) {
%3 = tail call i32 @uart_puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @uart_puthexn(i32 %0, i32 1)
%5 = tail call i32 @uart_puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @uart_puthexn(i32 %1, i32 8)
%7 = tail call i32 @uart_puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %2, %8
br label %8
}
int stringLength(char *string) {
  int i;
  for (i = 0; string[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <stringLength+0x37>
jmp    1129 <stringLength+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <stringLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <stringLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @stringLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
struct orbita_potential {
  int dummy;
};

/* Variables and functions */
double orbita_potential_circular_velocity(struct orbita_potential *, double,
                                          int);
double orbita_potential_circular_frequency(struct orbita_potential *psi,
                                           double Rg) {
  return orbita_potential_circular_velocity(psi, Rg, 0.) / Rg;
}


x86 assembly (clang, -O0):
<orbita_potential_circular_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
xor    %esi,%esi
call   1030 <orbita_potential_circular_velocity@plt>
divsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orbita_potential_circular_frequency>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %esi,%esi
call   1030 <orbita_potential_circular_velocity@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.orbita_potential = type { i32 }
define double @orbita_potential_circular_frequency(%struct.orbita_potential* %0, double %1) {
%3 = alloca %struct.orbita_potential*
%4 = alloca double
store %struct.orbita_potential* %0, %struct.orbita_potential** %3
store double %1, double* %4
%5 = load %struct.orbita_potential*, %struct.orbita_potential** %3
%6 = load double, double* %4
%7 = call double @orbita_potential_circular_velocity(%struct.orbita_potential* %5, double %6, i32 0)
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
%struct.orbita_potential = type { i32 }
define double @orbita_potential_circular_frequency(%struct.orbita_potential* %0, double %1) {
%3 = tail call double @orbita_potential_circular_velocity(%struct.orbita_potential* %0, double %1, i32 0)
%4 = fdiv double %3, %1
ret double %4
}
/* Type definitions */
typedef scalar_t__ val;
typedef int uint32_t;

/* Variables and functions */
uint32_t __fswab32(uint32_t val) {
  return ((uint32_t)((((uint32_t)(val) & (uint32_t)0x000000ffUL) << 24) |
                     (((uint32_t)(val) & (uint32_t)0x0000ff00UL) << 8) |
                     (((uint32_t)(val) & (uint32_t)0x00ff0000UL) >> 8) |
                     (((uint32_t)(val) & (uint32_t)0xff000000UL) >> 24)));
}


x86 assembly (clang, -O0):
<__fswab32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fswab32>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__fswab32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = ashr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @__fswab32(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = or i32 %3, %4
ret i32 %5
}
/* Type definitions */
struct generator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ writef(struct generator *, char const *, int /*<<< orphan*/);
void w(struct generator *g, const char *s) { writef(g, s, 0); }


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

x86 assembly (clang, -O2):
<w>:
xor    %edx,%edx
jmp    1030 <writef@plt>

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

LLVM IR (-O2):
%struct.generator = type { i32 }
define void @w(%struct.generator* %0, i8* %1) {
%3 = tail call i32 @writef(%struct.generator* %0, i8* %1, i32 0)
ret void
}
const char *rp_app_desc() { return "Vector Network Analyzer.\n"; }


x86 assembly (clang, -O0):
<rp_app_desc>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_app_desc>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Vector Network Analyzer.\0A\00"
define i8* @rp_app_desc() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [26 x i8] c"Vector Network Analyzer.\0A\00"
define i8* @rp_app_desc() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}
short f7(unsigned short a, unsigned short b) {
  int c;
  return __builtin_mul_overflow(a, b, &c);
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movzwl %cx,%ecx
movzwl %ax,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x8(%rbp)
and    $0x1,%al
movzbl %al,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
xor    %eax,%eax
imul   %esi,%edi
seto   %al
ret

LLVM IR (-O0):
define signext i16 @f7(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = load i16, i16* %4
%8 = zext i16 %6 to i32
%9 = zext i16 %7 to i32
%10 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %8, i32 %9)
%11 = extractvalue { i32, i1 } %10, 1
%12 = extractvalue { i32, i1 } %10, 0
store i32 %12, i32* %5
%13 = zext i1 %11 to i16
ret i16 %13
}

LLVM IR (-O2):
define signext i16 @f7(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %0 to i32
%4 = zext i16 %1 to i32
%5 = tail call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %3, i32 %4)
%6 = extractvalue { i32, i1 } %5, 1
%7 = zext i1 %6 to i16
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ Execute();
int main() {
  Execute();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Execute()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Execute()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rb_htole32(int);
void create_firstfatsector(unsigned char *buf) {
  uint32_t *p = (uint32_t *)buf;
  p[0] = rb_htole32(0x0ffffff8);
  p[1] = rb_htole32(0x0fffffff);
  p[2] = rb_htole32(0x0fffffff);
}


x86 assembly (clang, -O0):
<create_firstfatsector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0xffffff8,%edi
call   1030 <rb_htole32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0xfffffff,%edi
call   1030 <rb_htole32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0xfffffff,%edi
call   1030 <rb_htole32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_firstfatsector>:
push   %rbx
mov    %rdi,%rbx
mov    $0xffffff8,%edi
call   1030 <rb_htole32@plt>
mov    %eax,(%rbx)
mov    $0xfffffff,%edi
call   1030 <rb_htole32@plt>
mov    %eax,0x4(%rbx)
mov    $0xfffffff,%edi
call   1030 <rb_htole32@plt>
mov    %eax,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @create_firstfatsector(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = call i32 @rb_htole32(i32 268435448)
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = call i32 @rb_htole32(i32 268435455)
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
%12 = call i32 @rb_htole32(i32 268435455)
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 2
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @create_firstfatsector(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @rb_htole32(i32 268435448)
store i32 %3, i32* %2
%4 = tail call i32 @rb_htole32(i32 268435455)
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = tail call i32 @rb_htole32(i32 268435455)
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}
void do_setecho(void) {}


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

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

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

LLVM IR (-O2):
define void @do_setecho() {
ret void
}
char cmp(void *a, void *b) { return a == b; }


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

x86 assembly (clang, -O2):
<cmp>:
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define signext i8 @cmp(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @cmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int safe_mod_func_int32_t_s_s(int, int);
int main() {
  int a, b;
  a = 1;
  b = -2;
  int x = safe_mod_func_int32_t_s_s(a, b);
  assert(x == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xfffffffe,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <safe_mod_func_int32_t_s_s@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1040 <safe_mod_func_int32_t_s_s@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
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 1, i32* %2
store i32 -2, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @safe_mod_func_int32_t_s_s(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @safe_mod_func_int32_t_s_s(i32 1, i32 -2)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ wrap_malloc(int **);
void call_no_return_good() {
  int *x = NULL;
  wrap_malloc(&x);
  *x = 5;
  free(x);
}


x86 assembly (clang, -O0):
<call_no_return_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <wrap_malloc@plt>
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_no_return_good>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1040 <wrap_malloc@plt>
mov    (%rsp),%rdi
movl   $0x5,(%rdi)
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @call_no_return_good() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i32 @wrap_malloc(i32** %1)
%3 = load i32*, i32** %1
store i32 5, i32* %3
%4 = load i32*, i32** %1
%5 = call i32 @free(i32* %4)
ret void
}

LLVM IR (-O2):
define void @call_no_return_good() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%3 = call i32 @wrap_malloc(i32** %1)
%4 = load i32*, i32** %1
store i32 5, i32* %4
%5 = call i32 @free(i32* %4)
ret void
}
int toupper(c)
int c;
{ return (islower(c) ? (c ^ 0x20) : (c)); }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     113a <toupper+0x2a>
mov    -0x4(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <toupper+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
mov    %ebx,%ecx
xor    $0x20,%ecx
test   %eax,%eax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @islower(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = xor i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i32 @islower(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = xor i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
unsigned int LIBTLV_OPT_LSZMAX(unsigned int opt) {
  unsigned int ret;
  switch (opt & 0x00000030U) {
  case 0:
    ret = 0xFF;
    break;
  case 0x00000010U:
    ret = 0xFFFF;
    break;
  case 0x00000020U:
    ret = (1U << 28) - 1;
    break;
  default:
    ret = 0;
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<LIBTLV_OPT_LSZMAX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x30,%eax
mov    %eax,-0xc(%rbp)
je     113d <LIBTLV_OPT_LSZMAX+0x3d>
jmp    111b <LIBTLV_OPT_LSZMAX+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
je     1149 <LIBTLV_OPT_LSZMAX+0x49>
jmp    112c <LIBTLV_OPT_LSZMAX+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1155 <LIBTLV_OPT_LSZMAX+0x55>
jmp    1161 <LIBTLV_OPT_LSZMAX+0x61>
movl   $0xff,-0x8(%rbp)
jmp    1168 <LIBTLV_OPT_LSZMAX+0x68>
movl   $0xffff,-0x8(%rbp)
jmp    1168 <LIBTLV_OPT_LSZMAX+0x68>
movl   $0xfffffff,-0x8(%rbp)
jmp    1168 <LIBTLV_OPT_LSZMAX+0x68>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LIBTLV_OPT_LSZMAX>:
and    $0x30,%edi
je     1115 <LIBTLV_OPT_LSZMAX+0x15>
cmp    $0x20,%edi
je     111b <LIBTLV_OPT_LSZMAX+0x1b>
cmp    $0x10,%edi
jne    1121 <LIBTLV_OPT_LSZMAX+0x21>
mov    $0xffff,%eax
ret
mov    $0xff,%eax
ret
mov    $0xfffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @LIBTLV_OPT_LSZMAX(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 48
switch i32 %5, label %9 [
i32 0, label %6
i32 16, label %7
i32 32, label %8
]
6: ; preds = %1
store i32 255, i32* %3
br label %10
7: ; preds = %1
store i32 65535, i32* %3
br label %10
8: ; preds = %1
store i32 268435455, i32* %3
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @LIBTLV_OPT_LSZMAX(i32 %0) {
%2 = and i32 %0, 48
switch i32 %2, label %5 [
i32 0, label %6
i32 16, label %3
i32 32, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 0, %5 ], [ 268435455, %4 ], [ 65535, %3 ], [ 255, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void AONEventRtcSet(uint32_t ui32EventSrc) {
  uint32_t ui32Ctrl;
  ;
  ui32Ctrl = (*((volatile unsigned long *)(0x40093000 + 0x0000000C)));
  ui32Ctrl &= ~(0x0000003F);
  ui32Ctrl |= (ui32EventSrc & 0x3f) << 0;
  (*((volatile unsigned long *)(0x40093000 + 0x0000000C))) = ui32Ctrl;
}


x86 assembly (clang, -O0):
<AONEventRtcSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x4009300c,%eax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffffc0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
shl    $0x0,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    $0x4009300c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONEventRtcSet>:
mov    0x4009300c,%rax
40
and    $0xffffffc0,%eax
and    $0x3f,%edi
or     %eax,%edi
movslq %edi,%rax
mov    %rax,0x4009300c
40
ret

LLVM IR (-O0):
define void @AONEventRtcSet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load volatile i64, i64* inttoptr (i64 1074343948 to i64*)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, -64
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = and i32 %8, 63
%10 = shl i32 %9, 0
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
store volatile i64 %14, i64* inttoptr (i64 1074343948 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONEventRtcSet(i32 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074343948 to i64*)
%3 = trunc i64 %2 to i32
%4 = and i32 %3, -64
%5 = and i32 %0, 63
%6 = or i32 %4, %5
%7 = sext i32 %6 to i64
store volatile i64 %7, i64* inttoptr (i64 1074343948 to i64*)
ret void
}
int sRound(float number) {
  return (number >= 0) ? (int)(number + 0.5) : (int)(number - 0.5);
}


x86 assembly (clang, -O0):
<sRound>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113b <sRound+0x3b>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <sRound+0x57>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb4(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sRound>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setb   %al
cvtss2sd %xmm0,%xmm0
lea    0xeea(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @sRound(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
br label %15
10: ; preds = %1
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fsub double %12, 5.000000e-01
%14 = fptosi double %13 to i32
br label %15
15: ; preds = %10, %5
%16 = phi i32 [ %9, %5 ], [ %14, %10 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @sRound(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = fpext float %0 to double
%4 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%5 = fadd double %4, %3
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  printf("%ld\n", (long)time(NULL));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @time(i32* null)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mainloop();
int /*<<< orphan*/ printf(char *, int);
void *threadCode(void *argument) {
  int tid;
  tid = *((int *)argument);
  printf("Thread %d has started.\n", tid);
  mainloop();
  return NULL;
}


x86 assembly (clang, -O0):
<threadCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <mainloop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Thread %d has started.\0A\00"
define i8* @threadCode(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @mainloop()
ret i8* null
}

LLVM IR (-O2):
@.str = [24 x i8] c"Thread %d has started.\0A\00"
define noalias i8* @threadCode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @mainloop()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SHR_W_IMM(int reg, int count) {
  addbyte(0x66);
  addbyte(0xc1);
  addbyte(0xc0 | reg | 0x28);
  addbyte(count);
}


x86 assembly (clang, -O0):
<SHR_W_IMM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x28,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHR_W_IMM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
or     $0xe8,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SHR_W_IMM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 193)
%7 = load i32, i32* %3
%8 = or i32 192, %7
%9 = or i32 %8, 40
%10 = call i32 @addbyte(i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @addbyte(i32 %11)
ret void
}

LLVM IR (-O2):
define void @SHR_W_IMM(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 193)
%5 = or i32 %0, 232
%6 = tail call i32 @addbyte(i32 %5)
%7 = tail call i32 @addbyte(i32 %1)
ret void
}
/* Variables and functions */
int INT_MAX;
int INT_MIN;
int is_undefined_sub(int a, int b) {
  return (b > 0 && a < INT_MIN + b) || (b < 0 && a > INT_MAX + b);
}


x86 assembly (clang, -O0):
<is_undefined_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1130 <is_undefined_sub+0x30>
mov    -0x4(%rbp),%ecx
mov    0x2ec2(%rip),%rax
mov    (%rax),%edx
add    -0x8(%rbp),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jl     115c <is_undefined_sub+0x5c>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xa(%rbp)
jge    1156 <is_undefined_sub+0x56>
mov    -0x4(%rbp),%eax
mov    0x2e9f(%rip),%rcx
mov    (%rcx),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_undefined_sub>:
test   %esi,%esi
jle    1116 <is_undefined_sub+0x16>
mov    0x2ed5(%rip),%rax
add    (%rax),%esi
cmp    %edi,%esi
setg   %al
movzbl %al,%eax
ret
js     111e <is_undefined_sub+0x1e>
xor    %eax,%eax
movzbl %al,%eax
ret
mov    0x2ec3(%rip),%rax
add    (%rax),%esi
cmp    %edi,%esi
setl   %al
movzbl %al,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
define i32 @is_undefined_sub(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* @INT_MIN
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = icmp slt i32 %8, %11
br i1 %12, label %24, label %13
13: ; preds = %7, %2
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load i32, i32* %3
%18 = load i32, i32* @INT_MAX
%19 = load i32, i32* %4
%20 = add nsw i32 %18, %19
%21 = icmp sgt i32 %17, %20
br label %22
22: ; preds = %16, %13
%23 = phi i1 [ false, %13 ], [ %21, %16 ]
br label %24
24: ; preds = %22, %7
%25 = phi i1 [ true, %7 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
define i32 @is_undefined_sub(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @INT_MIN
%6 = add nsw i32 %5, %1
%7 = icmp sgt i32 %6, %0
br label %14
8: ; preds = %2
%9 = icmp slt i32 %1, 0
br i1 %9, label %10, label %14
10: ; preds = %8
%11 = load i32, i32* @INT_MAX
%12 = add nsw i32 %11, %1
%13 = icmp slt i32 %12, %0
br label %14
14: ; preds = %4, %8, %10
%15 = phi i1 [ false, %8 ], [ %13, %10 ], [ %7, %4 ]
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G131_f(char *s) {
  debug("G131_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G131_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G131_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"G131_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G131_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"G131_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G131_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ send_to_rsocket(int /*<<< orphan*/, void *,
                                   int /*<<< orphan*/, int);
int64_t send_to_socket_delayconfirm(int64_t s, void *data, int64_t length) {
  return send_to_rsocket(s, data, length, 2);
}


x86 assembly (clang, -O0):
<send_to_socket_delayconfirm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x2,%ecx
call   1030 <send_to_rsocket@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_to_socket_delayconfirm>:
mov    $0x2,%ecx
jmp    1030 <send_to_rsocket@plt>

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

LLVM IR (-O2):
define i32 @send_to_socket_delayconfirm(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send_to_rsocket(i32 %0, i8* %1, i32 %2, i32 2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_sqrt_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_sqrt_sd(__m128d A, __m128d B) { return _mm_sqrt_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sqrt_sd>:
jmp    1030 <_mm_sqrt_sd@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, void **,
                                  int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_RSA_PUBLIC;
scalar_t__ d2i_RSAPublicKey;
RSA *PEM_read_RSAPublicKey(FILE *fp, RSA **x, pem_password_cb *cb, void *u) {
  return PEM_ASN1_read((d2i_of_void *)d2i_RSAPublicKey, PEM_STRING_RSA_PUBLIC,
                       fp, (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_RSAPublicKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_RSAPublicKey>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read@plt>

LLVM IR (-O0):
@d2i_RSAPublicKey = global i64 0
@PEM_STRING_RSA_PUBLIC = global i32 0
define i32* @PEM_read_RSAPublicKey(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_RSAPublicKey
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_RSA_PUBLIC
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_RSAPublicKey = global i64 0
@PEM_STRING_RSA_PUBLIC = global i32 0
define i32* @PEM_read_RSAPublicKey(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_RSAPublicKey
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_RSA_PUBLIC
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
/* Variables and functions */
unsigned long my_nibble_sort_word(unsigned long);
void nibble_sort_robin(unsigned long *buf) {
  for (int i = 0; i < 1024; i++) {
    buf[i] = my_nibble_sort_word(buf[i]);
  }
}


x86 assembly (clang, -O0):
<nibble_sort_robin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    115e <nibble_sort_robin+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <my_nibble_sort_word@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <nibble_sort_robin+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_robin>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <my_nibble_sort_word@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1120 <nibble_sort_robin+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @nibble_sort_robin(i64* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = tail call i64 @my_nibble_sort_word(i64 %6)
store i64 %7, i64* %5
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 1024
br i1 %9, label %2, label %3
}
/* Variables and functions */
int **alloc2d(int, int);
int /*<<< orphan*/ dealloc2d(int **, int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printArray(int **, int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int **p = alloc2d(4, 5);
  printArray(p, 4, 5);
  dealloc2d(p, 4, 5);
  printf("Press any key to exit...");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x5,%esi
call   1040 <alloc2d@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x5,%edx
call   1070 <printArray@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x5,%edx
call   1030 <dealloc2d@plt>
lea    0xe61(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
mov    $0x5,%esi
call   1040 <alloc2d@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
call   1070 <printArray@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
call   1030 <dealloc2d@plt>
lea    0xe72(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Press any key to exit...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
store i32 0, i32* %1
%3 = call i32** @alloc2d(i32 4, i32 5)
store i32** %3, i32*** %2
%4 = load i32**, i32*** %2
%5 = call i32 @printArray(i32** %4, i32 4, i32 5)
%6 = load i32**, i32*** %2
%7 = call i32 @dealloc2d(i32** %6, i32 4, i32 5)
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Press any key to exit...\00"
define i32 @main() {
%1 = tail call i32** @alloc2d(i32 4, i32 5)
%2 = tail call i32 @printArray(i32** %1, i32 4, i32 5)
%3 = tail call i32 @dealloc2d(i32** %1, i32 4, i32 5)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @getchar()
ret i32 0
}