#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 /*<<< orphan*/ LC_ALL;
int atoi(char *);
int /*<<< orphan*/ bindtextdomain(char *, char *);
char *gettext(char *);
char *ngettext(char *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
char *setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ textdomain(char *);
int main(int argc, char *argv[]) {
  char *ptr;
  int num;
  ptr = setlocale(LC_ALL, "");
  if (ptr == NULL) {
    printf(gettext("Can't set locale!\n"));
    return 1;
  }
  bindtextdomain("file", "locale");
  textdomain("file");
  if (argc < 2) {
    printf(gettext("You need to specify number of files!\n"));
    return 1;
  }
  num = atoi(argv[1]);
  if (num <= 0)
    printf(gettext("No change!\n"));
  else
    printf(ngettext("%d file deleted!\n", "%d files deleted!\n", num), num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1070 <setlocale@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11cc <main+0x5c>
lea    0xe4f(%rip),%rdi
call   1050 <gettext@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1276 <main+0x106>
lea    0xe40(%rip),%rdi
lea    0xe3e(%rip),%rsi
call   1040 <bindtextdomain@plt>
lea    0xe2d(%rip),%rdi
call   1030 <textdomain@plt>
cmpl   $0x2,-0x8(%rbp)
jge    1217 <main+0xa7>
lea    0xe23(%rip),%rdi
call   1050 <gettext@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1276 <main+0x106>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     124c <main+0xdc>
lea    0xe0d(%rip),%rdi
call   1050 <gettext@plt>
mov    %rax,%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    126f <main+0xff>
mov    -0x1c(%rbp),%edx
lea    0xdfb(%rip),%rdi
lea    0xe06(%rip),%rsi
call   1090 <ngettext@plt>
mov    %rax,%rdi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
call   1070 <setlocale@plt>
test   %rax,%rax
je     11bf <main+0x4f>
lea    0xe79(%rip),%rbx
lea    0xe77(%rip),%rsi
mov    %rbx,%rdi
call   1040 <bindtextdomain@plt>
mov    %rbx,%rdi
call   1030 <textdomain@plt>
cmp    $0x1,%ebp
jg     11dc <main+0x6c>
lea    0xe62(%rip),%rdi
jmp    11c6 <main+0x56>
lea    0xe3a(%rip),%rdi
call   1050 <gettext@plt>
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebx
jmp    1228 <main+0xb8>
mov    0x8(%r14),%rdi
call   1080 <atoi@plt>
test   %eax,%eax
jle    1210 <main+0xa0>
mov    %eax,%ebp
lea    0xe5f(%rip),%rdi
lea    0xe6a(%rip),%rsi
mov    %eax,%edx
call   1090 <ngettext@plt>
xor    %ebx,%ebx
mov    %rax,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1228 <main+0xb8>
lea    0xe2e(%rip),%rdi
call   1050 <gettext@plt>
xor    %ebx,%ebx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [19 x i8] c"Can't set locale!\0A\00"
@.str.2 = [5 x i8] c"file\00"
@.str.3 = [7 x i8] c"locale\00"
@.str.4 = [38 x i8] c"You need to specify number of files!\0A\00"
@.str.5 = [12 x i8] c"No change!\0A\00"
@.str.6 = [18 x i8] c"%d file deleted!\0A\00"
@.str.7 = [19 x i8] c"%d files deleted!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @LC_ALL
%9 = call i8* @setlocale(i32 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i8* @gettext(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* %13)
store i32 1, i32* %3
br label %39
15: ; preds = %2
%16 = call i32 @bindtextdomain(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @textdomain(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 2
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = call i8* @gettext(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* %21)
store i32 1, i32* %3
br label %39
23: ; preds = %15
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
store i32 %27, i32* %7
%28 = load i32, i32* %7
%29 = icmp sle i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %23
%31 = call i8* @gettext(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* %31)
br label %38
33: ; preds = %23
%34 = load i32, i32* %7
%35 = call i8* @ngettext(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %7
%37 = call i32 (i8*, ...) @printf(i8* %35, i32 %36)
br label %38
38: ; preds = %33, %30
store i32 0, i32* %3
br label %39
39: ; preds = %38, %20, %12
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [19 x i8] c"Can't set locale!\0A\00"
@.str.2 = [5 x i8] c"file\00"
@.str.3 = [7 x i8] c"locale\00"
@.str.4 = [38 x i8] c"You need to specify number of files!\0A\00"
@.str.5 = [12 x i8] c"No change!\0A\00"
@.str.6 = [18 x i8] c"%d file deleted!\0A\00"
@.str.7 = [19 x i8] c"%d files deleted!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @LC_ALL
%4 = tail call i8* @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i8* @gettext(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7)
br label %27
9: ; preds = %2
%10 = tail call i32 @bindtextdomain(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 @textdomain(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp slt i32 %0, 2
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = tail call i8* @gettext(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %14)
br label %27
16: ; preds = %9
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = tail call i32 @atoi(i8* %18)
%20 = icmp slt i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = tail call i8* @gettext(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %22)
br label %27
24: ; preds = %16
%25 = tail call i8* @ngettext(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %19)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %25, i32 %19)
br label %27
27: ; preds = %21, %24, %13, %6
%28 = phi i32 [ 1, %6 ], [ 1, %13 ], [ 0, %24 ], [ 0, %21 ]
ret i32 %28
}