#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*/ g(long *, long);
scalar_t__ h(long *, long *, long);
int /*<<< orphan*/ j(int);
int /*<<< orphan*/ k(long *);
f() {
  long dx[2055];
  long dy[2055];
  long s1[2055];
  int x, y;
  int i;
  long s;
  for (;;) {
    s = 2055;
    g(s1, s);
    for (i = 0; i < 1; i++)
      ;
    dy[s] = 0x12345;
    for (i = 0; i < 1; i++)
      ;
    if (x != y || h(dx, dy, s) || dx[s] != 0x12345) {
      j(y);
      k(dy);
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0e0,%rsp
movq   $0x807,-0xc0d8(%rbp)
lea    -0xc0c0(%rbp),%rdi
mov    -0xc0d8(%rbp),%rsi
call   1050 <g@plt>
movl   $0x0,-0xc0cc(%rbp)
cmpl   $0x1,-0xc0cc(%rbp)
jge    1199 <f+0x59>
jmp    1185 <f+0x45>
mov    -0xc0cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc0cc(%rbp)
jmp    1173 <f+0x33>
mov    -0xc0d8(%rbp),%rax
movq   $0x12345,-0x8080(%rbp,%rax,8)
movl   $0x0,-0xc0cc(%rbp)
cmpl   $0x1,-0xc0cc(%rbp)
jge    11dc <f+0x9c>
jmp    11c8 <f+0x88>
mov    -0xc0cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc0cc(%rbp)
jmp    11b6 <f+0x76>
mov    -0xc0c4(%rbp),%eax
cmp    -0xc0c8(%rbp),%eax
jne    122b <f+0xeb>
lea    -0x4040(%rbp),%rdi
lea    -0x8080(%rbp),%rsi
mov    -0xc0d8(%rbp),%rdx
call   1040 <h@plt>
cmp    $0x0,%rax
jne    122b <f+0xeb>
mov    -0xc0d8(%rbp),%rax
cmpq   $0x12345,-0x4040(%rbp,%rax,8)
je     1242 <f+0x102>
mov    -0xc0c8(%rbp),%edi
call   1030 <j@plt>
lea    -0x8080(%rbp),%rdi
call   1060 <k@plt>
jmp    114b <f+0xb>

x86 assembly (clang, -O2):
<f>:
push   %r15
push   %r14
push   %rbx
sub    $0xc0c0,%rsp
lea    0x8080(%rsp),%r14
lea    0x4040(%rsp),%r15
mov    %rsp,%rbx
jmp    117d <f+0x3d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <j@plt>
mov    %rbx,%rdi
call   1060 <k@plt>
mov    $0x807,%esi
mov    %r14,%rdi
call   1050 <g@plt>
movq   $0x12345,0x4038(%rsp)
mov    $0x807,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <h@plt>
test   %rax,%rax
jne    1170 <f+0x30>
cmpq   $0x12345,0x8078(%rsp)
je     117d <f+0x3d>
jmp    1170 <f+0x30>

LLVM IR (-O0):
define i32 @f() {
%1 = alloca [2055 x i64]
%2 = alloca [2055 x i64]
%3 = alloca [2055 x i64]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
br label %8
8: ; preds = %49, %0
store i64 2055, i64* %7
%9 = getelementptr inbounds [2055 x i64], [2055 x i64]* %3, i64 0, i64 0
%10 = load i64, i64* %7
%11 = call i32 @g(i64* %9, i64 %10)
store i32 0, i32* %6
br label %12
12: ; preds = %16, %8
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %19
15: ; preds = %12
br label %16
16: ; preds = %15
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %12
19: ; preds = %12
%20 = load i64, i64* %7
%21 = getelementptr inbounds [2055 x i64], [2055 x i64]* %2, i64 0, i64 %20
store i64 74565, i64* %21
store i32 0, i32* %6
br label %22
22: ; preds = %26, %19
%23 = load i32, i32* %6
%24 = icmp slt i32 %23, 1
br i1 %24, label %25, label %29
25: ; preds = %22
br label %26
26: ; preds = %25
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %22
29: ; preds = %22
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = icmp ne i32 %30, %31
br i1 %32, label %44, label %33
33: ; preds = %29
%34 = getelementptr inbounds [2055 x i64], [2055 x i64]* %1, i64 0, i64 0
%35 = getelementptr inbounds [2055 x i64], [2055 x i64]* %2, i64 0, i64 0
%36 = load i64, i64* %7
%37 = call i64 @h(i64* %34, i64* %35, i64 %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %44, label %39
39: ; preds = %33
%40 = load i64, i64* %7
%41 = getelementptr inbounds [2055 x i64], [2055 x i64]* %1, i64 0, i64 %40
%42 = load i64, i64* %41
%43 = icmp ne i64 %42, 74565
br i1 %43, label %44, label %49
44: ; preds = %39, %33, %29
%45 = load i32, i32* %5
%46 = call i32 @j(i32 %45)
%47 = getelementptr inbounds [2055 x i64], [2055 x i64]* %2, i64 0, i64 0
%48 = call i32 @k(i64* %47)
br label %49
49: ; preds = %44, %39
br label %8
}

LLVM IR (-O2):
define i32 @f() {
%1 = alloca [2055 x i64]
%2 = alloca [2055 x i64]
%3 = alloca [2055 x i64]
%4 = bitcast [2055 x i64]* %1 to i8*
%5 = bitcast [2055 x i64]* %2 to i8*
%6 = bitcast [2055 x i64]* %3 to i8*
%7 = getelementptr inbounds [2055 x i64], [2055 x i64]* %3, i64 0, i64 0
%8 = getelementptr inbounds [2055 x i64], [2055 x i64]* %2, i64 0, i64 2055
%9 = getelementptr inbounds [2055 x i64], [2055 x i64]* %1, i64 0, i64 0
%10 = getelementptr inbounds [2055 x i64], [2055 x i64]* %2, i64 0, i64 0
%11 = getelementptr inbounds [2055 x i64], [2055 x i64]* %1, i64 0, i64 2055
br label %12
12: ; preds = %22, %0
%13 = call i32 @g(i64* %7, i64 2055)
store i64 74565, i64* %8
%14 = call i64 @h(i64* %9, i64* %10, i64 2055)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i64, i64* %11
%18 = icmp eq i64 %17, 74565
br i1 %18, label %22, label %19
19: ; preds = %16, %12
%20 = call i32 @j(i32 undef)
%21 = call i32 @k(i64* %10)
br label %22
22: ; preds = %19, %16
br label %12
}