#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 */
int /*<<< orphan*/ errPointer(int);
char *malloc(int);
char *init_both(char *v) {
  int i = 0, bck = 0;
  v = malloc((26 + 26) * sizeof(char));
  if (v == NULL)
    errPointer(-1);
  for (i = 0; i < 26; i++)
    v[i] = 'A' + i;
  bck = i;
  for (i = 0; i < 26; i++, bck++)
    v[bck] = 'a' + i;
  return v;
}


x86 assembly (clang, -O0):
<init_both>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x34,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115d <init_both+0x3d>
mov    $0xffffffff,%edi
call   1040 <errPointer@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1a,-0xc(%rbp)
jge    118f <init_both+0x6f>
mov    -0xc(%rbp),%eax
add    $0x41,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <init_both+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1a,-0xc(%rbp)
jge    11d0 <init_both+0xb0>
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119c <init_both+0x7c>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_both>:
push   %rbx
mov    $0x34,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113d <init_both+0x1d>
mov    $0xffffffff,%edi
call   1040 <errPointer@plt>
movaps 0xebc(%rip),%xmm0
movups %xmm0,(%rbx)
movaps 0xec2(%rip),%xmm0
movups %xmm0,0x10(%rbx)
movaps 0xec7(%rip),%xmm0
movups %xmm0,0x20(%rbx)
movl   $0x7a797877,0x30(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @init_both(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i8* @malloc(i32 52)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @errPointer(i32 -1)
br label %10
10: ; preds = %8, %1
store i32 0, i32* %3
br label %11
11: ; preds = %22, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 26
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 65, %15
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
br label %22
22: ; preds = %14
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %11
25: ; preds = %11
%26 = load i32, i32* %3
store i32 %26, i32* %4
store i32 0, i32* %3
br label %27
27: ; preds = %38, %25
%28 = load i32, i32* %3
%29 = icmp slt i32 %28, 26
br i1 %29, label %30, label %43
30: ; preds = %27
%31 = load i32, i32* %3
%32 = add nsw i32 97, %31
%33 = trunc i32 %32 to i8
%34 = load i8*, i8** %2
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
store i8 %33, i8* %37
br label %38
38: ; preds = %30
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %27
43: ; preds = %27
%44 = load i8*, i8** %2
ret i8* %44
}

LLVM IR (-O2):
define noalias i8* @init_both(i8* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(52) i8* @malloc(i32 52)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errPointer(i32 -1)
br label %6
6: ; preds = %4, %1
%7 = bitcast i8* %2 to <16 x i8>*
store <16 x i8> <i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79, i8 80>, <16 x i8>* %7
%8 = getelementptr inbounds i8, i8* %2, i64 16
%9 = bitcast i8* %8 to <16 x i8>*
store <16 x i8> <i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 97, i8 98, i8 99, i8 100, i8 101, i8 102>, <16 x i8>* %9
%10 = getelementptr inbounds i8, i8* %2, i64 32
%11 = bitcast i8* %10 to <16 x i8>*
store <16 x i8> <i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111, i8 112, i8 113, i8 114, i8 115, i8 116, i8 117, i8 118>, <16 x i8>* %11
%12 = getelementptr inbounds i8, i8* %2, i64 48
store i8 119, i8* %12
%13 = getelementptr inbounds i8, i8* %2, i64 49
store i8 120, i8* %13
%14 = getelementptr inbounds i8, i8* %2, i64 50
store i8 121, i8* %14
%15 = getelementptr inbounds i8, i8* %2, i64 51
store i8 122, i8* %15
ret i8* %2
}