#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*/ goback(int, int);
int /*<<< orphan*/ printf(char *);
void gotoxy(int x, int y) {
  extern int lasti, lastj;
  int i;
  goback(lasti, lastj);
  for (i = 0; i < x; i++)
    printf("\n");
  for (i = 0; i < y; i++)
    printf("\t");
  lasti = x;
  lastj = y;
}


x86 assembly (clang, -O0):
<gotoxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1040 <goback@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1172 <gotoxy+0x52>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <gotoxy+0x2c>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    119f <gotoxy+0x7f>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1179 <gotoxy+0x59>
mov    -0x4(%rbp),%ecx
mov    0x2e3f(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    0x2e23(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoxy>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r12d
mov    %edi,%ebx
mov    0x2eb4(%rip),%r14
mov    (%r14),%edi
mov    0x2e9a(%rip),%r15
mov    (%r15),%esi
call   1040 <goback@plt>
test   %ebx,%ebx
jle    115f <gotoxy+0x3f>
mov    %ebx,%ebp
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1150 <gotoxy+0x30>
test   %r12d,%r12d
jle    117f <gotoxy+0x5f>
mov    %r12d,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1170 <gotoxy+0x50>
mov    %ebx,(%r14)
mov    %r12d,(%r15)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@lasti = external global i32
@lastj = external global i32
define void @gotoxy(i32 %0, i32 %1) {
%3 = load i32, i32* @lasti
%4 = load i32, i32* @lastj
%5 = tail call i32 @goback(i32 %3, i32 %4)
%6 = icmp sgt i32 %0, 0
br i1 %6, label %9, label %7
7: ; preds = %9, %2
%8 = icmp sgt i32 %1, 0
br i1 %8, label %14, label %19
9: ; preds = %2, %9
%10 = phi i32 [ %12, %9 ], [ 0, %2 ]
%11 = tail call i32 @putchar(i32 10)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %7, label %9
14: ; preds = %7, %14
%15 = phi i32 [ %17, %14 ], [ 0, %7 ]
%16 = tail call i32 @putchar(i32 9)
%17 = add nuw nsw i32 %15, 1
%18 = icmp eq i32 %17, %1
br i1 %18, label %19, label %14
19: ; preds = %14, %7
store i32 %0, i32* @lasti
store i32 %1, i32* @lastj
ret void
}