#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*/ gs_mydashedline(int, int, int, int, int, int);
int /*<<< orphan*/ gs_mydottedline(int, int, int, int, int, int);
int /*<<< orphan*/ gs_mysolidline(int, int, int, int, int, int);
void draw_final_part(int x0, int y0, int x1, int y1, int c, int t, int m) {
  ;
  x0 = (x0 + x1) / 2;
  y0 = (y0 + y1) / 2;
  switch (m) {
  case 0:
    gs_mysolidline(x0, y0, x1, y1, t, c);
    break;
  case 2:
    gs_mydashedline(x0, y0, x1, y1, t, c);
    break;
  case 1:
    gs_mydottedline(x0, y0, x1, y1, t, c);
    break;
  case 3:
    break;
  }
}


x86 assembly (clang, -O0):
<draw_final_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
mov    %eax,-0x8(%rbp)
mov    0x10(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x3,%rax
ja     11fb <draw_final_part+0xcb>
mov    -0x20(%rbp),%rax
lea    0xe6d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   1050 <gs_mysolidline@plt>
jmp    11fb <draw_final_part+0xcb>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   1030 <gs_mydashedline@plt>
jmp    11fb <draw_final_part+0xcb>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   1040 <gs_mydottedline@plt>
jmp    11fb <draw_final_part+0xcb>
jmp    11fb <draw_final_part+0xcb>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_final_part>:
mov    %r8d,%r10d
mov    %esi,%eax
mov    %edi,%esi
mov    0x8(%rsp),%r8d
add    %edx,%esi
mov    %esi,%edi
shr    $0x1f,%edi
add    %esi,%edi
sar    %edi
add    %ecx,%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
cmp    $0x2,%r8d
je     116e <draw_final_part+0x3e>
cmp    $0x1,%r8d
je     1179 <draw_final_part+0x49>
test   %r8d,%r8d
jne    1184 <draw_final_part+0x54>
mov    %r9d,%r8d
mov    %r10d,%r9d
jmp    1050 <gs_mysolidline@plt>
mov    %r9d,%r8d
mov    %r10d,%r9d
jmp    1030 <gs_mydashedline@plt>
mov    %r9d,%r8d
mov    %r10d,%r9d
jmp    1040 <gs_mydottedline@plt>
ret

LLVM IR (-O0):
define void @draw_final_part(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %10
%17 = add nsw i32 %15, %16
%18 = sdiv i32 %17, 2
store i32 %18, i32* %8
%19 = load i32, i32* %9
%20 = load i32, i32* %11
%21 = add nsw i32 %19, %20
%22 = sdiv i32 %21, 2
store i32 %22, i32* %9
%23 = load i32, i32* %14
switch i32 %23, label %49 [
i32 0, label %24
i32 2, label %32
i32 1, label %40
i32 3, label %48
]
24: ; preds = %7
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = load i32, i32* %10
%28 = load i32, i32* %11
%29 = load i32, i32* %13
%30 = load i32, i32* %12
%31 = call i32 @gs_mysolidline(i32 %25, i32 %26, i32 %27, i32 %28, i32 %29, i32 %30)
br label %49
32: ; preds = %7
%33 = load i32, i32* %8
%34 = load i32, i32* %9
%35 = load i32, i32* %10
%36 = load i32, i32* %11
%37 = load i32, i32* %13
%38 = load i32, i32* %12
%39 = call i32 @gs_mydashedline(i32 %33, i32 %34, i32 %35, i32 %36, i32 %37, i32 %38)
br label %49
40: ; preds = %7
%41 = load i32, i32* %8
%42 = load i32, i32* %9
%43 = load i32, i32* %10
%44 = load i32, i32* %11
%45 = load i32, i32* %13
%46 = load i32, i32* %12
%47 = call i32 @gs_mydottedline(i32 %41, i32 %42, i32 %43, i32 %44, i32 %45, i32 %46)
br label %49
48: ; preds = %7
br label %49
49: ; preds = %7, %48, %40, %32, %24
ret void
}

LLVM IR (-O2):
define void @draw_final_part(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = add nsw i32 %2, %0
%9 = sdiv i32 %8, 2
%10 = add nsw i32 %3, %1
%11 = sdiv i32 %10, 2
switch i32 %6, label %18 [
i32 0, label %12
i32 2, label %14
i32 1, label %16
]
12: ; preds = %7
%13 = tail call i32 @gs_mysolidline(i32 %9, i32 %11, i32 %2, i32 %3, i32 %5, i32 %4)
br label %18
14: ; preds = %7
%15 = tail call i32 @gs_mydashedline(i32 %9, i32 %11, i32 %2, i32 %3, i32 %5, i32 %4)
br label %18
16: ; preds = %7
%17 = tail call i32 @gs_mydottedline(i32 %9, i32 %11, i32 %2, i32 %3, i32 %5, i32 %4)
br label %18
18: ; preds = %7, %16, %14, %12
ret void
}