#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 */
typedef int /*<<< orphan*/ mesg;

/* Variables and functions */
scalar_t__ PyErr_Occurred();
int SWIG_Python_AddErrMesg(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
__attribute__((unused)) int SWIG_Python_ArgFail(int argnum) {
  if (PyErr_Occurred()) {
    char mesg[256];
    snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
    return SWIG_Python_AddErrMesg(mesg, 1);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<SWIG_Python_ArgFail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <PyErr_Occurred@plt>
cmp    $0x0,%rax
je     1183 <SWIG_Python_ArgFail+0x53>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x100,%esi
lea    0xe9b(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x1,%esi
call   1030 <SWIG_Python_AddErrMesg@plt>
mov    %eax,-0x4(%rbp)
jmp    118a <SWIG_Python_ArgFail+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWIG_Python_ArgFail>:
push   %rbp
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <PyErr_Occurred@plt>
test   %rax,%rax
je     1171 <SWIG_Python_ArgFail+0x41>
lea    0xeb0(%rip),%rdx
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %ebx,%ecx
call   1040 <snprintf@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
call   1030 <SWIG_Python_AddErrMesg@plt>
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x108,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"argument number %d:\00"
define i32 @SWIG_Python_ArgFail(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
store i32 %0, i32* %3
%5 = call i64 (...) @PyErr_Occurred()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @snprintf(i8* %8, i32 256, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%12 = call i32 @SWIG_Python_AddErrMesg(i8* %11, i32 1)
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [20 x i8] c"argument number %d:\00"
define i32 @SWIG_Python_ArgFail(i32 %0) {
%2 = alloca [256 x i8]
%3 = tail call i64 (...) @PyErr_Occurred()
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = call i32 @SWIG_Python_AddErrMesg(i8* %6, i32 1)
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}