#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
void request(void) {
  static int input = 0;
  puts("\tNew Request!");
  printf("\tPrevious request was \"%d\"\n", input);
  printf("\tEnter new request: ");
  scanf("%d", &input);
  fflush(stdin);
  puts("\tThank you!\n\n");
}


x86 assembly (clang, -O0):
<request>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eee(%rip),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0x2ec4(%rip),%rsi
call   1060 <scanf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<request>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0x2ef0(%rip),%rbx
mov    0x2eea(%rip),%esi
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xea8(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@request.input = internal global i32 0
@.str = [14 x i8] c"\09New Request!\00"
@.str.1 = [28 x i8] c"\09Previous request was \22%d\22\0A\00"
@.str.2 = [21 x i8] c"\09Enter new request: \00"
@.str.3 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.4 = [14 x i8] c"\09Thank you!\0A\0A\00"
define void @request() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @request.input
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 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), i32* @request.input)
%6 = load i32, i32* @stdin
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@request.input = internal global i32 0
@.str = [14 x i8] c"\09New Request!\00"
@.str.1 = [28 x i8] c"\09Previous request was \22%d\22\0A\00"
@.str.2 = [21 x i8] c"\09Enter new request: \00"
@.str.3 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.4 = [14 x i8] c"\09Thank you!\0A\0A\00"
define void @request() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @request.input
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* @request.input)
%6 = load i32, i32* @stdin
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
ret void
}