#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ input_token(char *);
int /*<<< orphan*/ output_line(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main() {
  FILE *out = fopen("data.txt", "a+");
  char s[100], ps[100];
  while (1) {
    printf("Input your new keys:(y/n)");
    scanf("%s", s);
    if (strcmp(s, "n") == 0)
      break;
    printf("\turl:");
    scanf("%s", s);
    getchar();
    output_line(out, s);
    printf("\tcn_name:");
    scanf("%s", s);
    getchar();
    output_line(out, s);
    printf("\ten_name:");
    scanf("%s", s);
    getchar();
    output_line(out, s);
    printf("\tid:");
    scanf("%s", s);
    getchar();
    output_line(out, s);
    printf("\tkey:");
    input_token(s);
    output_line(out, s);
    printf("\tmore:");
    scanf("%s", s);
    getchar();
    output_line(out, s);
  }
  fclose(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe67(%rip),%rdi
lea    0xe69(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe5c(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1090 <scanf@plt>
lea    -0x80(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11e4 <main+0x64>
jmp    12fb <main+0x17b>
lea    0xe40(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe2b(%rip),%rdi
call   1090 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1080 <output_line@plt>
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xdfb(%rip),%rdi
call   1090 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1080 <output_line@plt>
lea    0xdf0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xdcb(%rip),%rdi
call   1090 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1080 <output_line@plt>
lea    0xdca(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xd9b(%rip),%rdi
call   1090 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1080 <output_line@plt>
lea    0xd9f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1070 <input_token@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1080 <output_line@plt>
lea    0xd83(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xd49(%rip),%rdi
call   1090 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1080 <output_line@plt>
jmp    11a9 <main+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xe6b(%rip),%rdi
lea    0xe6d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r12
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6f(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1090 <scanf@plt>
lea    0xe60(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     130f <main+0x18f>
lea    0xe45(%rip),%r15
mov    %rsp,%rbx
lea    0xe65(%rip),%rbp
lea    0xe1a(%rip),%r14
lea    0xe30(%rip),%r13
nopl   0x0(%rax)
lea    0xe24(%rip),%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <output_line@plt>
lea    0xe01(%rip),%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <output_line@plt>
lea    0xde2(%rip),%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <output_line@plt>
lea    0xdc3(%rip),%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <output_line@plt>
lea    0xd9f(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1070 <input_token@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <output_line@plt>
mov    %rbp,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <output_line@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1200 <main+0x80>
mov    %r12,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"data.txt\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [26 x i8] c"Input your new keys:(y/n)\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"n\00"
@.str.5 = [6 x i8] c"\09url:\00"
@.str.6 = [10 x i8] c"\09cn_name:\00"
@.str.7 = [10 x i8] c"\09en_name:\00"
@.str.8 = [5 x i8] c"\09id:\00"
@.str.9 = [6 x i8] c"\09key:\00"
@.str.10 = [7 x i8] c"\09more:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
store i32 0, i32* %1
%5 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %2
br label %6
6: ; preds = %0, %14
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %6
br label %56
14: ; preds = %6
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%18 = call i32 (...) @getchar()
%19 = load i32*, i32** %2
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%21 = call i32 @output_line(i32* %19, i8* %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %23)
%25 = call i32 (...) @getchar()
%26 = load i32*, i32** %2
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%28 = call i32 @output_line(i32* %26, i8* %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %30)
%32 = call i32 (...) @getchar()
%33 = load i32*, i32** %2
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%35 = call i32 @output_line(i32* %33, i8* %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = call i32 (...) @getchar()
%40 = load i32*, i32** %2
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%42 = call i32 @output_line(i32* %40, i8* %41)
%43 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%45 = call i32 @input_token(i8* %44)
%46 = load i32*, i32** %2
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%48 = call i32 @output_line(i32* %46, i8* %47)
%49 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%51 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %50)
%52 = call i32 (...) @getchar()
%53 = load i32*, i32** %2
%54 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%55 = call i32 @output_line(i32* %53, i8* %54)
br label %6
56: ; preds = %13
%57 = load i32*, i32** %2
%58 = call i32 @fclose(i32* %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"data.txt\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [26 x i8] c"Input your new keys:(y/n)\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"n\00"
@.str.5 = [6 x i8] c"\09url:\00"
@.str.6 = [10 x i8] c"\09cn_name:\00"
@.str.7 = [10 x i8] c"\09en_name:\00"
@.str.8 = [5 x i8] c"\09id:\00"
@.str.9 = [6 x i8] c"\09key:\00"
@.str.10 = [7 x i8] c"\09more:\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%6 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %36, label %8
8: ; preds = %0, %8
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%11 = call i32 (...) @getchar()
%12 = call i32 @output_line(i32* %2, i8* %3)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%15 = call i32 (...) @getchar()
%16 = call i32 @output_line(i32* %2, i8* %3)
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%19 = call i32 (...) @getchar()
%20 = call i32 @output_line(i32* %2, i8* %3)
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%23 = call i32 (...) @getchar()
%24 = call i32 @output_line(i32* %2, i8* %3)
%25 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%26 = call i32 @input_token(i8* %3)
%27 = call i32 @output_line(i32* %2, i8* %3)
%28 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%30 = call i32 (...) @getchar()
%31 = call i32 @output_line(i32* %2, i8* %3)
%32 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%34 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %8
36: ; preds = %8, %0
%37 = call i32 @fclose(i32* %2)
ret i32 0
}