int genew(pline, msg, maxlines)
int *pline;
char **msg;
int maxlines;
{
  int c;
  printf("Sure? ");
  c = getchar();
  if (toupper(c) != 'Y') {
    puts("No");
    return (2);
  }
  puts("Yes");
  *pline = 0;
  memset(msg, 0, sizeof(char *) * (maxlines + 1));
  puts("-New message-");
  return (-1);
}


x86 assembly (clang, -O0):
<genew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
call   1030 <toupper@plt>
cmp    $0x59,%eax
je     11a6 <genew+0x56>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <puts@plt>
movl   $0x2,-0x4(%rbp)
jmp    11eb <genew+0x9b>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <puts@plt>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1040 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genew>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
cmp    $0x59,%eax
jne    11b4 <genew+0x64>
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1040 <puts@plt>
movl   $0x0,(%rbx)
movslq %ebp,%rax
lea    0x8(,%rax,8),%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    $0xffffffff,%ebx
lea    0xe5c(%rip),%rdi
jmp    11c0 <genew+0x70>
mov    $0x2,%ebx
lea    0xe47(%rip),%rdi
xor    %eax,%eax
call   1040 <puts@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Sure? \00"
@.str.1 = [3 x i8] c"No\00"
@.str.2 = [4 x i8] c"Yes\00"
@.str.3 = [14 x i8] c"-New message-\00"
define i32 @genew(i32* %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @getchar()
store i32 %10, i32* %8
%11 = load i32, i32* %8
%12 = call i32 @toupper(i32 %11)
%13 = icmp ne i32 %12, 89
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %4
br label %26
16: ; preds = %3
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32*, i32** %5
store i32 0, i32* %18
%19 = load i8**, i8*** %6
%20 = bitcast i8** %19 to i8*
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = mul i64 8, %23
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %4
br label %26
26: ; preds = %16, %14
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
@.str = [7 x i8] c"Sure? \00"
@.str.1 = [3 x i8] c"No\00"
@.str.2 = [4 x i8] c"Yes\00"
@.str.3 = [14 x i8] c"-New message-\00"
define i32 @genew(i32* nocapture writeonly %0, i8** nocapture writeonly %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @getchar()
%6 = tail call i32 @toupper(i32 %5)
%7 = icmp eq i32 %6, 89
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %0
%10 = bitcast i8** %1 to i8*
%11 = add nsw i32 %2, 1
%12 = sext i32 %11 to i64
%13 = shl nsw i64 %12, 3
tail call void @llvm.memset.p0i8.i64(i8* align 8 %10, i8 0, i64 %13, i1 false)
br label %14
14: ; preds = %3, %8
%15 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %3 ]
%16 = phi i32 [ -1, %8 ], [ 2, %3 ]
%17 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %15)
ret i32 %16
}