// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/bstub.c
// Function: ExtGetWallCaption
const char *ExtGetWallCaption(short wallnum)
{
    long i=0;

     if (keystatus[0x57] > 0) {    // f11   Grab pic 0x4e +
          wallpicnum=wall[curwall].picnum;
          sprintf(tempbuf,"Grabed Wall Picnum %d",wallpicnum);
          printmessage16(tempbuf);
     }
     if (keystatus[0x2b] > 0) {    // |
          if (wallsprite == 1) {
               for (i=curwallnum ; i < MAXWALLS ; i++) {
                    if (wall[i].picnum == wall[curwall].picnum) {
                         posx=(wall[i].x)-(((wall[i].x)-(wall[wall[i].point2].x))/2);
                         posy=(wall[i].y)-(( (wall[i].y)-(wall[wall[i].point2].y))/2);
                         printmessage16("Wall Found");
                         curwallnum++;
                         keystatus[0x2b]=0;
                         return(tempbuf);
                    }
                    curwallnum++;
               }
          }
          if (wallsprite == 2) {
               for (i=curspritenum ; i < MAXSPRITES ; i++) {
                    if (sprite[i].picnum == sprite[cursprite].picnum && sprite[i].statnum == 0) {
                         posx=sprite[i].x;
                         posy=sprite[i].y;
                         ang=sprite[i].ang;
                         printmessage16("Sprite Found");
                         curspritenum++;
                         keystatus[0x2b]=0;
                         return(tempbuf);
                    }
                    curspritenum++;
               }
          }
     }
     if ((wall[wallnum].lotag|wall[wallnum].hitag) == 0) {
          tempbuf[0]=0;
     }
     else {
          sprintf(tempbuf,"%hu,%hu",(unsigned short)wall[wallnum].hitag,
										  (unsigned short)wall[wallnum].lotag);
     }
	return(tempbuf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0xa(%rbp)
movq $0x0, -0x18(%rbp)
leaq 0x1af962(%rip), %rax    # 0x1badf0
movsbl 0x57(%rax), %eax
cmpl $0x0, %eax
jle 0xb4e0
movswq 0x15eba1(%rip), %rcx    # 0x16a040
leaq 0x1ea10a(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movw 0x10(%rax), %ax
movw %ax, 0x15eb8a(%rip)     # 0x16a042
movswl 0x15eb83(%rip), %edx    # 0x16a042
leaq 0xd696a(%rip), %rdi     # 0xe1e30
leaq 0xa48c0(%rip), %rsi     # 0xafd8d
movb $0x0, %al
callq 0x6a30
leaq 0xd6955(%rip), %rdi     # 0xe1e30
callq 0x25760
leaq 0x1af909(%rip), %rax    # 0x1badf0
movsbl 0x2b(%rax), %eax
cmpl $0x0, %eax
jle 0xb7a8
movsbl 0x15eb49(%rip), %eax    # 0x16a044
cmpl $0x1, %eax
jne 0xb67b
movswq 0x15eb3a(%rip), %rax    # 0x16a046
movq %rax, -0x18(%rbp)
cmpq $0x4000, -0x18(%rbp)    # imm = 0x4000
jge 0xb679
movq -0x18(%rbp), %rcx
leaq 0x1ea087(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x10(%rax), %eax
movswq 0x15eb04(%rip), %rdx    # 0x16a040
leaq 0x1ea06d(%rip), %rcx    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rcx
movswl 0x10(%rcx), %ecx
cmpl %ecx, %eax
jne 0xb656
movq -0x18(%rbp), %rcx
leaq 0x1ea04f(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rdx
leaq 0x1ea03b(%rip), %rax    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rax
movl (%rax), %eax
movq -0x18(%rbp), %rsi
leaq 0x1ea027(%rip), %rdx    # 0x1f55b0
shlq $0x5, %rsi
addq %rsi, %rdx
movswq 0x8(%rdx), %rsi
leaq 0x1ea014(%rip), %rdx    # 0x1f55b0
shlq $0x5, %rsi
addq %rsi, %rdx
subl (%rdx), %eax
movl $0x2, %esi
cltd
idivl %esi
subl %eax, %ecx
leaq 0x15eefa(%rip), %rax    # 0x16a4b0
movl %ecx, (%rax)
movq -0x18(%rbp), %rcx
leaq 0x1e9fed(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x18(%rbp), %rdx
leaq 0x1e9fd8(%rip), %rax    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rax
movl 0x4(%rax), %eax
movq -0x18(%rbp), %rsi
leaq 0x1e9fc3(%rip), %rdx    # 0x1f55b0
shlq $0x5, %rsi
addq %rsi, %rdx
movswq 0x8(%rdx), %rsi
leaq 0x1e9fb0(%rip), %rdx    # 0x1f55b0
shlq $0x5, %rsi
addq %rsi, %rdx
subl 0x4(%rdx), %eax
movl $0x2, %esi
cltd
idivl %esi
subl %eax, %ecx
leaq 0x15ee99(%rip), %rax    # 0x16a4b4
movl %ecx, (%rax)
leaq 0xa477f(%rip), %rdi     # 0xafda3
callq 0x25760
movw 0x15ea16(%rip), %ax     # 0x16a046
addw $0x1, %ax
movw %ax, 0x15ea0b(%rip)     # 0x16a046
leaq 0x1af7ae(%rip), %rax    # 0x1badf0
movb $0x0, 0x2b(%rax)
leaq 0xd67e3(%rip), %rax     # 0xe1e30
movq %rax, -0x8(%rbp)
jmp 0xb834
movw 0x15e9e9(%rip), %ax     # 0x16a046
addw $0x1, %ax
movw %ax, 0x15e9de(%rip)     # 0x16a046
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xb510
jmp 0xb67b
movsbl 0x15e9c2(%rip), %eax    # 0x16a044
cmpl $0x2, %eax
jne 0xb7a6
movswq 0x15e9b5(%rip), %rax    # 0x16a048
movq %rax, -0x18(%rbp)
cmpq $0x4000, -0x18(%rbp)    # imm = 0x4000
jge 0xb7a4
leaq 0x2ae164(%rip), %rax    # 0x2b9810
imulq $0x2c, -0x18(%rbp), %rcx
addq %rcx, %rax
movswl 0xe(%rax), %eax
movswq 0x15e98a(%rip), %rdx    # 0x16a04a
leaq 0x2ae149(%rip), %rcx    # 0x2b9810
imulq $0x2c, %rdx, %rdx
addq %rdx, %rcx
movswl 0xe(%rcx), %ecx
cmpl %ecx, %eax
jne 0xb781
leaq 0x2ae12f(%rip), %rax    # 0x2b9810
imulq $0x2c, -0x18(%rbp), %rcx
addq %rcx, %rax
movswl 0x1a(%rax), %eax
cmpl $0x0, %eax
jne 0xb781
leaq 0x2ae113(%rip), %rax    # 0x2b9810
imulq $0x2c, -0x18(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %ecx
leaq 0x15eda2(%rip), %rax    # 0x16a4b0
movl %ecx, (%rax)
leaq 0x2ae0f9(%rip), %rax    # 0x2b9810
imulq $0x2c, -0x18(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
leaq 0x15ed8b(%rip), %rax    # 0x16a4b4
movl %ecx, (%rax)
leaq 0x2ae0de(%rip), %rax    # 0x2b9810
imulq $0x2c, -0x18(%rbp), %rcx
addq %rcx, %rax
movw 0x1c(%rax), %cx
leaq 0x15ed77(%rip), %rax    # 0x16a4bc
movw %cx, (%rax)
leaq 0xa465f(%rip), %rdi     # 0xafdae
callq 0x25760
movw 0x15e8ed(%rip), %ax     # 0x16a048
addw $0x1, %ax
movw %ax, 0x15e8e2(%rip)     # 0x16a048
leaq 0x1af683(%rip), %rax    # 0x1badf0
movb $0x0, 0x2b(%rax)
leaq 0xd66b8(%rip), %rax     # 0xe1e30
movq %rax, -0x8(%rbp)
jmp 0xb834
movw 0x15e8c0(%rip), %ax     # 0x16a048
addw $0x1, %ax
movw %ax, 0x15e8b5(%rip)     # 0x16a048
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xb697
jmp 0xb7a6
jmp 0xb7a8
movswq -0xa(%rbp), %rcx
leaq 0x1e9dfc(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x1a(%rax), %eax
movswq -0xa(%rbp), %rdx
leaq 0x1e9de5(%rip), %rcx    # 0x1f55b0
shlq $0x5, %rdx
addq %rdx, %rcx
movswl 0x1c(%rcx), %ecx
orl %ecx, %eax
cmpl $0x0, %eax
jne 0xb7e6
movb $0x0, 0xd664c(%rip)     # 0xe1e30
jmp 0xb829
movswq -0xa(%rbp), %rcx
leaq 0x1e9dbe(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movzwl 0x1c(%rax), %edx
movswq -0xa(%rbp), %rcx
leaq 0x1e9da7(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movzwl 0x1a(%rax), %ecx
leaq 0xd6615(%rip), %rdi     # 0xe1e30
leaq 0xa4599(%rip), %rsi     # 0xafdbb
movb $0x0, %al
callq 0x6a30
leaq 0xd6600(%rip), %rax     # 0xe1e30
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop