#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*/ gotoxy(int, int);
int /*<<< orphan*/ printf(char *);
int wherex();
int wherey();
void Cadre(void) {
  int x, y;
  y = 0;
  for (x = 80; x > 0; x--) {
    gotoxy(y, x);
    printf("*");
  }
  x = wherex();
  for (y = wherey(); y < 26; y++) {
    gotoxy(x, y);
    printf("*");
  }
  y = wherey();
  for (x = wherex(); x < 80; x++) {
    gotoxy(x, y);
    printf("*");
  }
  x = wherex();
  for (y = wherey(); y > 0; y--) {
    gotoxy(x, y);
    printf("*");
  }
  return;
}


x86 assembly (clang, -O0):
<Cadre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x50,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1185 <Cadre+0x45>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <gotoxy@plt>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <Cadre+0x16>
mov    $0x0,%al
call   1050 <wherex@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <wherey@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jge    11c8 <Cadre+0x88>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <gotoxy@plt>
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1199 <Cadre+0x59>
mov    $0x0,%al
call   1030 <wherey@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <wherex@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x50,-0x4(%rbp)
jge    120b <Cadre+0xcb>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <gotoxy@plt>
lea    0xe08(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11dc <Cadre+0x9c>
mov    $0x0,%al
call   1050 <wherex@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <wherey@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    124e <Cadre+0x10e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <gotoxy@plt>
lea    0xdc5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    121f <Cadre+0xdf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cadre>:
push   %rbp
push   %rbx
push   %rax
mov    $0x51,%ebx
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebx
xor    %edi,%edi
mov    %ebx,%esi
call   1060 <gotoxy@plt>
mov    $0x2a,%edi
call   1040 <putchar@plt>
cmp    $0x1,%ebx
ja     1150 <Cadre+0x10>
xor    %eax,%eax
call   1050 <wherex@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <wherey@plt>
cmp    $0x19,%eax
jg     11ab <Cadre+0x6b>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
call   1060 <gotoxy@plt>
mov    $0x2a,%edi
call   1040 <putchar@plt>
add    $0x1,%ebp
cmp    $0x1a,%ebp
jne    1190 <Cadre+0x50>
xor    %eax,%eax
call   1030 <wherey@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <wherex@plt>
cmp    $0x4f,%eax
jg     11eb <Cadre+0xab>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
call   1060 <gotoxy@plt>
mov    $0x2a,%edi
call   1040 <putchar@plt>
add    $0x1,%ebp
cmp    $0x50,%ebp
jne    11d0 <Cadre+0x90>
xor    %eax,%eax
call   1050 <wherex@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <wherey@plt>
test   %eax,%eax
jle    122d <Cadre+0xed>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%esi
call   1060 <gotoxy@plt>
mov    $0x2a,%edi
call   1040 <putchar@plt>
lea    -0x1(%rbp),%eax
cmp    $0x1,%ebp
mov    %eax,%ebp
ja     1210 <Cadre+0xd0>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
define void @Cadre() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 80, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = call i32 @gotoxy(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, -1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
%15 = call i32 (...) @wherex()
store i32 %15, i32* %1
%16 = call i32 (...) @wherey()
store i32 %16, i32* %2
br label %17
17: ; preds = %25, %14
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 26
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = call i32 @gotoxy(i32 %21, i32 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %20
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %17
28: ; preds = %17
%29 = call i32 (...) @wherey()
store i32 %29, i32* %2
%30 = call i32 (...) @wherex()
store i32 %30, i32* %1
br label %31
31: ; preds = %39, %28
%32 = load i32, i32* %1
%33 = icmp slt i32 %32, 80
br i1 %33, label %34, label %42
34: ; preds = %31
%35 = load i32, i32* %1
%36 = load i32, i32* %2
%37 = call i32 @gotoxy(i32 %35, i32 %36)
%38 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %39
39: ; preds = %34
%40 = load i32, i32* %1
%41 = add nsw i32 %40, 1
store i32 %41, i32* %1
br label %31
42: ; preds = %31
%43 = call i32 (...) @wherex()
store i32 %43, i32* %1
%44 = call i32 (...) @wherey()
store i32 %44, i32* %2
br label %45
45: ; preds = %53, %42
%46 = load i32, i32* %2
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %56
48: ; preds = %45
%49 = load i32, i32* %1
%50 = load i32, i32* %2
%51 = call i32 @gotoxy(i32 %49, i32 %50)
%52 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %53
53: ; preds = %48
%54 = load i32, i32* %2
%55 = add nsw i32 %54, -1
store i32 %55, i32* %2
br label %45
56: ; preds = %45
ret void
}

LLVM IR (-O2):
define void @Cadre() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 80, %0 ], [ %5, %1 ]
%3 = tail call i32 @gotoxy(i32 0, i32 %2)
%4 = tail call i32 @putchar(i32 42)
%5 = add nsw i32 %2, -1
%6 = icmp ugt i32 %2, 1
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = tail call i32 (...) @wherex()
%9 = tail call i32 (...) @wherey()
%10 = icmp slt i32 %9, 26
br i1 %10, label %11, label %17
11: ; preds = %7, %11
%12 = phi i32 [ %15, %11 ], [ %9, %7 ]
%13 = tail call i32 @gotoxy(i32 %8, i32 %12)
%14 = tail call i32 @putchar(i32 42)
%15 = add i32 %12, 1
%16 = icmp eq i32 %15, 26
br i1 %16, label %17, label %11
17: ; preds = %11, %7
%18 = tail call i32 (...) @wherey()
%19 = tail call i32 (...) @wherex()
%20 = icmp slt i32 %19, 80
br i1 %20, label %21, label %27
21: ; preds = %17, %21
%22 = phi i32 [ %25, %21 ], [ %19, %17 ]
%23 = tail call i32 @gotoxy(i32 %22, i32 %18)
%24 = tail call i32 @putchar(i32 42)
%25 = add i32 %22, 1
%26 = icmp eq i32 %25, 80
br i1 %26, label %27, label %21
27: ; preds = %21, %17
%28 = tail call i32 (...) @wherex()
%29 = tail call i32 (...) @wherey()
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %27, %31
%32 = phi i32 [ %35, %31 ], [ %29, %27 ]
%33 = tail call i32 @gotoxy(i32 %28, i32 %32)
%34 = tail call i32 @putchar(i32 42)
%35 = add nsw i32 %32, -1
%36 = icmp ugt i32 %32, 1
br i1 %36, label %31, label %37
37: ; preds = %31, %27
ret void
}