#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 /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcat(char *, char *);
char *strchr(char *, char);
void lire(char *s) {
  char *enter = NULL;
  char temp[100] = "";
  fgets(temp, 99, stdin);
  enter = strchr(temp, '\n');
  if (enter != NULL)
    *enter = '\0';
  strcat(s, temp);
}


x86 assembly (clang, -O0):
<lire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
lea    -0x80(%rbp),%rdi
mov    0x2e76(%rip),%rax
mov    (%rax),%edx
mov    $0x63,%esi
call   1050 <fgets@plt>
lea    -0x80(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a2 <lire+0x62>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1060 <strcat@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lire>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x63,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1190 <lire+0x60>
movb   $0x0,(%rax)
mov    %rsp,%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @lire(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [100 x i8]
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = bitcast [100 x i8]* %4 to i8*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 99, i32 %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = call i8* @strchr(i8* %9, i8 signext 10)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i8*, i8** %3
store i8 0, i8* %14
br label %15
15: ; preds = %13, %1
%16 = load i8*, i8** %2
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%18 = call i32 @strcat(i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @lire(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 99, i32 %4)
%6 = call i8* @strchr(i8* %3, i8 signext 10)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8 0, i8* %6
br label %9
9: ; preds = %8, %1
%10 = call i32 @strcat(i8* %0, i8* %3)
ret void
}