#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 real_stat64(char *, void *);
scalar_t__ smbw_path(char *);
int stat(char *, double *);
int /*<<< orphan*/ stat64_convert(double *, void *);
int stat64(char *name, void *st64) {
  if (smbw_path(name)) {
    double xx[32];
    int ret = stat(name, xx);
    stat64_convert(xx, st64);
    return ret;
  }
  return real_stat64(name, st64);
}


x86 assembly (clang, -O0):
<stat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <smbw_path@plt>
cmp    $0x0,%rax
je     119a <stat64+0x5a>
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x124(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <stat64_convert@plt>
mov    -0x124(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11aa <stat64+0x6a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <real_stat64@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat64>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <smbw_path@plt>
test   %rax,%rax
je     1186 <stat64+0x46>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <stat@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <stat64_convert@plt>
mov    %ebx,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <real_stat64@plt>

LLVM IR (-O0):
define i32 @stat64(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [32 x double]
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i64 @smbw_path(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [32 x double], [32 x double]* %6, i64 0, i64 0
%14 = call i32 @stat(i8* %12, double* %13)
store i32 %14, i32* %7
%15 = getelementptr inbounds [32 x double], [32 x double]* %6, i64 0, i64 0
%16 = load i8*, i8** %5
%17 = call i32 @stat64_convert(double* %15, i8* %16)
%18 = load i32, i32* %7
store i32 %18, i32* %3
br label %23
19: ; preds = %2
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = call i32 @real_stat64(i8* %20, i8* %21)
store i32 %22, i32* %3
br label %23
23: ; preds = %19, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @stat64(i8* %0, i8* %1) {
%3 = alloca [32 x double]
%4 = tail call i64 @smbw_path(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = bitcast [32 x double]* %3 to i8*
%8 = getelementptr inbounds [32 x double], [32 x double]* %3, i64 0, i64 0
%9 = call i32 @stat(i8* %0, double* %8)
%10 = call i32 @stat64_convert(double* %8, i8* %1)
br label %13
11: ; preds = %2
%12 = tail call i32 @real_stat64(i8* %0, i8* %1)
br label %13
13: ; preds = %11, %6
%14 = phi i32 [ %9, %6 ], [ %12, %11 ]
ret i32 %14
}