#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*/ print_star(int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void print_prompt(void) {
  putchar('\n');
  print_star(50);
  puts("Type in a basic arithmetic expression.\n");
  puts("For example, 2 + 3");
  puts("or, 2 * 10 / 5");
  puts("are examples of basic expressions.\n");
  puts("Valid operators are +, -, *, and /.\n");
  print_star(50);
  puts("To quit, press [enter] on a new expression line.");
  puts("i.e. (expression)?> [enter]\n");
  print_star(50);
  puts("Note: This program only operates on whole numbers.\n");
  print_star(50);
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_prompt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x32,%edi
call   1050 <print_star@plt>
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
lea    0xed7(%rip),%rdi
call   1040 <puts@plt>
lea    0xeef(%rip),%rdi
call   1040 <puts@plt>
mov    $0x32,%edi
call   1050 <print_star@plt>
lea    0xefe(%rip),%rdi
call   1040 <puts@plt>
lea    0xf23(%rip),%rdi
call   1040 <puts@plt>
mov    $0x32,%edi
call   1050 <print_star@plt>
lea    0xf2a(%rip),%rdi
call   1040 <puts@plt>
mov    $0x32,%edi
call   1050 <print_star@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_prompt>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x32,%edi
call   1050 <print_star@plt>
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
lea    0xed7(%rip),%rdi
call   1040 <puts@plt>
lea    0xeda(%rip),%rdi
call   1040 <puts@plt>
lea    0xef2(%rip),%rdi
call   1040 <puts@plt>
mov    $0x32,%edi
call   1050 <print_star@plt>
lea    0xf01(%rip),%rdi
call   1040 <puts@plt>
lea    0xf26(%rip),%rdi
call   1040 <puts@plt>
mov    $0x32,%edi
call   1050 <print_star@plt>
lea    0xf2d(%rip),%rdi
call   1040 <puts@plt>
mov    $0x32,%edi
call   1050 <print_star@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Type in a basic arithmetic expression.\0A\00"
@.str.1 = [19 x i8] c"For example, 2 + 3\00"
@.str.2 = [15 x i8] c"or, 2 * 10 / 5\00"
@.str.3 = [36 x i8] c"are examples of basic expressions.\0A\00"
@.str.4 = [37 x i8] c"Valid operators are +, -, *, and /.\0A\00"
@.str.5 = [49 x i8] c"To quit, press [enter] on a new expression line.\00"
@.str.6 = [29 x i8] c"i.e. (expression)?> [enter]\0A\00"
@.str.7 = [52 x i8] c"Note: This program only operates on whole numbers.\0A\00"
define void @print_prompt() {
%1 = call i32 @putchar(i8 signext 10)
%2 = call i32 @print_star(i32 50)
%3 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @print_star(i32 50)
%9 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @print_star(i32 50)
%12 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @print_star(i32 50)
%14 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Type in a basic arithmetic expression.\0A\00"
@.str.1 = [19 x i8] c"For example, 2 + 3\00"
@.str.2 = [15 x i8] c"or, 2 * 10 / 5\00"
@.str.3 = [36 x i8] c"are examples of basic expressions.\0A\00"
@.str.4 = [37 x i8] c"Valid operators are +, -, *, and /.\0A\00"
@.str.5 = [49 x i8] c"To quit, press [enter] on a new expression line.\00"
@.str.6 = [29 x i8] c"i.e. (expression)?> [enter]\0A\00"
@.str.7 = [52 x i8] c"Note: This program only operates on whole numbers.\0A\00"
define void @print_prompt() {
%1 = tail call i32 @putchar(i8 signext 10)
%2 = tail call i32 @print_star(i32 50)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @print_star(i32 50)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%11 = tail call i32 @print_star(i32 50)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%13 = tail call i32 @print_star(i32 50)
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}