#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int u_long;
typedef TYPE_1__ *res_state;
struct TYPE_3__ {
  int options;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
char *p_option(int);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void fp_resstat(const res_state statp, FILE *file) {
  u_long mask;
  fprintf(file, ";; res options:");
  for (mask = 1; mask != 0; mask <<= 1)
    if (statp->options & mask)
      fprintf(file, " %s", p_option(mask));
  putc('\n', file);
}


x86 assembly (clang, -O0):
<fp_resstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11ad <fp_resstat+0x7d>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0x14(%rbp),%eax
cmp    $0x0,%eax
je     119a <fp_resstat+0x6a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <p_option@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rdx
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    119f <fp_resstat+0x6f>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <fp_resstat+0x29>
mov    -0x10(%rbp),%rsi
mov    $0xa,%edi
call   1040 <putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_resstat>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeac(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1060 <fwrite@plt>
mov    $0x1,%ebp
lea    0xe9e(%rip),%r15
jmp    1184 <fp_resstat+0x44>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %ebp,%ebp
je     11a1 <fp_resstat+0x61>
test   %ebp,(%rbx)
je     1180 <fp_resstat+0x40>
mov    %ebp,%edi
call   1030 <p_option@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1180 <fp_resstat+0x40>
mov    $0xa,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <putc@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@.str = [16 x i8] c";; res options:\00"
@.str.1 = [4 x i8] c" %s\00"
define void @fp_resstat(%struct.TYPE_3__* %0, i32* %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i32*
%5 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %5
br label %8
8: ; preds = %24, %2
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %27
11: ; preds = %8
%12 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = load i32, i32* %5
%16 = and i32 %14, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %11
%19 = load i32*, i32** %4
%20 = load i32, i32* %5
%21 = call i8* @p_option(i32 %20)
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %18, %11
br label %24
24: ; preds = %23
%25 = load i32, i32* %5
%26 = shl i32 %25, 1
store i32 %26, i32* %5
br label %8
27: ; preds = %8
%28 = load i32*, i32** %4
%29 = call i32 @putc(i8 signext 10, i32* %28)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@.str = [16 x i8] c";; res options:\00"
@.str.1 = [4 x i8] c" %s\00"
define void @fp_resstat(%struct.TYPE_3__* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 15, i64 1, i32* %1)
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
br label %5
5: ; preds = %2, %13
%6 = phi i32 [ 1, %2 ], [ %14, %13 ]
%7 = load i32, i32* %4
%8 = and i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = tail call i8* @p_option(i32 %6)
%12 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %5, %10
%14 = shl i32 %6, 1
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %13
%17 = tail call i32 @putc(i8 signext 10, i32* %1)
ret void
}