#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*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ gmp_printf(char *, char *, int, int /*<<< orphan*/);
int mpz_init_set_str(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  mpz_t a, b;
  if (argc != 2) {
    printf("usage: PROG NUM\n");
    return 1;
  }
  char *s = argv[1];
  int i = mpz_init_set_str(a, s, 10);
  gmp_printf("s: `%s'\ni: %d\n%Zx\n", s, i, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <main+0x75>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1040 <mpz_init_set_str@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe78(%rip),%rdi
call   1050 <gmp_printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    115c <main+0x2c>
mov    0x8(%rsi),%rbx
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <mpz_init_set_str@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <gmp_printf@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"usage: PROG NUM\0A\00"
@.str.1 = [19 x i8] c"s: `%s'\0Ai: %d\0A%Zx\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %25
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
store i8* %17, i8** %8
%18 = load i32, i32* %6
%19 = load i8*, i8** %8
%20 = call i32 @mpz_init_set_str(i32 %18, i8* %19, i32 10)
store i32 %20, i32* %9
%21 = load i8*, i8** %8
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = call i32 @gmp_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %21, i32 %22, i32 %23)
store i32 0, i32* %3
br label %25
25: ; preds = %14, %12
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"s: `%s'\0Ai: %d\0A%Zx\0A\00"
@str = [16 x i8] c"usage: PROG NUM\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @mpz_init_set_str(i32 undef, i8* %8, i32 10)
%10 = tail call i32 @gmp_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %9, i32 undef)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %12
}