#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*/ drawLine(int, char);
int /*<<< orphan*/ drawWalls(int, char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, char *);
int main(void) {
  int size = 5;
  char symbol = '*';
  printf("give size and char\n");
  scanf("%d%*c%c", &size, &symbol);
  printf("\n");
  drawLine(size, symbol);
  drawWalls(size, symbol);
  drawLine(size, symbol);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movb   $0x2a,-0x9(%rbp)
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x9(%rbp),%rdx
call   1060 <scanf@plt>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
movsbl -0x9(%rbp),%esi
call   1030 <drawLine@plt>
mov    -0x8(%rbp),%edi
movsbl -0x9(%rbp),%esi
call   1050 <drawWalls@plt>
mov    -0x8(%rbp),%edi
movsbl -0x9(%rbp),%esi
call   1030 <drawLine@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movb   $0x2a,0x3(%rsp)
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8f(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0x3(%rsp),%rdx
call   1070 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%edi
movsbl 0x3(%rsp),%esi
call   1050 <drawLine@plt>
mov    0x4(%rsp),%edi
movsbl 0x3(%rsp),%esi
call   1060 <drawWalls@plt>
mov    0x4(%rsp),%edi
movsbl 0x3(%rsp),%esi
call   1050 <drawLine@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"give size and char\0A\00"
@.str.1 = [8 x i8] c"%d%*c%c\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 5, i32* %2
store i8 42, i8* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %2, i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = load i8, i8* %3
%9 = call i32 @drawLine(i32 %7, i8 signext %8)
%10 = load i32, i32* %2
%11 = load i8, i8* %3
%12 = call i32 @drawWalls(i32 %10, i8 signext %11)
%13 = load i32, i32* %2
%14 = load i8, i8* %3
%15 = call i32 @drawLine(i32 %13, i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%d%*c%c\00"
@str = [19 x i8] c"give size and char\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
store i8 42, i8* %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %1, i8* %2)
%6 = call i32 @putchar(i32 10)
%7 = load i32, i32* %1
%8 = load i8, i8* %2
%9 = call i32 @drawLine(i32 %7, i8 signext %8)
%10 = load i32, i32* %1
%11 = load i8, i8* %2
%12 = call i32 @drawWalls(i32 %10, i8 signext %11)
%13 = load i32, i32* %1
%14 = load i8, i8* %2
%15 = call i32 @drawLine(i32 %13, i8 signext %14)
ret i32 0
}