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


x86 assembly (clang, -O0):
<init_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x1a,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <init_up+0x36>
mov    $0xffffffff,%edi
call   1040 <errPointer@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1a,-0xc(%rbp)
jge    1188 <init_up+0x68>
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    115d <init_up+0x3d>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_up>:
push   %rbx
mov    $0x1a,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113d <init_up+0x1d>
mov    $0xffffffff,%edi
call   1040 <errPointer@plt>
movaps 0xebc(%rip),%xmm0
movups %xmm0,(%rbx)
movabs $0x5857565554535251,%rax
56 57 58
mov    %rax,0x10(%rbx)
movw   $0x5a59,0x18(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @init_up(i8* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(26) i8* @malloc(i32 26)
%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
store i8 81, i8* %8
%9 = getelementptr inbounds i8, i8* %2, i64 17
store i8 82, i8* %9
%10 = getelementptr inbounds i8, i8* %2, i64 18
store i8 83, i8* %10
%11 = getelementptr inbounds i8, i8* %2, i64 19
store i8 84, i8* %11
%12 = getelementptr inbounds i8, i8* %2, i64 20
store i8 85, i8* %12
%13 = getelementptr inbounds i8, i8* %2, i64 21
store i8 86, i8* %13
%14 = getelementptr inbounds i8, i8* %2, i64 22
store i8 87, i8* %14
%15 = getelementptr inbounds i8, i8* %2, i64 23
store i8 88, i8* %15
%16 = getelementptr inbounds i8, i8* %2, i64 24
store i8 89, i8* %16
%17 = getelementptr inbounds i8, i8* %2, i64 25
store i8 90, i8* %17
ret i8* %2
}