#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*/ set(int, int, int, int, int /*<<< orphan*/, int);
void negative_scaler_horizontal(int ystart) {
  int i;
  for (i = 1; i < 120; i++)
    set(360 - 3 * i, ystart - 240, 360 + 3 * i, ystart + 240, 0, 0x0001);
  for (i = 120; i > 1; i--)
    set(360 - 3 * i, ystart - 240, 360 + 3 * i, ystart + 240, 0, 0x0001);
}


x86 assembly (clang, -O0):
<negative_scaler_horizontal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x78,-0x8(%rbp)
jge    116f <negative_scaler_horizontal+0x5f>
imul   $0x3,-0x8(%rbp),%eax
mov    $0x168,%edi
sub    %eax,%edi
mov    -0x4(%rbp),%esi
sub    $0xf0,%esi
imul   $0x3,-0x8(%rbp),%edx
add    $0x168,%edx
mov    -0x4(%rbp),%ecx
add    $0xf0,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <set@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <negative_scaler_horizontal+0x12>
movl   $0x78,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11c3 <negative_scaler_horizontal+0xb3>
imul   $0x3,-0x8(%rbp),%eax
mov    $0x168,%edi
sub    %eax,%edi
mov    -0x4(%rbp),%esi
sub    $0xf0,%esi
imul   $0x3,-0x8(%rbp),%edx
add    $0x168,%edx
mov    -0x4(%rbp),%ecx
add    $0xf0,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <set@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <negative_scaler_horizontal+0x66>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<negative_scaler_horizontal>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%r15d
lea    -0xf0(%r15),%r14d
add    $0xf0,%r15d
mov    $0x16b,%ebx
mov    $0x165,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <set@plt>
add    $0x3,%ebx
add    $0xfffffffd,%ebp
cmp    $0x2d0,%ebx
jne    1140 <negative_scaler_horizontal+0x30>
mov    $0x79,%r12d
mov    $0x2d0,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %r15d,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <set@plt>
add    $0xffffffff,%r12d
add    $0xfffffffd,%ebp
add    $0x3,%ebx
cmp    $0x2,%r12d
ja     1180 <negative_scaler_horizontal+0x70>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @negative_scaler_horizontal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 120
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul nsw i32 3, %8
%10 = sub nsw i32 360, %9
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 240
%13 = load i32, i32* %3
%14 = mul nsw i32 3, %13
%15 = add nsw i32 360, %14
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 240
%18 = call i32 @set(i32 %10, i32 %12, i32 %15, i32 %17, i32 0, i32 1)
br label %19
19: ; preds = %7
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
store i32 120, i32* %3
br label %23
23: ; preds = %38, %22
%24 = load i32, i32* %3
%25 = icmp sgt i32 %24, 1
br i1 %25, label %26, label %41
26: ; preds = %23
%27 = load i32, i32* %3
%28 = mul nsw i32 3, %27
%29 = sub nsw i32 360, %28
%30 = load i32, i32* %2
%31 = sub nsw i32 %30, 240
%32 = load i32, i32* %3
%33 = mul nsw i32 3, %32
%34 = add nsw i32 360, %33
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 240
%37 = call i32 @set(i32 %29, i32 %31, i32 %34, i32 %36, i32 0, i32 1)
br label %38
38: ; preds = %26
%39 = load i32, i32* %3
%40 = add nsw i32 %39, -1
store i32 %40, i32* %3
br label %23
41: ; preds = %23
ret void
}

LLVM IR (-O2):
define void @negative_scaler_horizontal(i32 %0) {
%2 = add nsw i32 %0, -240
%3 = add nsw i32 %0, 240
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ 1, %1 ], [ %10, %4 ]
%6 = mul nuw nsw i32 %5, 3
%7 = sub nuw nsw i32 360, %6
%8 = add nuw nsw i32 %6, 360
%9 = tail call i32 @set(i32 %7, i32 %2, i32 %8, i32 %3, i32 0, i32 1)
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, 120
br i1 %11, label %12, label %4
12: ; preds = %4, %12
%13 = phi i32 [ %18, %12 ], [ 120, %4 ]
%14 = mul nuw nsw i32 %13, 3
%15 = sub nuw nsw i32 360, %14
%16 = add nuw nsw i32 %14, 360
%17 = tail call i32 @set(i32 %15, i32 %2, i32 %16, i32 %3, i32 0, i32 1)
%18 = add nsw i32 %13, -1
%19 = icmp ugt i32 %13, 2
br i1 %19, label %12, label %20
20: ; preds = %12
ret void
}