#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__ control_saved(char *, int, int, char);
int /*<<< orphan*/ errPointer(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, char *);
scalar_t__ isdigit(char);
char *malloc(int);
char *realloc(char *, int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
char *insertspl(char *v, int *dim) {
  char spl[26] = {'"', '#', '$', '%', '&', '(', ')', '*', '+',
                  ',', '-', '.', '/', ':', ';', '<', '>', '=',
                  '?', '@', '[', ']', '^', '_', '`', '~'};
  int i = 0, j = 0, cnt = 0, dimsaved = 0, pos = 0, flag = 0, tmp = 0,
      tmpX = 26;
  int del[26] = {-1};
  char *saved = NULL, trash;
  saved = malloc(26 * sizeof(char));
  if (saved == NULL)
    errPointer(-22);
  for (i = 0; i < 26; i++)
    fprintf(stdout, "%d:%c  ", i, spl[i]);
  fprintf(stdout, "\n\nInsert the character's number you want to delete.\n");
  fprintf(stdout, "\nInsert 'q' when you want to end.\n\n");
  for (i = 0; i < 26; i++) {
    fprintf(stdout, "Remove n %d: ", i + 1);
    fscanf(stdin, "%1s", &trash);
    if (trash == 'q')
      break;
    if (isdigit(trash)) {
      if (control_saved(saved, dimsaved, pos, trash)) {
        del[pos] = trash - '0';
        pos++;
        dimsaved++;
        cnt++;
      } else
        fprintf(stdout, "Characters %c just removed.\n", trash);
    } else {
      fprintf(stdout, "Error: %c is not a number. Try again.\n", trash);
      i--;
    }
  }
  v = realloc(v, ((*dim) + (tmpX - cnt)) * sizeof(char));
  if (v == NULL)
    errPointer(-23);
  tmp = (*dim);
  (*dim) = (*dim) + (tmpX - cnt);
  for (i = 0; i < 26; i++) {
    flag = 0;
    for (j = 0; j < cnt && flag == 0; j++)
      if (i == del[j])
        flag = 1;
    if (flag == 0) {
      v[tmp] = spl[i];
      tmp++;
    }
  }
  free(saved);
  return v;
}


x86 assembly (clang, -O0):
<insertspl>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe56(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe53(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe50(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe4d(%rip),%ax
mov    %ax,-0x18(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x1a,-0x50(%rbp)
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x68,%edx
call   1060 <memset@plt>
movl   $0xffffffff,-0xc0(%rbp)
ff ff ff
movq   $0x0,-0xc8(%rbp)
mov    $0x1a,%edi
call   1090 <malloc@plt>
mov    %rax,-0xc8(%rbp)
cmpq   $0x0,-0xc8(%rbp)
jne    1258 <insertspl+0xc8>
mov    $0xffffffea,%edi
call   10b0 <errPointer@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x1a,-0x34(%rbp)
jge    129a <insertspl+0x10a>
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
mov    -0x34(%rbp),%edx
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%ecx
lea    0xd95(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    125f <insertspl+0xcf>
mov    0x2d37(%rip),%rax
mov    (%rax),%edi
lea    0xd78(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d20(%rip),%rax
mov    (%rax),%edi
lea    0xd96(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x1a,-0x34(%rbp)
jge    13f2 <insertspl+0x262>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
mov    -0x34(%rbp),%edx
add    $0x1,%edx
lea    0xd8c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
lea    0xd83(%rip),%rsi
lea    -0xc9(%rbp),%rdx
call   1070 <fscanf@plt>
movsbl -0xc9(%rbp),%eax
cmp    $0x71,%eax
jne    1327 <insertspl+0x197>
jmp    13f2 <insertspl+0x262>
movsbl -0xc9(%rbp),%edi
call   1050 <isdigit@plt>
cmp    $0x0,%rax
je     13b8 <insertspl+0x228>
mov    -0xc8(%rbp),%rdi
mov    -0x40(%rbp),%esi
mov    -0x44(%rbp),%edx
movsbl -0xc9(%rbp),%ecx
call   1040 <control_saved@plt>
cmp    $0x0,%rax
je     1395 <insertspl+0x205>
movsbl -0xc9(%rbp),%ecx
sub    $0x30,%ecx
movslq -0x44(%rbp),%rax
mov    %ecx,-0xc0(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13b3 <insertspl+0x223>
mov    0x2c3c(%rip),%rax
mov    (%rax),%edi
movsbl -0xc9(%rbp),%edx
lea    0xce1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13df <insertspl+0x24f>
mov    0x2c19(%rip),%rax
mov    (%rax),%edi
movsbl -0xc9(%rbp),%edx
lea    0xcdb(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    13e4 <insertspl+0x254>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12cf <insertspl+0x13f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x50(%rbp),%ecx
sub    -0x3c(%rbp),%ecx
add    %ecx,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   10a0 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    142a <insertspl+0x29a>
mov    $0xffffffe9,%edi
call   10b0 <errPointer@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x50(%rbp),%eax
sub    -0x3c(%rbp),%eax
add    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x34(%rbp)
cmpl   $0x1a,-0x34(%rbp)
jge    1501 <insertspl+0x371>
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%ecx
xor    %eax,%eax
cmp    -0x3c(%rbp),%ecx
mov    %al,-0xca(%rbp)
jge    1487 <insertspl+0x2f7>
cmpl   $0x0,-0x48(%rbp)
sete   %al
mov    %al,-0xca(%rbp)
mov    -0xca(%rbp),%al
test   $0x1,%al
jne    149a <insertspl+0x30a>
jmp    14c8 <insertspl+0x338>
mov    -0x34(%rbp),%eax
movslq -0x38(%rbp),%rcx
cmp    -0xc0(%rbp,%rcx,4),%eax
jne    14b5 <insertspl+0x325>
movl   $0x1,-0x48(%rbp)
jmp    14ba <insertspl+0x32a>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1466 <insertspl+0x2d6>
cmpl   $0x0,-0x48(%rbp)
jne    14ee <insertspl+0x35e>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    14f3 <insertspl+0x363>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    144e <insertspl+0x2be>
mov    -0xc8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertspl>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rsi,0x18(%rsp)
mov    %rdi,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movq   $0x0,0x80(%rsp)
movl   $0xffffffff,0x20(%rsp)
ff
mov    $0x1a,%edi
call   1080 <malloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
jne    11ee <insertspl+0x6e>
mov    $0xffffffea,%edi
call   10a0 <errPointer@plt>
mov    0x2de3(%rip),%rbx
lea    0xe04(%rip),%r14
lea    0xe17(%rip),%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx),%edi
movsbl 0x0(%rbp,%r14,1),%ecx
mov    %r15,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%rbp
cmp    $0x1a,%rbp
jne    1210 <insertspl+0x90>
mov    (%rbx),%edi
lea    0xdeb(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe10(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %r14d,%r14d
movl   $0x0,0x4(%rsp)
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    12a0 <insertspl+0x120>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edi
movsbl 0x3(%rsp),%edx
lea    0xe2b(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r15d,%r12d
lea    -0x1(%r15),%eax
mov    %eax,%r15d
cmp    $0x19,%r15d
mov    %r12d,%r15d
mov    %rbp,%rbx
jge    134b <insertspl+0x1cb>
mov    %rbx,%rbp
mov    (%rbx),%edi
lea    0x1(%r15),%r12d
lea    0xdcb(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
lea    0xdbf(%rip),%rsi
lea    0x3(%rsp),%rdx
call   1060 <fscanf@plt>
movzbl 0x3(%rsp),%eax
cmp    $0x71,%al
je     134b <insertspl+0x1cb>
movsbl %al,%edi
call   1050 <isdigit@plt>
test   %rax,%rax
je     1270 <insertspl+0xf0>
movsbl 0x3(%rsp),%ecx
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
mov    %r14d,%edx
call   1040 <control_saved@plt>
test   %rax,%rax
je     1330 <insertspl+0x1b0>
movsbl 0x3(%rsp),%eax
add    $0xffffffd0,%eax
movslq %r14d,%rcx
mov    %eax,0x20(%rsp,%rcx,4)
add    $0x1,%r14d
add    $0x1,%ebx
mov    %ebx,0x4(%rsp)
add    $0x1,%r13d
jmp    1290 <insertspl+0x110>
nopw   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edi
movsbl 0x3(%rsp),%edx
lea    0xd4e(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1290 <insertspl+0x110>
mov    $0x1a,%r14d
sub    %r13d,%r14d
mov    0x18(%rsp),%rbx
mov    (%rbx),%esi
add    %r14d,%esi
mov    0x10(%rsp),%rdi
call   1090 <realloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    137a <insertspl+0x1fa>
mov    $0xffffffe9,%edi
call   10a0 <errPointer@plt>
mov    (%rbx),%eax
add    %eax,%r14d
mov    %r14d,(%rbx)
movslq %r13d,%rcx
xor    %edx,%edx
lea    0xc72(%rip),%r8
jmp    13a7 <insertspl+0x227>
mov    (%rdx,%r8,1),%bl
cltq
mov    %bl,0x0(%rbp,%rax,1)
add    $0x1,%eax
add    $0x1,%rdx
cmp    $0x1a,%rdx
je     13d9 <insertspl+0x259>
test   %r13d,%r13d
jle    1390 <insertspl+0x210>
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x1c(%rsp,%rsi,4),%edi
cmp    %rcx,%rsi
jge    13d2 <insertspl+0x252>
add    $0x1,%rsi
cmp    %rdi,%rdx
jne    13c0 <insertspl+0x240>
cmp    %rdi,%rdx
jne    1390 <insertspl+0x210>
jmp    139d <insertspl+0x21d>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.insertspl.spl = [26 x i8] c"\22#$%&()*+,-./:;<>=?@[]^_`~"
@stdout = global i32 0
@.str = [8 x i8] c"%d:%c \00"
@.str.1 = [53 x i8] c"\0A\0AInsert the character's number you want to delete.\0A\00"
@.str.2 = [36 x i8] c"\0AInsert 'q' when you want to end.\0A\0A\00"
@.str.3 = [14 x i8] c"Remove n %d: \00"
@stdin = global i32 0
@.str.4 = [4 x i8] c"%1s\00"
@.str.5 = [29 x i8] c"Characters %c just removed.\0A\00"
@.str.6 = [39 x i8] c"Error: %c is not a number. Try again.\0A\00"
define i8* @insertspl(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [26 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [26 x i32]
%15 = alloca i8*
%16 = alloca i8
store i8* %0, i8** %3
store i32* %1, i32** %4
%17 = bitcast [26 x i8]* %5 to i8*
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 26, i32* %13
%18 = bitcast [26 x i32]* %14 to i8*
%19 = bitcast i8* %18 to <{ i32, [25 x i32] }>*
%20 = getelementptr inbounds <{ i32, [25 x i32] }>, <{ i32, [25 x i32] }>* %19, i32 0, i32 0
store i32 -1, i32* %20
store i8* null, i8** %15
%21 = call i8* @malloc(i32 26)
store i8* %21, i8** %15
%22 = load i8*, i8** %15
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = call i32 @errPointer(i32 -22)
br label %26
26: ; preds = %24, %2
store i32 0, i32* %6
br label %27
27: ; preds = %39, %26
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 26
br i1 %29, label %30, label %42
30: ; preds = %27
%31 = load i32, i32* @stdout
%32 = load i32, i32* %6
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [26 x i8], [26 x i8]* %5, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %37)
br label %39
39: ; preds = %30
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %27
42: ; preds = %27
%43 = load i32, i32* @stdout
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%45 = load i32, i32* @stdout
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %47
47: ; preds = %99, %42
%48 = load i32, i32* %6
%49 = icmp slt i32 %48, 26
br i1 %49, label %50, label %102
50: ; preds = %47
%51 = load i32, i32* @stdout
%52 = load i32, i32* %6
%53 = add nsw i32 %52, 1
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %53)
%55 = load i32, i32* @stdin
%56 = call i32 @fscanf(i32 %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%57 = load i8, i8* %16
%58 = sext i8 %57 to i32
%59 = icmp eq i32 %58, 113
br i1 %59, label %60, label %61
60: ; preds = %50
br label %102
61: ; preds = %50
%62 = load i8, i8* %16
%63 = call i64 @isdigit(i8 signext %62)
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %91
65: ; preds = %61
%66 = load i8*, i8** %15
%67 = load i32, i32* %9
%68 = load i32, i32* %10
%69 = load i8, i8* %16
%70 = call i64 @control_saved(i8* %66, i32 %67, i32 %68, i8 signext %69)
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %85
72: ; preds = %65
%73 = load i8, i8* %16
%74 = sext i8 %73 to i32
%75 = sub nsw i32 %74, 48
%76 = load i32, i32* %10
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [26 x i32], [26 x i32]* %14, i64 0, i64 %77
store i32 %75, i32* %78
%79 = load i32, i32* %10
%80 = add nsw i32 %79, 1
store i32 %80, i32* %10
%81 = load i32, i32* %9
%82 = add nsw i32 %81, 1
store i32 %82, i32* %9
%83 = load i32, i32* %8
%84 = add nsw i32 %83, 1
store i32 %84, i32* %8
br label %90
85: ; preds = %65
%86 = load i32, i32* @stdout
%87 = load i8, i8* %16
%88 = sext i8 %87 to i32
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %88)
br label %90
90: ; preds = %85, %72
br label %98
91: ; preds = %61
%92 = load i32, i32* @stdout
%93 = load i8, i8* %16
%94 = sext i8 %93 to i32
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %94)
%96 = load i32, i32* %6
%97 = add nsw i32 %96, -1
store i32 %97, i32* %6
br label %98
98: ; preds = %91, %90
br label %99
99: ; preds = %98
%100 = load i32, i32* %6
%101 = add nsw i32 %100, 1
store i32 %101, i32* %6
br label %47
102: ; preds = %60, %47
%103 = load i8*, i8** %3
%104 = load i32*, i32** %4
%105 = load i32, i32* %104
%106 = load i32, i32* %13
%107 = load i32, i32* %8
%108 = sub nsw i32 %106, %107
%109 = add nsw i32 %105, %108
%110 = sext i32 %109 to i64
%111 = mul i64 %110, 1
%112 = trunc i64 %111 to i32
%113 = call i8* @realloc(i8* %103, i32 %112)
store i8* %113, i8** %3
%114 = load i8*, i8** %3
%115 = icmp eq i8* %114, null
br i1 %115, label %116, label %118
116: ; preds = %102
%117 = call i32 @errPointer(i32 -23)
br label %118
118: ; preds = %116, %102
%119 = load i32*, i32** %4
%120 = load i32, i32* %119
store i32 %120, i32* %12
%121 = load i32*, i32** %4
%122 = load i32, i32* %121
%123 = load i32, i32* %13
%124 = load i32, i32* %8
%125 = sub nsw i32 %123, %124
%126 = add nsw i32 %122, %125
%127 = load i32*, i32** %4
store i32 %126, i32* %127
store i32 0, i32* %6
br label %128
128: ; preds = %168, %118
%129 = load i32, i32* %6
%130 = icmp slt i32 %129, 26
br i1 %130, label %131, label %171
131: ; preds = %128
store i32 0, i32* %11
store i32 0, i32* %7
br label %132
132: ; preds = %150, %131
%133 = load i32, i32* %7
%134 = load i32, i32* %8
%135 = icmp slt i32 %133, %134
br i1 %135, label %136, label %139
136: ; preds = %132
%137 = load i32, i32* %11
%138 = icmp eq i32 %137, 0
br label %139
139: ; preds = %136, %132
%140 = phi i1 [ false, %132 ], [ %138, %136 ]
br i1 %140, label %141, label %153
141: ; preds = %139
%142 = load i32, i32* %6
%143 = load i32, i32* %7
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [26 x i32], [26 x i32]* %14, i64 0, i64 %144
%146 = load i32, i32* %145
%147 = icmp eq i32 %142, %146
br i1 %147, label %148, label %149
148: ; preds = %141
store i32 1, i32* %11
br label %149
149: ; preds = %148, %141
br label %150
150: ; preds = %149
%151 = load i32, i32* %7
%152 = add nsw i32 %151, 1
store i32 %152, i32* %7
br label %132
153: ; preds = %139
%154 = load i32, i32* %11
%155 = icmp eq i32 %154, 0
br i1 %155, label %156, label %167
156: ; preds = %153
%157 = load i32, i32* %6
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [26 x i8], [26 x i8]* %5, i64 0, i64 %158
%160 = load i8, i8* %159
%161 = load i8*, i8** %3
%162 = load i32, i32* %12
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i8, i8* %161, i64 %163
store i8 %160, i8* %164
%165 = load i32, i32* %12
%166 = add nsw i32 %165, 1
store i32 %166, i32* %12
br label %167
167: ; preds = %156, %153
br label %168
168: ; preds = %167
%169 = load i32, i32* %6
%170 = add nsw i32 %169, 1
store i32 %170, i32* %6
br label %128
171: ; preds = %128
%172 = load i8*, i8** %15
%173 = call i32 @free(i8* %172)
%174 = load i8*, i8** %3
ret i8* %174
}

LLVM IR (-O2):
@__const.insertspl.spl = [26 x i8] c"\22#$%&()*+,-./:;<>=?@[]^_`~"
@stdout = global i32 0
@.str = [8 x i8] c"%d:%c \00"
@.str.1 = [53 x i8] c"\0A\0AInsert the character's number you want to delete.\0A\00"
@.str.2 = [36 x i8] c"\0AInsert 'q' when you want to end.\0A\0A\00"
@.str.3 = [14 x i8] c"Remove n %d: \00"
@stdin = global i32 0
@.str.4 = [4 x i8] c"%1s\00"
@.str.5 = [29 x i8] c"Characters %c just removed.\0A\00"
@.str.6 = [39 x i8] c"Error: %c is not a number. Try again.\0A\00"
define i8* @insertspl(i8* %0, i32* nocapture %1) {
%3 = alloca [26 x i32]
%4 = alloca i8
%5 = bitcast [26 x i32]* %3 to i8*
%6 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 0
store i32 -1, i32* %6
%7 = tail call dereferenceable_or_null(26) i8* @malloc(i32 26)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @errPointer(i32 -22)
br label %11
11: ; preds = %9, %2
br label %12
12: ; preds = %11, %12
%13 = phi i64 [ %20, %12 ], [ 0, %11 ]
%14 = load i32, i32* @stdout
%15 = getelementptr inbounds [26 x i8], [26 x i8]* @__const.insertspl.spl, i64 0, i64 %13
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = trunc i64 %13 to i32
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %17)
%20 = add nuw nsw i64 %13, 1
%21 = icmp eq i64 %20, 26
br i1 %21, label %22, label %12
22: ; preds = %12
%23 = load i32, i32* @stdout
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%25 = load i32, i32* @stdout
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %22, %66
%28 = phi i32 [ 0, %22 ], [ %71, %66 ]
%29 = phi i32 [ 0, %22 ], [ %70, %66 ]
%30 = phi i32 [ 0, %22 ], [ %69, %66 ]
%31 = phi i32 [ 0, %22 ], [ %67, %66 ]
%32 = load i32, i32* @stdout
%33 = add nsw i32 %31, 1
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %33)
%35 = load i32, i32* @stdin
%36 = call i32 @fscanf(i32 %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%37 = load i8, i8* %4
%38 = icmp eq i8 %37, 113
br i1 %38, label %73, label %39
39: ; preds = %27
%40 = call i64 @isdigit(i8 signext %37)
%41 = icmp eq i64 %40, 0
br i1 %41, label %60, label %42
42: ; preds = %39
%43 = load i8, i8* %4
%44 = call i64 @control_saved(i8* %7, i32 %29, i32 %28, i8 signext %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %55, label %46
46: ; preds = %42
%47 = load i8, i8* %4
%48 = sext i8 %47 to i32
%49 = add nsw i32 %48, -48
%50 = sext i32 %28 to i64
%51 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %50
store i32 %49, i32* %51
%52 = add nsw i32 %28, 1
%53 = add nsw i32 %29, 1
%54 = add nsw i32 %30, 1
br label %66
55: ; preds = %42
%56 = load i32, i32* @stdout
%57 = load i8, i8* %4
%58 = sext i8 %57 to i32
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %58)
br label %66
60: ; preds = %39
%61 = load i32, i32* @stdout
%62 = load i8, i8* %4
%63 = sext i8 %62 to i32
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %63)
%65 = add nsw i32 %31, -1
br label %66
66: ; preds = %60, %55, %46
%67 = phi i32 [ %31, %60 ], [ %33, %55 ], [ %33, %46 ]
%68 = phi i32 [ %65, %60 ], [ %31, %55 ], [ %31, %46 ]
%69 = phi i32 [ %30, %60 ], [ %30, %55 ], [ %54, %46 ]
%70 = phi i32 [ %29, %60 ], [ %29, %55 ], [ %53, %46 ]
%71 = phi i32 [ %28, %60 ], [ %28, %55 ], [ %52, %46 ]
%72 = icmp slt i32 %68, 25
br i1 %72, label %27, label %73
73: ; preds = %27, %66
%74 = phi i32 [ %30, %27 ], [ %69, %66 ]
%75 = load i32, i32* %1
%76 = sub nsw i32 26, %74
%77 = add nsw i32 %75, %76
%78 = call i8* @realloc(i8* %0, i32 %77)
%79 = icmp eq i8* %78, null
br i1 %79, label %80, label %82
80: ; preds = %73
%81 = call i32 @errPointer(i32 -23)
br label %82
82: ; preds = %80, %73
%83 = load i32, i32* %1
%84 = add nsw i32 %83, %76
store i32 %84, i32* %1
%85 = icmp sgt i32 %74, 0
%86 = sext i32 %74 to i64
br label %87
87: ; preds = %82, %106
%88 = phi i64 [ 0, %82 ], [ %108, %106 ]
%89 = phi i32 [ %83, %82 ], [ %107, %106 ]
br i1 %85, label %90, label %100
90: ; preds = %87, %90
%91 = phi i64 [ %96, %90 ], [ 0, %87 ]
%92 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %91
%93 = load i32, i32* %92
%94 = zext i32 %93 to i64
%95 = icmp ne i64 %88, %94
%96 = add nuw nsw i64 %91, 1
%97 = icmp slt i64 %96, %86
%98 = and i1 %97, %95
br i1 %98, label %90, label %99
99: ; preds = %90
br i1 %95, label %100, label %106
100: ; preds = %87, %99
%101 = getelementptr inbounds [26 x i8], [26 x i8]* @__const.insertspl.spl, i64 0, i64 %88
%102 = load i8, i8* %101
%103 = sext i32 %89 to i64
%104 = getelementptr inbounds i8, i8* %78, i64 %103
store i8 %102, i8* %104
%105 = add nsw i32 %89, 1
br label %106
106: ; preds = %99, %100
%107 = phi i32 [ %105, %100 ], [ %89, %99 ]
%108 = add nuw nsw i64 %88, 1
%109 = icmp eq i64 %108, 26
br i1 %109, label %110, label %87
110: ; preds = %106
%111 = call i32 @free(i8* %7)
ret i8* %78
}