xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
typedef unsigned long *sigjmp_buf;
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ longjmp(void *, int);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void siglongjmp(sigjmp_buf buf, int ret) {
  unsigned long *flag = buf + sizeof(jmp_buf) / sizeof(long);
  sigset_t *mask = (void *)(flag + 1);
  if (*flag)
    sigprocmask(SIG_SETMASK, mask, NULL);
  longjmp((void *)buf, ret);
}


x86 assembly (clang, -O0):
<siglongjmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1167 <siglongjmp+0x47>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <longjmp@plt>

x86 assembly (clang, -O2):
<siglongjmp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
cmpq   $0x0,(%rdi)
je     1142 <siglongjmp+0x22>
lea    0x8(%rbx),%rsi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <longjmp@plt>

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
define void @siglongjmp(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i64*
%6 = alloca i32*
store i64* %0, i64** %3
store i32 %1, i32* %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
store i64* %8, i64** %5
%9 = load i64*, i64** %5
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = bitcast i64* %10 to i8*
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %6
%13 = load i64*, i64** %5
%14 = load i64, i64* %13
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load i32, i32* @SIG_SETMASK
%18 = load i32*, i32** %6
%19 = call i32 @sigprocmask(i32 %17, i32* %18, i32* null)
br label %20
20: ; preds = %16, %2
%21 = load i64*, i64** %3
%22 = bitcast i64* %21 to i8*
%23 = load i32, i32* %4
%24 = call i32 @longjmp(i8* %22, i32 %23)
unreachable
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
define void @siglongjmp(i64* %0, i32 %1) {
%3 = load i64, i64* %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i64, i64* %0, i64 1
%7 = bitcast i64* %6 to i32*
%8 = load i32, i32* @SIG_SETMASK
%9 = tail call i32 @sigprocmask(i32 %8, i32* %7, i32* null)
br label %10
10: ; preds = %5, %2
%11 = bitcast i64* %0 to i8*
%12 = tail call i32 @longjmp(i8* %11, i32 %1)
unreachable
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int /*<<< orphan*/);
int getopt_long(int argc, char *const *argv, const char *optstring,
                const struct option *longopts, int *indexptr) {
  return _getopt_internal(argc, argv, optstring, longopts, indexptr, 0);
}


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

x86 assembly (clang, -O2):
<getopt_long>:
xor    %r9d,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int main() {
  test1();
  test2();
  printf("ALL TESTS PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test1@plt>
mov    $0x0,%al
call   1050 <test2@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1050 <test2@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"ALL TESTS PASS\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2()
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"ALL TESTS PASS\00"
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void RTTcpSelectOneEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpSelectOneEx() {
ret void
}
/* Variables and functions */
scalar_t__ ft_strncmp(char const *, char const *, size_t);
int ft_strnequ(char const *s1, char const *s2, size_t n) {
  if (!s1 || !s2)
    return (0);
  return (ft_strncmp(s1, s2, n) == 0 ? 1 : 0);
}


x86 assembly (clang, -O0):
<ft_strnequ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <ft_strnequ+0x2a>
cmpq   $0x0,-0x18(%rbp)
jne    1146 <ft_strnequ+0x36>
movl   $0x0,-0x4(%rbp)
jmp    116b <ft_strnequ+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <ft_strncmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnequ>:
xor    %eax,%eax
test   %rdi,%rdi
je     1131 <ft_strnequ+0x21>
test   %rsi,%rsi
je     1131 <ft_strnequ+0x21>
push   %rax
call   1030 <ft_strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @ft_strnequ(i8* %0, i8* %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = tail call i64 @ft_strncmp(i8* %0, i8* %1, i64 %2)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %10, %7 ], [ 0, %3 ]
ret i32 %12
}
ISR(TIMER3_CAPT_vect) {
  DEBUG("ISR "
        "TIMER3_CAPT"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"ISR TIMER3_CAPT occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [24 x i8] c"ISR TIMER3_CAPT occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int bbm_hostif_deselect(void *);
int bbm_com_hostif_deselect(void *handle) {
  int res = 1;
  res = bbm_hostif_deselect(handle);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_hostif_deselect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bbm_hostif_deselect@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_hostif_deselect>:
jmp    1030 <bbm_hostif_deselect@plt>

LLVM IR (-O0):
define i32 @bbm_com_hostif_deselect(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @bbm_hostif_deselect(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @bbm_com_hostif_deselect(i8* %0) {
%2 = tail call i32 @bbm_hostif_deselect(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int read(int, void *, size_t);
ssize_t sock_read(int s, void *buf, size_t size) {
  ssize_t nbytes;
again:
  nbytes = read(s, buf, size);
  if (nbytes == -1 && errno == EINTR)
    goto again;
  return (nbytes);
}


x86 assembly (clang, -O0):
<sock_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    115f <sock_read+0x4f>
mov    0x2e99(%rip),%rax
mov    (%rax),%rax
mov    0x2e87(%rip),%rcx
cmp    (%rcx),%rax
jne    115f <sock_read+0x4f>
jmp    1123 <sock_read+0x13>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_read>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
jne    114b <sock_read+0x3b>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <sock_read+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @sock_read(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %7, %4
ret i32 %5
}
void c_source_minus_foo_a_encode_inner(
    struct encoder_t *encoder_p, const struct c_source_minus_foo_a_t *src_p) {
  (void)encoder_p;
  (void)src_p;
}


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

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

LLVM IR (-O0):
%struct.encoder_t = type opaque
%struct.c_source_minus_foo_a_t = type opaque
define void @c_source_minus_foo_a_encode_inner(%struct.encoder_t* %0, %struct.c_source_minus_foo_a_t* %1) {
%3 = alloca %struct.encoder_t*
%4 = alloca %struct.c_source_minus_foo_a_t*
store %struct.encoder_t* %0, %struct.encoder_t** %3
store %struct.c_source_minus_foo_a_t* %1, %struct.c_source_minus_foo_a_t** %4
%5 = load %struct.encoder_t*, %struct.encoder_t** %3
%6 = load %struct.c_source_minus_foo_a_t*, %struct.c_source_minus_foo_a_t** %4
ret void
}

LLVM IR (-O2):
%struct.encoder_t = type opaque
%struct.c_source_minus_foo_a_t = type opaque
define void @c_source_minus_foo_a_encode_inner(%struct.encoder_t* nocapture %0, %struct.c_source_minus_foo_a_t* nocapture %1) {
ret void
}
int is2ByteStarter(unsigned char c) { return c >= 192 && c < 224; }


x86 assembly (clang, -O0):
<is2ByteStarter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xc0,%ecx
mov    %al,-0x2(%rbp)
jl     112e <is2ByteStarter+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0xe0,%eax
setl   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is2ByteStarter>:
and    $0xe0,%dil
xor    %eax,%eax
cmp    $0xc0,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is2ByteStarter(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 192
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %8, 224
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is2ByteStarter(i8 zeroext %0) {
%2 = and i8 %0, -32
%3 = icmp eq i8 %2, -64
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void add_reg32_reg32(unsigned int reg1, unsigned int reg2) {
  put8(0x01);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<add_reg32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_reg32_reg32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @add_reg32_reg32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 1)
%6 = load i32, i32* %4
%7 = shl i32 %6, 3
%8 = or i32 192, %7
%9 = load i32, i32* %3
%10 = or i32 %8, %9
%11 = call i32 @put8(i32 %10)
ret void
}

LLVM IR (-O2):
define void @add_reg32_reg32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 1)
%4 = shl i32 %1, 3
%5 = or i32 %4, %0
%6 = or i32 %5, 192
%7 = tail call i32 @put8(i32 %6)
ret void
}
void cc_memory_expect_alloc_count_zero(void) { ; }


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

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

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

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

/* Variables and functions */
uint32_t prim_str_size(const char *string, uint32_t max_size) {
  for (int counter = 0; counter < max_size; counter++) {
    if (string[counter] == '\n')
      return counter + 1;
  }
  return max_size;
}


x86 assembly (clang, -O0):
<prim_str_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <prim_str_size+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1141 <prim_str_size+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <prim_str_size+0x5a>
jmp    1146 <prim_str_size+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <prim_str_size+0x12>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prim_str_size>:
mov    %esi,%eax
test   %esi,%esi
jle    111f <prim_str_size+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0xa,(%rdi,%rcx,1)
je     1120 <prim_str_size+0x20>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <prim_str_size+0x10>
ret
add    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @prim_str_size(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %14
%7 = phi i64 [ 0, %4 ], [ %15, %14 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = trunc i64 %7 to i32
%13 = add nuw nsw i32 %12, 1
br label %17
14: ; preds = %6
%15 = add nuw nsw i64 %7, 1
%16 = icmp eq i64 %15, %5
br i1 %16, label %17, label %6
17: ; preds = %14, %2, %11
%18 = phi i32 [ %13, %11 ], [ %1, %2 ], [ %1, %14 ]
ret i32 %18
}
void testDiagnosableBranchLogical(int a, int b) {
  if (a && b) {
    *(volatile int *)0 = 1;
  }
}


x86 assembly (clang, -O0):
<testDiagnosableBranchLogical>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1126 <testDiagnosableBranchLogical+0x26>
cmpl   $0x0,-0x8(%rbp)
je     1126 <testDiagnosableBranchLogical+0x26>
xor    %eax,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testDiagnosableBranchLogical>:
test   %edi,%edi
je     1113 <testDiagnosableBranchLogical+0x13>
test   %esi,%esi
je     1113 <testDiagnosableBranchLogical+0x13>
movl   $0x1,0x0
ret

LLVM IR (-O0):
define void @testDiagnosableBranchLogical(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store volatile i32 1, i32* null
br label %11
11: ; preds = %10, %7, %2
ret void
}

LLVM IR (-O2):
define void @testDiagnosableBranchLogical(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store volatile i32 1, i32* null
br label %7
7: ; preds = %6, %2
ret void
}
void setRDriveBase(int valueR) {}


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

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

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

LLVM IR (-O2):
define void @setRDriveBase(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ transfer(char *);
int main(int argc, char const *argv[]) {
  char string[256];
  printf("Input test string: ");
  fgets(string, 256, stdin);
  transfer(string);
  printf("Result: %s\n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
lea    -0x110(%rbp),%rdi
call   1050 <transfer@plt>
lea    -0x110(%rbp),%rsi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <transfer@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Input test string: \00"
@stdin = global i32 0
@.str.1 = [12 x i8] c"Result: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 256, i32 %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = call i32 @transfer(i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Input test string: \00"
@stdin = global i32 0
@.str.1 = [12 x i8] c"Result: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 256, i32 %6)
%8 = call i32 @transfer(i8* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
int bar(void) {
  unsigned short x;
  volatile unsigned short *z;
  foo(&x);
  const unsigned int y = x;
  z = &x;
  __asm __volatile("movb %b1,1(%2); movb %h1,(%2)" : "=m"(*z) : "r"(y), "r"(z));
  return (x & 1) == 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x2(%rbp),%rdi
mov    $0x0,%al
call   1030 <foo@plt>
movzwl -0x2(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rdx
mov    %cl,0x1(%rdx)
mov    %ch,(%rdx)
movzwl -0x2(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
sub    $0x10,%rsp
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <foo@plt>
movzwl 0xe(%rsp),%eax
mov    %al,0x1(%rbx)
mov    %ah,(%rbx)
movzwl 0xe(%rsp),%eax
not    %eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i16
%2 = alloca i16*
%3 = alloca i32
%4 = call i32 (i16*, ...) bitcast (i32 (...)* @foo to i32 (i16*, ...)*)(i16* %1)
%5 = load i16, i16* %1
%6 = zext i16 %5 to i32
store i32 %6, i32* %3
store i16* %1, i16** %2
%7 = load i16*, i16** %2
%8 = load i32, i32* %3
%9 = load i16*, i16** %2
%10 = load i16, i16* %1
%11 = zext i16 %10 to i32
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @bar() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = call i32 (i16*, ...) bitcast (i32 (...)* @foo to i32 (i16*, ...)*)(i16* %1)
%4 = load i16, i16* %1
%5 = zext i16 %4 to i32
%6 = load i16, i16* %1
%7 = and i16 %6, 1
%8 = xor i16 %7, 1
%9 = zext i16 %8 to i32
ret i32 %9
}
__attribute__((weak)) void __hlt_globals_dtor(void *ctx) {}


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

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

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

LLVM IR (-O2):
define weak void @__hlt_globals_dtor(i8* %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int solve_me_first(int, int);
int main() {
  int num1, num2;
  scanf("%d %d", &num1, &num2);
  int sum = solve_me_first(num1, num2);
  printf("%d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <solve_me_first@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <solve_me_first@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @solve_me_first(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int **);
int main(void) {
  int a[5] = {0};
  int(*b)[5] = &a;
  f(5, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
mov    $0x5,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]*
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store [5 x i32]* %2, [5 x i32]** %3
%5 = load [5 x i32]*, [5 x i32]** %3
%6 = bitcast [5 x i32]* %5 to i32**
%7 = call i32 @f(i32 5, i32** %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = bitcast [5 x i32]* %1 to i32**
%4 = call i32 @f(i32 5, i32** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void dup() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @dup() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_process_flag(int);
void set_security(void) { set_process_flag(0x4281); }


x86 assembly (clang, -O0):
<set_security>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4281,%edi
call   1030 <set_process_flag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_security>:
mov    $0x4281,%edi
jmp    1030 <set_process_flag@plt>

LLVM IR (-O0):
define void @set_security() {
%1 = call i32 @set_process_flag(i32 17025)
ret void
}

LLVM IR (-O2):
define void @set_security() {
%1 = tail call i32 @set_process_flag(i32 17025)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void Visit(int x) { printf("%d ", x); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @Visit(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void dummy_linewidth(int width) { width = width; }


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

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

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

LLVM IR (-O2):
define void @dummy_linewidth(i32 %0) {
ret void
}
/* Variables and functions */
size_t zmin(size_t a, size_t b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<zmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <zmin+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <zmin+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @zmin(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @zmin(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int VIM_HIF_GetReg16(unsigned long);
unsigned long VIM_HIF_GetReg32(unsigned long adr) {
  unsigned long byValue = 0;
  byValue = VIM_HIF_GetReg16(adr);
  byValue |= (VIM_HIF_GetReg16(adr + 0x02) << 16);
  return byValue;
}


x86 assembly (clang, -O0):
<VIM_HIF_GetReg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <VIM_HIF_GetReg16@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <VIM_HIF_GetReg16@plt>
shl    $0x10,%eax
cltq
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_HIF_GetReg32>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <VIM_HIF_GetReg16@plt>
mov    %eax,%ebp
add    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <VIM_HIF_GetReg16@plt>
shl    $0x10,%eax
or     %ebp,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @VIM_HIF_GetReg32(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = call i32 @VIM_HIF_GetReg16(i64 %4)
%6 = sext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = add i64 %7, 2
%9 = call i32 @VIM_HIF_GetReg16(i64 %8)
%10 = shl i32 %9, 16
%11 = sext i32 %10 to i64
%12 = load i64, i64* %3
%13 = or i64 %12, %11
store i64 %13, i64* %3
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @VIM_HIF_GetReg32(i64 %0) {
%2 = tail call i32 @VIM_HIF_GetReg16(i64 %0)
%3 = add i64 %0, 2
%4 = tail call i32 @VIM_HIF_GetReg16(i64 %3)
%5 = shl i32 %4, 16
%6 = or i32 %5, %2
%7 = sext i32 %6 to i64
ret i64 %7
}
double reg_poly_is_left(double x1, double y1, double x2, double y2, double x,
                        double y) {
  double ret = ((x2 - x1) * (y - y1) - (x - x1) * (y2 - y1));
  return ret;
}


x86 assembly (clang, -O0):
<reg_poly_is_left>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_poly_is_left>:
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm5
mulsd  %xmm2,%xmm5
subsd  %xmm0,%xmm4
subsd  %xmm1,%xmm3
mulsd  %xmm4,%xmm3
subsd  %xmm3,%xmm5
movapd %xmm5,%xmm0
ret

LLVM IR (-O0):
define double @reg_poly_is_left(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%14 = load double, double* %9
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = load double, double* %12
%18 = load double, double* %8
%19 = fsub double %17, %18
%20 = load double, double* %11
%21 = load double, double* %7
%22 = fsub double %20, %21
%23 = load double, double* %10
%24 = load double, double* %8
%25 = fsub double %23, %24
%26 = fmul double %22, %25
%27 = fneg double %26
%28 = call double @llvm.fmuladd.f64(double %16, double %19, double %27)
store double %28, double* %13
%29 = load double, double* %13
ret double %29
}

LLVM IR (-O2):
define double @reg_poly_is_left(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %2, %0
%8 = fsub double %5, %1
%9 = fsub double %4, %0
%10 = fsub double %3, %1
%11 = fneg double %9
%12 = fmul double %10, %11
%13 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %12)
ret double %13
}
void ScalePlane_16() {}


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

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

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

LLVM IR (-O2):
define void @ScalePlane_16() {
ret void
}
/* Type definitions */
struct oarchive {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int oa_serialize_int(struct oarchive *, char const *,
                     int /*<<< orphan*/ const *);
int oa_start_vector(struct oarchive *oa, const char *tag,
                    const int32_t *count) {
  return oa_serialize_int(oa, tag, count);
}


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

x86 assembly (clang, -O2):
<oa_start_vector>:
jmp    1030 <oa_serialize_int@plt>

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

LLVM IR (-O2):
%struct.oarchive = type { i32 }
define i32 @oa_start_vector(%struct.oarchive* %0, i8* %1, i32* %2) {
%4 = tail call i32 @oa_serialize_int(%struct.oarchive* %0, i8* %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ UNREFERENCED_PARAMETER(int);
char *ILibTURN_GetTransactionID(char *buffer, int offset, int length) {
  UNREFERENCED_PARAMETER(length);
  return (buffer + offset + 8);
}


x86 assembly (clang, -O0):
<ILibTURN_GetTransactionID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <UNREFERENCED_PARAMETER@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibTURN_GetTransactionID>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %edx,%edi
call   1030 <UNREFERENCED_PARAMETER@plt>
movslq %ebx,%rax
add    %r14,%rax
add    $0x8,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ILibTURN_GetTransactionID(i8* readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @UNREFERENCED_PARAMETER(i32 %2)
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 8
ret i8* %7
}
A0RX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*((unsigned int *)10000000)) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<A0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x989680,%eax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     113c <A0RX1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <A0RX1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0RX1>:
mov    0x989680,%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @A0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* inttoptr (i64 10000000 to i32*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = icmp ule i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void unused(void) { bar(); }


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

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

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

LLVM IR (-O2):
define void @unused() {
%1 = tail call i32 (...) @bar()
ret void
}
int schart_pos(int *pos, int pos1, int pos2, int val1, int val2, int val) {
  if (val1 == val2) {
    *pos = 0;
  } else {
    *pos = (((pos2 - pos1) * (val - val1)) / (val2 - val1)) + pos1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<schart_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1134 <schart_pos+0x34>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    1157 <schart_pos+0x57>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    -0x14(%rbp),%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
add    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<schart_pos>:
xor    %eax,%eax
sub    %ecx,%r8d
je     1119 <schart_pos+0x19>
sub    %esi,%edx
sub    %ecx,%r9d
imul   %edx,%r9d
mov    %r9d,%eax
cltd
idiv   %r8d
add    %esi,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @schart_pos(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp eq i32 %4, %3
br i1 %7, label %15, label %8
8: ; preds = %6
%9 = sub nsw i32 %2, %1
%10 = sub nsw i32 %5, %3
%11 = mul nsw i32 %10, %9
%12 = sub nsw i32 %4, %3
%13 = sdiv i32 %11, %12
%14 = add nsw i32 %13, %1
br label %15
15: ; preds = %6, %8
%16 = phi i32 [ %14, %8 ], [ 0, %6 ]
store i32 %16, i32* %0
ret i32 0
}
void pcp_print_psimem_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_psimem_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_psimem_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
float time(float a, float b) { return a * b; }


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @time(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @time(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
int *return_int_arr() {
  int int_arr[] = {9, 1, 3};
  return int_arr;
}


x86 assembly (clang, -O0):
<return_int_arr>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xef3(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_int_arr>:
lea    -0xc(%rsp),%rax
ret

LLVM IR (-O0):
@__const.return_int_arr.int_arr = [3 x i32] [i32 9, i32 1, i32 3]
define i32* @return_int_arr() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
ret i32* %3
}

LLVM IR (-O2):
define noalias i32* @return_int_arr() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
ret i32* %3
}
/* Variables and functions */
long long _mm_tzcnt_64(unsigned long long);
long long test_mm_tzcnt_64(unsigned long long __X) { return _mm_tzcnt_64(__X); }


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

x86 assembly (clang, -O2):
<test_mm_tzcnt_64>:
jmp    1030 <_mm_tzcnt_64@plt>

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

LLVM IR (-O2):
define i64 @test_mm_tzcnt_64(i64 %0) {
%2 = tail call i64 @_mm_tzcnt_64(i64 %0)
ret i64 %2
}