#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ Ident(int *);
void __attribute__((no))
large_alignment_untagging(int num, int *retval, int **big, int **other) {
  int other_array[100] __attribute__((aligned(32)));
  int big_array[100] __attribute__((aligned(32)));
  *retval = big_array[num] + other_array[num];
  *big = (int *)Ident(big_array);
  *other = (int *)Ident(other_array);
}


x86 assembly (clang, -O0):
<large_alignment_untagging>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffffe0,%rsp
sub    $0x360,%rsp
mov    %edi,0x34c(%rsp)
mov    %rsi,0x340(%rsp)
mov    %rdx,0x338(%rsp)
mov    %rcx,0x330(%rsp)
movslq 0x34c(%rsp),%rax
mov    (%rsp,%rax,4),%ecx
movslq 0x34c(%rsp),%rax
add    0x1a0(%rsp,%rax,4),%ecx
mov    0x340(%rsp),%rax
mov    %ecx,(%rax)
mov    %rsp,%rdi
call   1030 <Ident@plt>
mov    %rax,%rcx
mov    0x338(%rsp),%rax
mov    %rcx,(%rax)
lea    0x1a0(%rsp),%rdi
call   1030 <Ident@plt>
mov    %rax,%rcx
mov    0x330(%rsp),%rax
mov    %rcx,(%rax)
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<large_alignment_untagging>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
and    $0xffffffffffffffe0,%rsp
sub    $0x340,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsp,%rdi
call   1030 <Ident@plt>
mov    %rax,(%rbx)
lea    0x1a0(%rsp),%rdi
call   1030 <Ident@plt>
mov    %rax,(%r14)
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @large_alignment_untagging(i32 %0, i32* %1, i32** %2, i32** %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32**
%8 = alloca i32**
%9 = alloca [100 x i32]
%10 = alloca [100 x i32]
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32** %2, i32*** %7
store i32** %3, i32*** %8
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %10, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %9, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = add nsw i32 %14, %18
%20 = load i32*, i32** %6
store i32 %19, i32* %20
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %10, i64 0, i64 0
%22 = call i64 @Ident(i32* %21)
%23 = inttoptr i64 %22 to i32*
%24 = load i32**, i32*** %7
store i32* %23, i32** %24
%25 = getelementptr inbounds [100 x i32], [100 x i32]* %9, i64 0, i64 0
%26 = call i64 @Ident(i32* %25)
%27 = inttoptr i64 %26 to i32*
%28 = load i32**, i32*** %8
store i32* %27, i32** %28
ret void
}

LLVM IR (-O2):
define void @large_alignment_untagging(i32 %0, i32* nocapture writeonly %1, i32** nocapture writeonly %2, i32** nocapture writeonly %3) {
%5 = alloca [100 x i32]
%6 = alloca [100 x i32]
%7 = bitcast [100 x i32]* %5 to i8*
%8 = bitcast [100 x i32]* %6 to i8*
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%10 = call i64 @Ident(i32* %9)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %2
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%13 = call i64 @Ident(i32* %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %3
ret void
}