#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 zint_symbol {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ module_is_set(struct zint_symbol *, int, int);
int /*<<< orphan*/ set_module(struct zint_symbol *, int, int);
int /*<<< orphan*/ unset_module(struct zint_symbol *, int, int);
void rss14_finder_adjust(struct zint_symbol *symbol, int separator_row,
                         int above_below, int finder_start) {
  int i, finder_end;
  int module_row = separator_row + above_below;
  int latch;
  latch = '1';
  for (i = finder_start, finder_end = finder_start + 13; i < finder_end; i++) {
    if (!module_is_set(symbol, module_row, i)) {
      if (latch == '1') {
        set_module(symbol, separator_row, i);
        latch = '0';
      } else {
        unset_module(symbol, separator_row, i);
        latch = '1';
      }
    } else {
      unset_module(symbol, separator_row, i);
      latch = '1';
    }
  }
}


x86 assembly (clang, -O0):
<rss14_finder_adjust>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x31,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11f1 <rss14_finder_adjust+0xc1>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <module_is_set@plt>
cmp    $0x0,%eax
jne    11c8 <rss14_finder_adjust+0x98>
cmpl   $0x31,-0x24(%rbp)
jne    11ad <rss14_finder_adjust+0x7d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <set_module@plt>
movl   $0x30,-0x24(%rbp)
jmp    11c3 <rss14_finder_adjust+0x93>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <unset_module@plt>
movl   $0x31,-0x24(%rbp)
jmp    11de <rss14_finder_adjust+0xae>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <unset_module@plt>
movl   $0x31,-0x24(%rbp)
jmp    11e3 <rss14_finder_adjust+0xb3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1164 <rss14_finder_adjust+0x34>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rss14_finder_adjust>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%r15d
mov    %esi,%r14d
mov    %rdi,%r13
add    %esi,%r15d
lea    0xc(%rbp),%r12d
mov    $0x31,%ebx
jmp    117c <rss14_finder_adjust+0x4c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <unset_module@plt>
mov    $0x31,%ebx
lea    0x1(%rbp),%eax
cmp    %r12d,%ebp
mov    %eax,%ebp
jge    11a6 <rss14_finder_adjust+0x76>
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1040 <module_is_set@plt>
test   %eax,%eax
jne    1160 <rss14_finder_adjust+0x30>
cmp    $0x31,%ebx
jne    1160 <rss14_finder_adjust+0x30>
mov    %r13,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
call   1050 <set_module@plt>
mov    $0x30,%ebx
jmp    1172 <rss14_finder_adjust+0x42>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.zint_symbol = type { i32 }
define void @rss14_finder_adjust(%struct.zint_symbol* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.zint_symbol*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.zint_symbol* %0, %struct.zint_symbol** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
store i32 %15, i32* %11
store i32 49, i32* %12
%16 = load i32, i32* %8
store i32 %16, i32* %9
%17 = load i32, i32* %8
%18 = add nsw i32 %17, 13
store i32 %18, i32* %10
br label %19
19: ; preds = %49, %4
%20 = load i32, i32* %9
%21 = load i32, i32* %10
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %52
23: ; preds = %19
%24 = load %struct.zint_symbol*, %struct.zint_symbol** %5
%25 = load i32, i32* %11
%26 = load i32, i32* %9
%27 = call i32 @module_is_set(%struct.zint_symbol* %24, i32 %25, i32 %26)
%28 = icmp ne i32 %27, 0
br i1 %28, label %43, label %29
29: ; preds = %23
%30 = load i32, i32* %12
%31 = icmp eq i32 %30, 49
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load %struct.zint_symbol*, %struct.zint_symbol** %5
%34 = load i32, i32* %6
%35 = load i32, i32* %9
%36 = call i32 @set_module(%struct.zint_symbol* %33, i32 %34, i32 %35)
store i32 48, i32* %12
br label %42
37: ; preds = %29
%38 = load %struct.zint_symbol*, %struct.zint_symbol** %5
%39 = load i32, i32* %6
%40 = load i32, i32* %9
%41 = call i32 @unset_module(%struct.zint_symbol* %38, i32 %39, i32 %40)
store i32 49, i32* %12
br label %42
42: ; preds = %37, %32
br label %48
43: ; preds = %23
%44 = load %struct.zint_symbol*, %struct.zint_symbol** %5
%45 = load i32, i32* %6
%46 = load i32, i32* %9
%47 = call i32 @unset_module(%struct.zint_symbol* %44, i32 %45, i32 %46)
store i32 49, i32* %12
br label %48
48: ; preds = %43, %42
br label %49
49: ; preds = %48
%50 = load i32, i32* %9
%51 = add nsw i32 %50, 1
store i32 %51, i32* %9
br label %19
52: ; preds = %19
ret void
}

LLVM IR (-O2):
%struct.zint_symbol = type { i32 }
define void @rss14_finder_adjust(%struct.zint_symbol* %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %3, 12
br label %7
7: ; preds = %4, %20
%8 = phi i32 [ 49, %4 ], [ %21, %20 ]
%9 = phi i32 [ %3, %4 ], [ %22, %20 ]
%10 = tail call i32 @module_is_set(%struct.zint_symbol* %0, i32 %5, i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = icmp eq i32 %8, 49
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = tail call i32 @set_module(%struct.zint_symbol* %0, i32 %1, i32 %9)
br label %20
16: ; preds = %12
%17 = tail call i32 @unset_module(%struct.zint_symbol* %0, i32 %1, i32 %9)
br label %20
18: ; preds = %7
%19 = tail call i32 @unset_module(%struct.zint_symbol* %0, i32 %1, i32 %9)
br label %20
20: ; preds = %18, %16, %14
%21 = phi i32 [ 49, %18 ], [ 48, %14 ], [ 49, %16 ]
%22 = add nsw i32 %9, 1
%23 = icmp slt i32 %9, %6
br i1 %23, label %7, label %24
24: ; preds = %20
ret void
}