#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*/ get_current_display(int *);
int /*<<< orphan*/ get_display_matrix(int *, int *);
int /*<<< orphan*/ hide_widgets(int);
int /*<<< orphan*/ init_some_colortables(int /*<<< orphan*/, int);
int /*<<< orphan*/ make_another_gui(int, int /*<<< orphan*/);
int /*<<< orphan*/ map_all_windows(int /*<<< orphan*/);
int /*<<< orphan*/ show_widgets(int);
int /*<<< orphan*/ unmap_all_windows();
int /*<<< orphan*/ vis5d_create_display_context(int);
void regenerate_window_after_import_add(int yo) {
  int cur;
  int Kurrant, rows, cols, yo2;
  get_display_matrix(&rows, &cols);
  for (yo2 = 0; yo2 < rows * cols; yo2++) {
    vis5d_create_display_context(yo2);
    make_another_gui(yo2, 0);
  }
  unmap_all_windows();
  map_all_windows(0);
  if (yo > 0) {
    init_some_colortables(0, yo);
  }
  get_current_display(&Kurrant);
  hide_widgets(Kurrant);
  show_widgets(Kurrant);
}


x86 assembly (clang, -O0):
<regenerate_window_after_import_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1080 <get_display_matrix@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    11e1 <regenerate_window_after_import_add+0x51>
mov    -0x18(%rbp),%edi
call   1030 <vis5d_create_display_context@plt>
mov    -0x18(%rbp),%edi
xor    %esi,%esi
call   1040 <make_another_gui@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11af <regenerate_window_after_import_add+0x1f>
mov    $0x0,%al
call   1060 <unmap_all_windows@plt>
xor    %edi,%edi
call   1070 <map_all_windows@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1203 <regenerate_window_after_import_add+0x73>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1050 <init_some_colortables@plt>
lea    -0xc(%rbp),%rdi
call   1090 <get_current_display@plt>
mov    -0xc(%rbp),%edi
call   10b0 <hide_widgets@plt>
mov    -0xc(%rbp),%edi
call   10a0 <show_widgets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regenerate_window_after_import_add>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1080 <get_display_matrix@plt>
mov    0xc(%rsp),%eax
imul   0x10(%rsp),%eax
test   %eax,%eax
jle    11e0 <regenerate_window_after_import_add+0x50>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <vis5d_create_display_context@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <make_another_gui@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%eax
imul   0x10(%rsp),%eax
cmp    %eax,%ebp
jl     11c0 <regenerate_window_after_import_add+0x30>
xor    %eax,%eax
call   1060 <unmap_all_windows@plt>
xor    %edi,%edi
call   1070 <map_all_windows@plt>
test   %ebx,%ebx
jle    11fb <regenerate_window_after_import_add+0x6b>
xor    %edi,%edi
mov    %ebx,%esi
call   1050 <init_some_colortables@plt>
lea    0x14(%rsp),%rdi
call   1090 <get_current_display@plt>
mov    0x14(%rsp),%edi
call   10b0 <hide_widgets@plt>
mov    0x14(%rsp),%edi
call   10a0 <show_widgets@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @regenerate_window_after_import_add(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
%8 = call i32 @get_display_matrix(i32* %5, i32* %6)
store i32 0, i32* %7
br label %9
9: ; preds = %20, %1
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = mul nsw i32 %11, %12
%14 = icmp slt i32 %10, %13
br i1 %14, label %15, label %23
15: ; preds = %9
%16 = load i32, i32* %7
%17 = call i32 @vis5d_create_display_context(i32 %16)
%18 = load i32, i32* %7
%19 = call i32 @make_another_gui(i32 %18, i32 0)
br label %20
20: ; preds = %15
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %9
23: ; preds = %9
%24 = call i32 (...) @unmap_all_windows()
%25 = call i32 @map_all_windows(i32 0)
%26 = load i32, i32* %2
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = load i32, i32* %2
%30 = call i32 @init_some_colortables(i32 0, i32 %29)
br label %31
31: ; preds = %28, %23
%32 = call i32 @get_current_display(i32* %4)
%33 = load i32, i32* %4
%34 = call i32 @hide_widgets(i32 %33)
%35 = load i32, i32* %4
%36 = call i32 @show_widgets(i32 %35)
ret void
}

LLVM IR (-O2):
define void @regenerate_window_after_import_add(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @get_display_matrix(i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, %9
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %1, %13
%14 = phi i32 [ %17, %13 ], [ 0, %1 ]
%15 = call i32 @vis5d_create_display_context(i32 %14)
%16 = call i32 @make_another_gui(i32 %14, i32 0)
%17 = add nuw nsw i32 %14, 1
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = mul nsw i32 %19, %18
%21 = icmp slt i32 %17, %20
br i1 %21, label %13, label %22
22: ; preds = %13, %1
%23 = call i32 (...) @unmap_all_windows()
%24 = call i32 @map_all_windows(i32 0)
%25 = icmp sgt i32 %0, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @init_some_colortables(i32 0, i32 %0)
br label %28
28: ; preds = %26, %22
%29 = call i32 @get_current_display(i32* %2)
%30 = load i32, i32* %2
%31 = call i32 @hide_widgets(i32 %30)
%32 = load i32, i32* %2
%33 = call i32 @show_widgets(i32 %32)
ret void
}