#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]) {
  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>
cmp    $0xa,%eax
je     1171 <edit+0x21>
jmp    115c <edit+0xc>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     11b0 <edit+0x60>
jmp    119b <edit+0x4b>
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    0xe4b(%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
nopl   0x0(%rax,%rax,1)
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
br label %4
4: ; preds = %7, %1
%5 = call i32 (...) @getchar()
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %4
br label %4
8: ; preds = %4
%9 = call i32 (i8*, ...) @printf(i8* 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* %3)
%11 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %15, %8
%13 = call i32 (...) @getchar()
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %12
br label %12
16: ; preds = %12
%17 = load [20 x i8]*, [20 x i8]** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %17, i64 %19
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %20, i64 0, i64 0
%22 = call i32 @gets(i8* %21)
%23 = load i32, i32* %3
%24 = load [20 x i8]*, [20 x i8]** %2
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [20 x i8], [20 x i8]* %24, i64 %26
%28 = getelementptr inbounds [20 x i8], [20 x i8]* %27, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %23, i8* %28)
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 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = tail call i32 (...) @getchar()
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %11, %7
%12 = call i32 (...) @getchar()
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %11
14: ; preds = %11
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %16, i64 0
%18 = call i32 @gets(i8* %17)
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %20, i64 0
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %19, i8* %21)
ret void
}