#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *get_array1(int *, int);
int /*<<< orphan*/ stderr;
void rd_dangle(int dangle[7 + 1][5]) {
  int i;
  char *cp;
  for (i = 0; i < 7 + 1; i++) {
    cp = get_array1(dangle[i], 5);
    if (cp) {
      fprintf(stderr, "\nrd_dangle: %s\n", cp);
      exit(1);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<rd_dangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    11ab <rd_dangle+0x7b>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rdi
mov    $0x5,%esi
call   1040 <get_array1@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1198 <rd_dangle+0x68>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe77(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    119d <rd_dangle+0x6d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <rd_dangle+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_dangle>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%esi
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11d4 <rd_dangle+0xa4>
lea    0x14(%rbx),%rdi
mov    $0x5,%esi
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11d4 <rd_dangle+0xa4>
lea    0x28(%rbx),%rdi
mov    $0x5,%esi
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11d4 <rd_dangle+0xa4>
lea    0x3c(%rbx),%rdi
mov    $0x5,%esi
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11d4 <rd_dangle+0xa4>
lea    0x50(%rbx),%rdi
mov    $0x5,%esi
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11d4 <rd_dangle+0xa4>
lea    0x64(%rbx),%rdi
mov    $0x5,%esi
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11d4 <rd_dangle+0xa4>
lea    0x78(%rbx),%rdi
mov    $0x5,%esi
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11d4 <rd_dangle+0xa4>
add    $0x8c,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11d4 <rd_dangle+0xa4>
pop    %rbx
ret
mov    0x2e05(%rip),%rcx
mov    (%rcx),%edi
lea    0xe1c(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"\0Ard_dangle: %s\0A\00"
define void @rd_dangle([5 x i32]* %0) {
%2 = alloca [5 x i32]*
%3 = alloca i32
%4 = alloca i8*
store [5 x i32]* %0, [5 x i32]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %23, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load [5 x i32]*, [5 x i32]** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 %11
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i64 0, i64 0
%14 = call i8* @get_array1(i32* %13, i32 5)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %22
17: ; preds = %8
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %4
%20 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %8
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %5
26: ; preds = %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"\0Ard_dangle: %s\0A\00"
define void @rd_dangle([5 x i32]* %0) {
%2 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 0, i64 0
%3 = tail call i8* @get_array1(i32* %2, i32 5)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %34
5: ; preds = %1
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 1, i64 0
%7 = tail call i8* @get_array1(i32* %6, i32 5)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %34
9: ; preds = %5
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 2, i64 0
%11 = tail call i8* @get_array1(i32* %10, i32 5)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %34
13: ; preds = %9
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 3, i64 0
%15 = tail call i8* @get_array1(i32* %14, i32 5)
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %34
17: ; preds = %13
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 4, i64 0
%19 = tail call i8* @get_array1(i32* %18, i32 5)
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %34
21: ; preds = %17
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 5, i64 0
%23 = tail call i8* @get_array1(i32* %22, i32 5)
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %34
25: ; preds = %21
%26 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 6, i64 0
%27 = tail call i8* @get_array1(i32* %26, i32 5)
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 7, i64 0
%31 = tail call i8* @get_array1(i32* %30, i32 5)
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %34
33: ; preds = %29
ret void
34: ; preds = %29, %25, %21, %17, %13, %9, %5, %1
%35 = phi i8* [ %3, %1 ], [ %7, %5 ], [ %11, %9 ], [ %15, %13 ], [ %19, %17 ], [ %23, %21 ], [ %27, %25 ], [ %31, %29 ]
%36 = load i32, i32* @stderr
%37 = tail call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %35)
%38 = tail call i32 @exit(i32 1)
unreachable
}