// File: zgimbutas[P]mwrap/src/mwrap-ast.cc
// Function: promote_int(char*)
char *promote_int(char* name)
{
  /* Detect C99 types: int32_t, int64_t, uint32_t, uint64_t */
  if( strcmp(name,"int32_t") == 0 ) mw_use_int32_t = 1;
  if( strcmp(name,"int64_t") == 0 ) mw_use_int64_t = 1;
  if( strcmp(name,"uint32_t") == 0 ) mw_use_uint32_t = 1;
  if( strcmp(name,"uint64_t") == 0 ) mw_use_uint64_t = 1;

  if( strcmp(name,"ulong") == 0 ) mw_use_ulong = 1;
  if( strcmp(name,"uint") == 0 ) mw_use_uint = 1;
  if( strcmp(name,"ushort") == 0 ) mw_use_ushort = 1;
  if( strcmp(name,"uchar") == 0 ) mw_use_uchar = 1;

  /* Promote integers */
  if( mw_promote_int == 1 )
    {      
      if( strcmp(name,"uint") == 0 ) mw_use_ulong = 1;
      if( strcmp(name,"int") == 0 ) return strdup("long");
      if( strcmp(name,"uint") == 0 ) return strdup("ulong");
    }
  if( mw_promote_int == 2 )
    {      
      if( strcmp(name,"uint") == 0 ) mw_use_ulong = 1;
      if( strcmp(name,"ulong") == 0 ) mw_use_ulong = 1;
      if( strcmp(name,"int") == 0 ) return strdup("long");
      if( strcmp(name,"long") == 0 ) return strdup("long");
      if( strcmp(name,"uint") == 0 ) return strdup("ulong");
      if( strcmp(name,"ulong") == 0 ) return strdup("ulong");
    }
  if( mw_promote_int == 3 )
    {      
      if( strcmp(name,"int") == 0 ) mw_use_int32_t = 1;
      if( strcmp(name,"long") == 0 ) mw_use_int64_t = 1;
      if( strcmp(name,"uint") == 0 ) mw_use_uint32_t = 1;
      if( strcmp(name,"ulong") == 0 ) mw_use_uint64_t = 1;
      if( strcmp(name,"int") == 0 ) return strdup("int32_t");
      if( strcmp(name,"long") == 0 ) return strdup("int32_t");
      if( strcmp(name,"uint") == 0 ) return strdup("uint64_t");
      if( strcmp(name,"ulong") == 0 ) return strdup("uint64_t");
    }
  if( mw_promote_int == 4 )
    {      
      if( strcmp(name,"int") == 0 ) mw_use_int64_t = 1;
      if( strcmp(name,"long") == 0 ) mw_use_int64_t = 1;
      if( strcmp(name,"uint") == 0 ) mw_use_uint64_t = 1;
      if( strcmp(name,"ulong") == 0 ) mw_use_uint64_t = 1;
      if( strcmp(name,"int") == 0 ) return strdup("int64_t");
      if( strcmp(name,"long") == 0 ) return strdup("int64_t");
      if( strcmp(name,"uint") == 0 ) return strdup("uint64_t");
      if( strcmp(name,"ulong") == 0 ) return strdup("uint64_t");
    }
  return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xd24b(%rip), %rsi      # 0x14b42
callq 0x3390
cmpl $0x0, %eax
jne 0x790e
leaq 0x1d9d0(%rip), %rax     # 0x252d8
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd232(%rip), %rsi      # 0x14b4b
callq 0x3390
cmpl $0x0, %eax
jne 0x7930
leaq 0x1d9b2(%rip), %rax     # 0x252dc
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd206(%rip), %rsi      # 0x14b41
callq 0x3390
cmpl $0x0, %eax
jne 0x7952
leaq 0x1d994(%rip), %rax     # 0x252e0
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd1ed(%rip), %rsi      # 0x14b4a
callq 0x3390
cmpl $0x0, %eax
jne 0x7974
leaq 0x1d976(%rip), %rax     # 0x252e4
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd1aa(%rip), %rsi      # 0x14b29
callq 0x3390
cmpl $0x0, %eax
jne 0x7996
leaq 0x1d958(%rip), %rax     # 0x252e8
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd18e(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0x79b8
leaq 0x1d93a(%rip), %rax     # 0x252ec
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd171(%rip), %rsi      # 0x14b34
callq 0x3390
cmpl $0x0, %eax
jne 0x79da
leaq 0x1d91c(%rip), %rax     # 0x252f0
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd156(%rip), %rsi      # 0x14b3b
callq 0x3390
cmpl $0x0, %eax
jne 0x79fc
leaq 0x1d8fe(%rip), %rax     # 0x252f4
movl $0x1, (%rax)
leaq 0x1d8d1(%rip), %rax     # 0x252d4
cmpl $0x1, (%rax)
jne 0x7a80
movq -0x10(%rbp), %rdi
leaq 0xd11c(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0x7a2a
leaq 0x1d8c4(%rip), %rax     # 0x252e8
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd0fb(%rip), %rsi      # 0x14b30
callq 0x3390
cmpl $0x0, %eax
jne 0x7a54
leaq 0xd0e4(%rip), %rdi      # 0x14b2a
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xd0d0(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0x7a7e
leaq 0xd0b9(%rip), %rdi      # 0x14b29
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
jmp 0x7a80
leaq 0x1d84d(%rip), %rax     # 0x252d4
cmpl $0x2, (%rax)
jne 0x7b7e
movq -0x10(%rbp), %rdi
leaq 0xd094(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0x7ab2
leaq 0x1d83c(%rip), %rax     # 0x252e8
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd06c(%rip), %rsi      # 0x14b29
callq 0x3390
cmpl $0x0, %eax
jne 0x7ad4
leaq 0x1d81a(%rip), %rax     # 0x252e8
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xd051(%rip), %rsi      # 0x14b30
callq 0x3390
cmpl $0x0, %eax
jne 0x7afe
leaq 0xd03a(%rip), %rdi      # 0x14b2a
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xd021(%rip), %rsi      # 0x14b2a
callq 0x3390
cmpl $0x0, %eax
jne 0x7b28
leaq 0xd010(%rip), %rdi      # 0x14b2a
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xcffc(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0x7b52
leaq 0xcfe5(%rip), %rdi      # 0x14b29
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xcfcc(%rip), %rsi      # 0x14b29
callq 0x3390
cmpl $0x0, %eax
jne 0x7b7c
leaq 0xcfbb(%rip), %rdi      # 0x14b29
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
jmp 0x7b7e
leaq 0x1d74f(%rip), %rax     # 0x252d4
cmpl $0x3, (%rax)
jne 0x7cc0
movq -0x10(%rbp), %rdi
leaq 0xcf97(%rip), %rsi      # 0x14b30
callq 0x3390
cmpl $0x0, %eax
jne 0x7bb0
leaq 0x1d72e(%rip), %rax     # 0x252d8
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xcf6f(%rip), %rsi      # 0x14b2a
callq 0x3390
cmpl $0x0, %eax
jne 0x7bd2
leaq 0x1d710(%rip), %rax     # 0x252dc
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xcf52(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0x7bf4
leaq 0x1d6f2(%rip), %rax     # 0x252e0
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xcf2a(%rip), %rsi      # 0x14b29
callq 0x3390
cmpl $0x0, %eax
jne 0x7c16
leaq 0x1d6d4(%rip), %rax     # 0x252e4
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xcf0f(%rip), %rsi      # 0x14b30
callq 0x3390
cmpl $0x0, %eax
jne 0x7c40
leaq 0xcf10(%rip), %rdi      # 0x14b42
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xcedf(%rip), %rsi      # 0x14b2a
callq 0x3390
cmpl $0x0, %eax
jne 0x7c6a
leaq 0xcee6(%rip), %rdi      # 0x14b42
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xceba(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0x7c94
leaq 0xcec4(%rip), %rdi      # 0x14b4a
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xce8a(%rip), %rsi      # 0x14b29
callq 0x3390
cmpl $0x0, %eax
jne 0x7cbe
leaq 0xce9a(%rip), %rdi      # 0x14b4a
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
jmp 0x7cc0
leaq 0x1d60d(%rip), %rax     # 0x252d4
cmpl $0x4, (%rax)
jne 0x7df6
movq -0x10(%rbp), %rdi
leaq 0xce55(%rip), %rsi      # 0x14b30
callq 0x3390
cmpl $0x0, %eax
jne 0x7cf2
leaq 0x1d5f0(%rip), %rax     # 0x252dc
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xce2d(%rip), %rsi      # 0x14b2a
callq 0x3390
cmpl $0x0, %eax
jne 0x7d14
leaq 0x1d5ce(%rip), %rax     # 0x252dc
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xce10(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0x7d36
leaq 0x1d5b4(%rip), %rax     # 0x252e4
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xcde8(%rip), %rsi      # 0x14b29
callq 0x3390
cmpl $0x0, %eax
jne 0x7d58
leaq 0x1d592(%rip), %rax     # 0x252e4
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
leaq 0xcdcd(%rip), %rsi      # 0x14b30
callq 0x3390
cmpl $0x0, %eax
jne 0x7d7f
leaq 0xcdd7(%rip), %rdi      # 0x14b4b
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xcda0(%rip), %rsi      # 0x14b2a
callq 0x3390
cmpl $0x0, %eax
jne 0x7da6
leaq 0xcdb0(%rip), %rdi      # 0x14b4b
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xcd7e(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0x7dcd
leaq 0xcd88(%rip), %rdi      # 0x14b4a
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
movq -0x10(%rbp), %rdi
leaq 0xcd51(%rip), %rsi      # 0x14b29
callq 0x3390
cmpl $0x0, %eax
jne 0x7df4
leaq 0xcd61(%rip), %rdi      # 0x14b4a
callq 0x3460
movq %rax, -0x8(%rbp)
jmp 0x7dfe
jmp 0x7df6
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)