#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 */
struct lconv {
  char *decimal_point;
  char *thousands_sep;
  char *grouping;
  char *int_curr_symbol;
  char *currency_symbol;
  char *mon_decimal_point;
  char *mon_thousands_sep;
  char *mon_grouping;
  char *positive_sign;
  char *negative_sign;
};

/* Variables and functions */
struct lconv *localeconv();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  struct lconv *locale = localeconv();
  printf("Testing locale information.\n");
  printf("Decimal point: %s\n", locale->decimal_point);
  printf("Thousands separator: %s\n", locale->thousands_sep);
  printf("Grouping: %s\n", locale->grouping);
  printf("International currency symbol: %s\n", locale->int_curr_symbol);
  printf("Currency symbol: %s\n", locale->currency_symbol);
  printf("Money decimal point: %s\n", locale->mon_decimal_point);
  printf("Money thousands separator: %s\n", locale->mon_thousands_sep);
  printf("Money Grouping: %s\n", locale->mon_grouping);
  printf("Positive sign: %s\n", locale->positive_sign);
  printf("Negative sign: %s\n", locale->negative_sign);
  printf("Locale tests passed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <localeconv@plt>
mov    %rax,-0x10(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xf3d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x48(%rax),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <localeconv@plt>
mov    %rax,%rbx
lea    0xf94(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rbx),%rsi
lea    0xf2d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rbx),%rsi
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rbx),%rsi
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rbx),%rsi
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x30(%rbx),%rsi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x38(%rbx),%rsi
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x40(%rbx),%rsi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x48(%rbx),%rsi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.lconv = type { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8* }
@.str = [29 x i8] c"Testing locale information.\0A\00"
@.str.1 = [19 x i8] c"Decimal point: %s\0A\00"
@.str.2 = [25 x i8] c"Thousands separator: %s\0A\00"
@.str.3 = [14 x i8] c"Grouping: %s\0A\00"
@.str.4 = [35 x i8] c"International currency symbol: %s\0A\00"
@.str.5 = [21 x i8] c"Currency symbol: %s\0A\00"
@.str.6 = [25 x i8] c"Money decimal point: %s\0A\00"
@.str.7 = [31 x i8] c"Money thousands separator: %s\0A\00"
@.str.8 = [20 x i8] c"Money Grouping: %s\0A\00"
@.str.9 = [19 x i8] c"Positive sign: %s\0A\00"
@.str.10 = [19 x i8] c"Negative sign: %s\0A\00"
@.str.11 = [22 x i8] c"Locale tests passed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.lconv*
store i32 0, i32* %1
%3 = call %struct.lconv* (...) @localeconv()
store %struct.lconv* %3, %struct.lconv** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.lconv*, %struct.lconv** %2
%6 = getelementptr inbounds %struct.lconv, %struct.lconv* %5, i32 0, i32 0
%7 = load i8*, i8** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load %struct.lconv*, %struct.lconv** %2
%10 = getelementptr inbounds %struct.lconv, %struct.lconv* %9, i32 0, i32 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load %struct.lconv*, %struct.lconv** %2
%14 = getelementptr inbounds %struct.lconv, %struct.lconv* %13, i32 0, i32 2
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = load %struct.lconv*, %struct.lconv** %2
%18 = getelementptr inbounds %struct.lconv, %struct.lconv* %17, i32 0, i32 3
%19 = load i8*, i8** %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* %19)
%21 = load %struct.lconv*, %struct.lconv** %2
%22 = getelementptr inbounds %struct.lconv, %struct.lconv* %21, i32 0, i32 4
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %23)
%25 = load %struct.lconv*, %struct.lconv** %2
%26 = getelementptr inbounds %struct.lconv, %struct.lconv* %25, i32 0, i32 5
%27 = load i8*, i8** %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %27)
%29 = load %struct.lconv*, %struct.lconv** %2
%30 = getelementptr inbounds %struct.lconv, %struct.lconv* %29, i32 0, i32 6
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* %31)
%33 = load %struct.lconv*, %struct.lconv** %2
%34 = getelementptr inbounds %struct.lconv, %struct.lconv* %33, i32 0, i32 7
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* %35)
%37 = load %struct.lconv*, %struct.lconv** %2
%38 = getelementptr inbounds %struct.lconv, %struct.lconv* %37, i32 0, i32 8
%39 = load i8*, i8** %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %39)
%41 = load %struct.lconv*, %struct.lconv** %2
%42 = getelementptr inbounds %struct.lconv, %struct.lconv* %41, i32 0, i32 9
%43 = load i8*, i8** %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* %43)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.lconv = type { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8* }
@.str.1 = [19 x i8] c"Decimal point: %s\0A\00"
@.str.2 = [25 x i8] c"Thousands separator: %s\0A\00"
@.str.3 = [14 x i8] c"Grouping: %s\0A\00"
@.str.4 = [35 x i8] c"International currency symbol: %s\0A\00"
@.str.5 = [21 x i8] c"Currency symbol: %s\0A\00"
@.str.6 = [25 x i8] c"Money decimal point: %s\0A\00"
@.str.7 = [31 x i8] c"Money thousands separator: %s\0A\00"
@.str.8 = [20 x i8] c"Money Grouping: %s\0A\00"
@.str.9 = [19 x i8] c"Positive sign: %s\0A\00"
@.str.10 = [19 x i8] c"Negative sign: %s\0A\00"
@str = [28 x i8] c"Testing locale information.\00"
@str.12 = [21 x i8] c"Locale tests passed.\00"
define i32 @main() {
%1 = tail call %struct.lconv* (...) @localeconv()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 0
%4 = load i8*, i8** %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 1
%7 = load i8*, i8** %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 2
%10 = load i8*, i8** %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 3
%13 = load i8*, i8** %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 4
%16 = load i8*, i8** %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 5
%19 = load i8*, i8** %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 6
%22 = load i8*, i8** %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 7
%25 = load i8*, i8** %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 8
%28 = load i8*, i8** %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 9
%31 = load i8*, i8** %30
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* %31)
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
ret i32 0
}