#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 */
struct maze {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int maze_get_cell(struct maze *, int, int);
scalar_t__ maze_get_cell_tid(struct maze *, int, int);
int /*<<< orphan*/ maze_to_fig_line(int /*<<< orphan*/ *, int, int, int, int,
                                    int, scalar_t__);
void maze_to_fig_visited(FILE *fp, struct maze *mp, int row, int col, int upc) {
  if (maze_get_cell(mp, row, col) & 0x08000000)
    maze_to_fig_line(fp, col * upc, row * upc, (col + 1) * upc, (row + 1) * upc,
                     14, 100 + maze_get_cell_tid(mp, row, col));
}


x86 assembly (clang, -O0):
<maze_to_fig_visited>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <maze_get_cell@plt>
and    $0x8000000,%eax
cmp    $0x0,%eax
je     11d0 <maze_to_fig_visited+0xa0>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <maze_get_cell_tid@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
add    $0x64,%rax
mov    $0xe,%r9d
mov    %rax,(%rsp)
call   1040 <maze_to_fig_line@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maze_to_fig_visited>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%ebp
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %rsi,%r12
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
call   1050 <maze_get_cell@plt>
test   $0x8000000,%eax
je     11ba <maze_to_fig_visited+0x8a>
mov    %ebp,%eax
imul   %r15d,%eax
mov    %eax,0xc(%rsp)
mov    %ebp,%eax
imul   %ebx,%eax
mov    %eax,0x8(%rsp)
lea    0x1(%r15),%r13d
imul   %ebp,%r13d
mov    %r14,0x10(%rsp)
lea    0x1(%rbx),%r14d
imul   %ebp,%r14d
mov    %r12,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
call   1030 <maze_get_cell_tid@plt>
add    $0x64,%rax
mov    %rax,(%rsp)
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %r13d,%ecx
mov    %r14d,%r8d
mov    $0xe,%r9d
call   1040 <maze_to_fig_line@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.maze = type { i32 }
define void @maze_to_fig_visited(i32* %0, %struct.maze* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca %struct.maze*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store %struct.maze* %1, %struct.maze** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.maze*, %struct.maze** %7
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = call i32 @maze_get_cell(%struct.maze* %11, i32 %12, i32 %13)
%15 = and i32 %14, 134217728
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %39
17: ; preds = %5
%18 = load i32*, i32** %6
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %8
%23 = load i32, i32* %10
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
%27 = load i32, i32* %10
%28 = mul nsw i32 %26, %27
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
%31 = load i32, i32* %10
%32 = mul nsw i32 %30, %31
%33 = load %struct.maze*, %struct.maze** %7
%34 = load i32, i32* %8
%35 = load i32, i32* %9
%36 = call i64 @maze_get_cell_tid(%struct.maze* %33, i32 %34, i32 %35)
%37 = add nsw i64 100, %36
%38 = call i32 @maze_to_fig_line(i32* %18, i32 %21, i32 %24, i32 %28, i32 %32, i32 14, i64 %37)
br label %39
39: ; preds = %17, %5
ret void
}

LLVM IR (-O2):
%struct.maze = type { i32 }
define void @maze_to_fig_visited(i32* %0, %struct.maze* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @maze_get_cell(%struct.maze* %1, i32 %2, i32 %3)
%7 = and i32 %6, 134217728
%8 = icmp eq i32 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %5
%10 = mul nsw i32 %4, %3
%11 = mul nsw i32 %4, %2
%12 = add nsw i32 %3, 1
%13 = mul nsw i32 %12, %4
%14 = add nsw i32 %2, 1
%15 = mul nsw i32 %14, %4
%16 = tail call i64 @maze_get_cell_tid(%struct.maze* %1, i32 %2, i32 %3)
%17 = add nsw i64 %16, 100
%18 = tail call i32 @maze_to_fig_line(i32* %0, i32 %10, i32 %11, i32 %13, i32 %15, i32 14, i64 %17)
br label %19
19: ; preds = %9, %5
ret void
}