#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 __lstat(char *, double *);
scalar_t__ smbw_path(char *);
int smbw_stat(char *, void *);
int /*<<< orphan*/ xstat_convert(int, void *, double *);
int __lxstat(int vers, char *name, void *st) {
  double xx[32];
  int ret;
  if (smbw_path(name)) {
    return smbw_stat(name, st);
  }
  ret = (__lstat(name, xx));
  xstat_convert(vers, st, xx);
  return ret;
}


x86 assembly (clang, -O0):
<__lxstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <smbw_path@plt>
cmp    $0x0,%rax
je     117e <__lxstat+0x3e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <smbw_stat@plt>
mov    %eax,-0x4(%rbp)
jmp    11b0 <__lxstat+0x70>
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1040 <__lstat@plt>
mov    %eax,-0x124(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
lea    -0x120(%rbp),%rdx
call   1060 <xstat_convert@plt>
mov    -0x124(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lxstat>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %edi,%r14d
mov    %rsi,%rdi
call   1050 <smbw_path@plt>
test   %rax,%rax
je     117b <__lxstat+0x3b>
mov    %rbp,%rdi
mov    %rbx,%rsi
add    $0x108,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <smbw_stat@plt>
mov    %rsp,%r15
mov    %rbp,%rdi
mov    %r15,%rsi
call   1040 <__lstat@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1060 <xstat_convert@plt>
mov    %ebp,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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