#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 *mon_decimal_point;
  char *currency_symbol;
  char *positive_sign;
  char *thousands_sep;
};

/* Variables and functions */
struct lconv *localeconv();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  struct lconv *env = localeconv();
  printf("decimal_point=%s\n", env->decimal_point);
  printf("mon_decimal_point=%s\n", env->mon_decimal_point);
  printf("currency_symbol=%s\n", env->currency_symbol);
  printf("positive_sign=%s\n", env->positive_sign);
  printf("thousands_sep=%s\n", env->thousands_sep);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <localeconv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <localeconv@plt>
mov    %rax,%rbx
mov    (%rax),%rsi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    0x10(%rbx),%rsi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    0x18(%rbx),%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    0x20(%rbx),%rsi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.lconv = type { i8*, i8*, i8*, i8*, i8* }
@.str = [18 x i8] c"decimal_point=%s\0A\00"
@.str.1 = [22 x i8] c"mon_decimal_point=%s\0A\00"
@.str.2 = [20 x i8] c"currency_symbol=%s\0A\00"
@.str.3 = [18 x i8] c"positive_sign=%s\0A\00"
@.str.4 = [18 x i8] c"thousands_sep=%s\0A\00"
define i32 @main() {
%1 = alloca %struct.lconv*
%2 = call %struct.lconv* (...) @localeconv()
store %struct.lconv* %2, %struct.lconv** %1
%3 = load %struct.lconv*, %struct.lconv** %1
%4 = getelementptr inbounds %struct.lconv, %struct.lconv* %3, i32 0, i32 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load %struct.lconv*, %struct.lconv** %1
%8 = getelementptr inbounds %struct.lconv, %struct.lconv* %7, i32 0, i32 1
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load %struct.lconv*, %struct.lconv** %1
%12 = getelementptr inbounds %struct.lconv, %struct.lconv* %11, i32 0, i32 2
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = load %struct.lconv*, %struct.lconv** %1
%16 = getelementptr inbounds %struct.lconv, %struct.lconv* %15, i32 0, i32 3
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = load %struct.lconv*, %struct.lconv** %1
%20 = getelementptr inbounds %struct.lconv, %struct.lconv* %19, i32 0, i32 4
%21 = load i8*, i8** %20
%22 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %21)
ret i32 0
}

LLVM IR (-O2):
%struct.lconv = type { i8*, i8*, i8*, i8*, i8* }
@.str = [18 x i8] c"decimal_point=%s\0A\00"
@.str.1 = [22 x i8] c"mon_decimal_point=%s\0A\00"
@.str.2 = [20 x i8] c"currency_symbol=%s\0A\00"
@.str.3 = [18 x i8] c"positive_sign=%s\0A\00"
@.str.4 = [18 x i8] c"thousands_sep=%s\0A\00"
define i32 @main() {
%1 = tail call %struct.lconv* (...) @localeconv()
%2 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 1
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 2
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 3
%12 = load i8*, i8** %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds %struct.lconv, %struct.lconv* %1, i64 0, i32 4
%15 = load i8*, i8** %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %15)
ret i32 0
}