#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*/ fn1(int);
void fn2(void *p1) {
  int a[7];
  float *b;
  int c, n;
  if (c != p1)
    fn1(1);
  n = 0;
  for (; c; n++) {
    int d;
    if (a[n] != d)
      fn1(n);
  }
  b = p1;
  while (1) {
    *b = 3.40282347e38f;
    if (a[0])
      return;
  }
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movslq -0x3c(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1134 <fn2+0x24>
mov    $0x1,%edi
call   1030 <fn1@plt>
movl   $0x0,-0x40(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     1171 <fn2+0x61>
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x44(%rbp),%eax
je     115e <fn2+0x4e>
mov    -0x40(%rbp),%edi
call   1030 <fn1@plt>
jmp    1163 <fn2+0x53>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    113b <fn2+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movss  0xe7b(%rip),%xmm0
movss  %xmm0,(%rax)
cmpl   $0x0,-0x30(%rbp)
je     1199 <fn2+0x89>
add    $0x50,%rsp
pop    %rbp
ret
jmp    1179 <fn2+0x69>

x86 assembly (clang, -O2):
<fn2>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1123 <fn2+0x13>
mov    $0x1,%edi
call   1030 <fn1@plt>
movl   $0x7f7fffff,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @fn2(i8* %0) {
%2 = alloca i8*
%3 = alloca [7 x i32]
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %2
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = load i8*, i8** %2
%12 = icmp ne i8* %10, %11
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @fn1(i32 1)
br label %15
15: ; preds = %13, %1
store i32 0, i32* %6
br label %16
16: ; preds = %30, %15
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %33
19: ; preds = %16
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = load i32, i32* %7
%25 = icmp ne i32 %23, %24
br i1 %25, label %26, label %29
26: ; preds = %19
%27 = load i32, i32* %6
%28 = call i32 @fn1(i32 %27)
br label %29
29: ; preds = %26, %19
br label %30
30: ; preds = %29
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %16
33: ; preds = %16
%34 = load i8*, i8** %2
%35 = bitcast i8* %34 to float*
store float* %35, float** %4
br label %36
36: ; preds = %33, %42
%37 = load float*, float** %4
store float 0x47EFFFFFE0000000, float* %37
%38 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%39 = load i32, i32* %38
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %36
ret void
42: ; preds = %36
br label %36
}

LLVM IR (-O2):
define void @fn2(i8* writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fn1(i32 1)
br label %5
5: ; preds = %3, %1
%6 = bitcast i8* %0 to float*
store float 0x47EFFFFFE0000000, float* %6
ret void
}