#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*/ fprintf(int /*<<< orphan*/, char *, char const *);
int rewind_file(char const *);
int /*<<< orphan*/ stderr;
int f_rewind_init(int mode, unsigned char **sec, float *data,
                  unsigned int ndata, char *inv_out, void **local,
                  const char *arg1) {
  int i;
  if (mode == -1) {
    i = rewind_file(arg1);
    if (i)
      fprintf(stderr, "WARNING: -rewind_init failed on %s\n", arg1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_rewind_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1180 <f_rewind_init+0x60>
mov    0x10(%rbp),%rdi
call   1040 <rewind_file@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     117b <f_rewind_init+0x5b>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1180 <f_rewind_init+0x60>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_rewind_init>:
push   %rbx
cmp    $0xffffffff,%edi
jne    114f <f_rewind_init+0x2f>
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <rewind_file@plt>
test   %eax,%eax
je     114f <f_rewind_init+0x2f>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"WARNING: -rewind_init failed on %s\0A\00"
define i32 @f_rewind_init(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6) {
%8 = alloca i32
%9 = alloca i8**
%10 = alloca float*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8**
%14 = alloca i8*
%15 = alloca i32
store i32 %0, i32* %8
store i8** %1, i8*** %9
store float* %2, float** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8** %5, i8*** %13
store i8* %6, i8** %14
%16 = load i32, i32* %8
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %28
18: ; preds = %7
%19 = load i8*, i8** %14
%20 = call i32 @rewind_file(i8* %19)
store i32 %20, i32* %15
%21 = load i32, i32* %15
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %18
%24 = load i32, i32* @stderr
%25 = load i8*, i8** %14
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %23, %18
br label %28
28: ; preds = %27, %7
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"WARNING: -rewind_init failed on %s\0A\00"
define i32 @f_rewind_init(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5, i8* %6) {
%8 = icmp eq i32 %0, -1
br i1 %8, label %9, label %15
9: ; preds = %7
%10 = tail call i32 @rewind_file(i8* %6)
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %15
15: ; preds = %9, %12, %7
ret i32 0
}