#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 getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
void edit(char (*db)[20]) {
  getchar();
  int pos;
  while (getchar() != 10)
    ;
  printf("Enter postion to edit");
  scanf("%d", &pos);
  puts("Edit the name ");
  while (getchar() != 10)
    ;
  gets(db[pos]);
  printf("Edited at postion: %d with %s\n", pos, db[pos]);
}


x86 assembly (clang, -O0):
<edit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     1178 <edit+0x28>
jmp    1163 <edit+0x13>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe89(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     11b7 <edit+0x67>
jmp    11a2 <edit+0x52>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rdi
call   1060 <gets@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
movslq -0xc(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rdx
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edit>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <getchar@plt>
nop
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
jne    1160 <edit+0x10>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
jne    11a0 <edit+0x50>
movslq 0xc(%rsp),%rax
lea    (%rax,%rax,4),%rax
lea    (%rbx,%rax,4),%rdi
call   1060 <gets@plt>
movslq 0xc(%rsp),%rsi
lea    (%rsi,%rsi,4),%rax
lea    (%rbx,%rax,4),%rdx
lea    0xe56(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter postion to edit\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"Edit the name \00"
@.str.3 = [31 x i8] c"Edited at postion: %d with %s\0A\00"
define void @edit([20 x i8]* %0) {
%2 = alloca [20 x i8]*
%3 = alloca i32
store [20 x i8]* %0, [20 x i8]** %2
%4 = call i32 (...) @getchar()
br label %5
5: ; preds = %8, %1
%6 = call i32 (...) @getchar()
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %5
br label %5
9: ; preds = %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %16, %9
%14 = call i32 (...) @getchar()
%15 = icmp ne i32 %14, 10
br i1 %15, label %16, label %17
16: ; preds = %13
br label %13
17: ; preds = %13
%18 = load [20 x i8]*, [20 x i8]** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %18, i64 %20
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %21, i64 0, i64 0
%23 = call i32 @gets(i8* %22)
%24 = load i32, i32* %3
%25 = load [20 x i8]*, [20 x i8]** %2
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 %27
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %28, i64 0, i64 0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %24, i8* %29)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter postion to edit\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"Edit the name \00"
@.str.3 = [31 x i8] c"Edited at postion: %d with %s\0A\00"
define void @edit([20 x i8]* %0) {
%2 = alloca i32
%3 = tail call i32 (...) @getchar()
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @getchar()
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %5
8: ; preds = %5
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %12, %8
%13 = call i32 (...) @getchar()
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %12
15: ; preds = %12
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %17, i64 0
%19 = call i32 @gets(i8* %18)
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %21, i64 0
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %20, i8* %22)
ret void
}