#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 */
char getchar();
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
void getUserEquation(char *eqaStr) {
  memset(eqaStr, 0, 80);
  char tmpChar = 0xff;
  printf(":");
  int i;
  for (i = 0; i < 80; i++) {
    tmpChar = getchar();
    if (tmpChar == '\n')
      break;
    if (tmpChar != ' ') {
      *eqaStr = tmpChar;
      eqaStr++;
    }
  }
  *eqaStr = '\0';
}


x86 assembly (clang, -O0):
<getUserEquation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
movb   $0xff,-0x9(%rbp)
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x50,-0x10(%rbp)
jge    11be <getUserEquation+0x8e>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1189 <getUserEquation+0x59>
jmp    11be <getUserEquation+0x8e>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     11ab <getUserEquation+0x7b>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11b0 <getUserEquation+0x80>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <getUserEquation+0x33>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUserEquation>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x50,%ebp
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
mov    $0x3a,%edi
call   1030 <putchar@plt>
jmp    1165 <getUserEquation+0x35>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffff,%ebp
je     117c <getUserEquation+0x4c>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x20,%al
je     1160 <getUserEquation+0x30>
cmp    $0xa,%al
je     117c <getUserEquation+0x4c>
mov    %al,(%rbx)
add    $0x1,%rbx
jmp    1160 <getUserEquation+0x30>
movb   $0x0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
define void @getUserEquation(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @memset(i8* %5, i32 0, i32 80)
store i8 -1, i8* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %8
8: ; preds = %27, %1
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 80
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = call signext i8 (...) @getchar()
store i8 %12, i8* %3
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %17
16: ; preds = %11
br label %30
17: ; preds = %11
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 32
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8, i8* %3
%23 = load i8*, i8** %2
store i8 %22, i8* %23
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %2
br label %26
26: ; preds = %21, %17
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %8
30: ; preds = %16, %8
%31 = load i8*, i8** %2
store i8 0, i8* %31
ret void
}

LLVM IR (-O2):
define void @getUserEquation(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 80)
%3 = tail call i32 @putchar(i32 58)
br label %4
4: ; preds = %1, %10
%5 = phi i32 [ 0, %1 ], [ %12, %10 ]
%6 = phi i8* [ %0, %1 ], [ %11, %10 ]
%7 = tail call signext i8 (...) @getchar()
switch i8 %7, label %8 [
i8 10, label %14
i8 32, label %10
]
8: ; preds = %4
store i8 %7, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
br label %10
10: ; preds = %4, %8
%11 = phi i8* [ %9, %8 ], [ %6, %4 ]
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, 80
br i1 %13, label %14, label %4
14: ; preds = %4, %10
%15 = phi i8* [ %6, %4 ], [ %11, %10 ]
store i8 0, i8* %15
ret void
}