xunge/DecIR huggingface dataset:
/* Type definitions */
struct rds_encoder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rds_send_byte(struct rds_encoder *, int);
int prais_send_ack_to_enc(struct rds_encoder *enc) {
  rds_send_byte(enc, 0x16);
  rds_send_byte(enc, 0x16);
  rds_send_byte(enc, 0x06);
  rds_send_byte(enc, 0x16);
  rds_send_byte(enc, 0);
  return 0;
}


x86 assembly (clang, -O0):
<prais_send_ack_to_enc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x16,%esi
call   1030 <rds_send_byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x16,%esi
call   1030 <rds_send_byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1030 <rds_send_byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x16,%esi
call   1030 <rds_send_byte@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <rds_send_byte@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prais_send_ack_to_enc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x16,%esi
call   1030 <rds_send_byte@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
call   1030 <rds_send_byte@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <rds_send_byte@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
call   1030 <rds_send_byte@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <rds_send_byte@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.rds_encoder = type { i32 }
define i32 @prais_send_ack_to_enc(%struct.rds_encoder* %0) {
%2 = alloca %struct.rds_encoder*
store %struct.rds_encoder* %0, %struct.rds_encoder** %2
%3 = load %struct.rds_encoder*, %struct.rds_encoder** %2
%4 = call i32 @rds_send_byte(%struct.rds_encoder* %3, i32 22)
%5 = load %struct.rds_encoder*, %struct.rds_encoder** %2
%6 = call i32 @rds_send_byte(%struct.rds_encoder* %5, i32 22)
%7 = load %struct.rds_encoder*, %struct.rds_encoder** %2
%8 = call i32 @rds_send_byte(%struct.rds_encoder* %7, i32 6)
%9 = load %struct.rds_encoder*, %struct.rds_encoder** %2
%10 = call i32 @rds_send_byte(%struct.rds_encoder* %9, i32 22)
%11 = load %struct.rds_encoder*, %struct.rds_encoder** %2
%12 = call i32 @rds_send_byte(%struct.rds_encoder* %11, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.rds_encoder = type { i32 }
define i32 @prais_send_ack_to_enc(%struct.rds_encoder* %0) {
%2 = tail call i32 @rds_send_byte(%struct.rds_encoder* %0, i32 22)
%3 = tail call i32 @rds_send_byte(%struct.rds_encoder* %0, i32 22)
%4 = tail call i32 @rds_send_byte(%struct.rds_encoder* %0, i32 6)
%5 = tail call i32 @rds_send_byte(%struct.rds_encoder* %0, i32 22)
%6 = tail call i32 @rds_send_byte(%struct.rds_encoder* %0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double const, double const, double const);
void vec3_print(const double v[3]) {
  printf("   %.3f, %.3f, %.3f\n", v[0], v[1], v[2]);
}


x86 assembly (clang, -O0):
<vec3_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_print>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c" %.3f, %.3f, %.3f\0A\00"
define void @vec3_print(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %5, double %8, double %11)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c" %.3f, %.3f, %.3f\0A\00"
define void @vec3_print(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %2, double %4, double %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(char *);
f() {
  char c;
  g(&c);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rdi
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
lea    0x7(%rsp),%rdi
call   1030 <g@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @g(i8* %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @f() {
%1 = alloca i8
%2 = call i32 @g(i8* %1)
ret i32 undef
}
void RTSha256ToString(void) {}


x86 assembly (clang, -O0):
<RTSha256ToString>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTSha256ToString>:
ret

LLVM IR (-O0):
define void @RTSha256ToString() {
ret void
}

LLVM IR (-O2):
define void @RTSha256ToString() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, char const *);
void PrintUsage(const char *argv0) {
  const static char *fmt = "Simple Grep (sgrep) Usage:\n"
                           "%s [COMMAND] [OPTIONS]...\n"
                           "\nCOMMNAD\n"
                           "\tFind: -f [search-string]\n"
                           "\tReplace: -r [string1] [string2]\n"
                           "\tDiff: -d [file1] [file2]\n";
  printf(fmt, argv0);
}


x86 assembly (clang, -O0):
<PrintUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f05(%rip),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintUsage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@PrintUsage.fmt = internal global i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i32 0, i32 0)
@.str = [148 x i8] c"Simple Grep (sgrep) Usage:\0A%s [COMMAND] [OPTIONS]...\0A\0ACOMMNAD\0A\09Find: -f [search-string]\0A\09Replace: -r [string1] [string2]\0A\09Diff: -d [file1] [file2]\0A\00"
define void @PrintUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** @PrintUsage.fmt
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [148 x i8] c"Simple Grep (sgrep) Usage:\0A%s [COMMAND] [OPTIONS]...\0A\0ACOMMNAD\0A\09Find: -f [search-string]\0A\09Replace: -r [string1] [string2]\0A\09Diff: -d [file1] [file2]\0A\00"
define void @PrintUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ encrypt(char *, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(void) {
  char str[32] = {0};
  printf("Message: ");
  fgets(str, sizeof(str), stdin);
  encrypt(str, 1);
  printf("Str: %s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    0x2e70(%rip),%rax
mov    (%rax),%edx
mov    $0x20,%esi
call   1060 <fgets@plt>
lea    -0x30(%rbp),%rdi
mov    $0x1,%esi
call   1040 <encrypt@plt>
lea    -0x30(%rbp),%rsi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <encrypt@plt>
lea    0xe8e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Message: \00"
@stdin = global i32 0
@.str.1 = [9 x i8] c"Str: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
store i32 0, i32* %1
%3 = bitcast [32 x i8]* %2 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 32, i32 %6)
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%9 = call i32 @encrypt(i8* %8, i32 1)
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Message: \00"
@stdin = global i32 0
@.str.1 = [9 x i8] c"Str: %s\0A\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 32, i32 %4)
%6 = call i32 @encrypt(i8* %2, i32 1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *, int *, int *,
                          char *);
int hour24(int, char);
int /*<<< orphan*/ printf(char *, int, int, int);
void load(FILE *in) {
  int hh, mm, ss;
  char c;
  fscanf(in, "%02d:%02d:%02d%cM\n", &hh, &mm, &ss, &c);
  printf("%02d:%02d:%02d\n", hour24(hh, c), mm, ss);
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x15(%rbp),%r9
call   1040 <fscanf@plt>
mov    -0xc(%rbp),%edi
movsbl -0x15(%rbp),%esi
call   1050 <hour24@plt>
mov    %eax,%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0xb(%rsp),%r9
call   1040 <fscanf@plt>
mov    0x14(%rsp),%edi
movsbl 0xb(%rsp),%esi
call   1050 <hour24@plt>
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%02d:%02d:%02d%cM\0A\00"
@.str.1 = [16 x i8] c"%02d:%02d:%02d\0A\00"
define void @load(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i8* %6)
%9 = load i32, i32* %3
%10 = load i8, i8* %6
%11 = call i32 @hour24(i32 %9, i8 signext %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%02d:%02d:%02d%cM\0A\00"
@.str.1 = [16 x i8] c"%02d:%02d:%02d\0A\00"
define void @load(i32* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i8* %5)
%10 = load i32, i32* %2
%11 = load i8, i8* %5
%12 = call i32 @hour24(i32 %10, i8 signext %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
ret void
}
void tr_break() {}


x86 assembly (clang, -O0):
<tr_break>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr_break>:
ret

LLVM IR (-O0):
define void @tr_break() {
ret void
}

LLVM IR (-O2):
define void @tr_break() {
ret void
}
void mdea_node_parser_destroy(void *p) { struct mdea_node_parser *t = p; }


x86 assembly (clang, -O0):
<mdea_node_parser_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdea_node_parser_destroy>:
ret

LLVM IR (-O0):
%struct.mdea_node_parser = type opaque
define void @mdea_node_parser_destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.mdea_node_parser*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.mdea_node_parser*
store %struct.mdea_node_parser* %5, %struct.mdea_node_parser** %3
ret void
}

LLVM IR (-O2):
define void @mdea_node_parser_destroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
int main(void) {
  short int x = -32768;
  x = (~x);
  printf("after complement operation: %d", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x8000,-0x6(%rbp)
movswl -0x6(%rbp),%eax
xor    $0xffffffff,%eax
mov    %ax,-0x6(%rbp)
lea    0xec9(%rip),%rdi
movswl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7fff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"after complement operation: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 -32768, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = xor i32 %4, -1
%6 = trunc i32 %5 to i16
store i16 %6, i16* %2
%7 = load i16, i16* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i16 signext %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"after complement operation: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i16 signext 32767)
ret i32 0
}
/* Variables and functions */
int chdir(char *);
int ch_dir_c(char *dirname) { return chdir(dirname); }


x86 assembly (clang, -O0):
<ch_dir_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_dir_c>:
jmp    1030 <chdir@plt>

LLVM IR (-O0):
define i32 @ch_dir_c(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @chdir(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @ch_dir_c(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int64_t max_int(uint32_t k) {
  assert(1 <= k && k <= 64);
  return (int64_t)((((uint64_t)1) << (k - 1)) - 1);
}


x86 assembly (clang, -O0):
<max_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x1,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1138 <max_int+0x28>
cmpl   $0x40,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_int>:
push   %rbx
lea    -0x1(%rdi),%ebx
xor    %edi,%edi
cmp    $0x40,%ebx
setb   %dil
call   1030 <assert@plt>
mov    $0xffffffff,%eax
mov    %ebx,%ecx
shl    %cl,%eax
not    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @max_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 1, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 64
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
%14 = shl i32 1, %13
%15 = sub nsw i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @max_int(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 64
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = shl nsw i32 -1, %2
%7 = xor i32 %6, -1
ret i32 %7
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int init_semaphore(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int idsem1;
  int val;
  val = atoi(argv[1]);
  idsem1 = init_semaphore(val);
  printf("idsem : %d\n", idsem1);
  exit(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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <init_semaphore@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <init_semaphore@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"idsem : %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 @init_semaphore(i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"idsem : %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @init_semaphore(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 0)
unreachable
}
void s_SPI_delay(int multiplier) {
  int i;
  int delay = multiplier * 10;
  if (delay <= 0) {
    delay = 50;
  }
  for (i = 0; i < delay; i++) {
  }
}


x86 assembly (clang, -O0):
<s_SPI_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xa,-0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     111f <s_SPI_delay+0x1f>
movl   $0x32,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1145 <s_SPI_delay+0x45>
jmp    1137 <s_SPI_delay+0x37>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <s_SPI_delay+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_SPI_delay>:
ret

LLVM IR (-O0):
define void @s_SPI_delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 10
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 50, i32* %4
br label %10
10: ; preds = %9, %1
store i32 0, i32* %3
br label %11
11: ; preds = %16, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %11
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %11
19: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @s_SPI_delay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void ADCIntUnregister(unsigned long ulBase, unsigned long ulSequenceNum) {
  unsigned long ulInt;
  ;
  ;
  ulInt =
      ((ulBase == 0x40038000) ? (30 + ulSequenceNum) : (64 + ulSequenceNum));
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<ADCIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40038000,-0x8(%rbp)
40
jne    114f <ADCIntUnregister+0x2f>
mov    -0x10(%rbp),%rax
add    $0x1e,%rax
mov    %rax,-0x20(%rbp)
jmp    115b <ADCIntUnregister+0x3b>
mov    -0x10(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x18(%rbp),%rdi
call   1040 <IntUnregister@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntUnregister>:
push   %rbx
lea    0x40(%rsi),%rbx
lea    0x1e(%rsi),%rax
cmp    $0x40038000,%rdi
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @ADCIntUnregister(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 1073971200
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i64, i64* %4
%10 = add i64 30, %9
br label %14
11: ; preds = %2
%12 = load i64, i64* %4
%13 = add i64 64, %12
br label %14
14: ; preds = %11, %8
%15 = phi i64 [ %10, %8 ], [ %13, %11 ]
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = call i32 @IntDisable(i64 %16)
%18 = load i64, i64* %5
%19 = call i32 @IntUnregister(i64 %18)
ret void
}

LLVM IR (-O2):
define void @ADCIntUnregister(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1073971200
%4 = select i1 %3, i64 30, i64 64
%5 = add i64 %4, %1
%6 = tail call i32 @IntDisable(i64 %5)
%7 = tail call i32 @IntUnregister(i64 %5)
ret void
}
/* Variables and functions */
double Slater_3S_4S(double, double, double);
double Slater_4S_3S(double rij, double xii, double xij) {
  return Slater_3S_4S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<Slater_4S_3S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <Slater_3S_4S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Slater_4S_3S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <Slater_3S_4S@plt>

LLVM IR (-O0):
define double @Slater_4S_3S(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @Slater_3S_4S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @Slater_4S_3S(double %0, double %1, double %2) {
%4 = tail call double @Slater_3S_4S(double %0, double %2, double %1)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int eat_comment(FILE *fp) {
  int c;
  c = getc(fp);
  while (c > 0 && c != '\n')
    c = getc(fp);
  return c;
}


x86 assembly (clang, -O0):
<eat_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1141 <eat_comment+0x31>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1151 <eat_comment+0x41>
jmp    1162 <eat_comment+0x52>
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
jmp    1128 <eat_comment+0x18>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat_comment>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <getc@plt>
test   %eax,%eax
jle    1133 <eat_comment+0x23>
cmp    $0xa,%eax
je     1133 <eat_comment+0x23>
mov    %rbx,%rdi
jmp    1120 <eat_comment+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @eat_comment(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br i1 %13, label %14, label %17
14: ; preds = %12
%15 = load i32*, i32** %2
%16 = call i32 @getc(i32* %15)
store i32 %16, i32* %3
br label %6
17: ; preds = %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @eat_comment(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = icmp sgt i32 %2, 0
%4 = icmp ne i32 %2, 10
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = tail call i32 @getc(i32* %0)
%8 = icmp sgt i32 %7, 0
%9 = icmp ne i32 %7, 10
%10 = and i1 %8, %9
br i1 %10, label %6, label %11
11: ; preds = %6, %1
%12 = phi i32 [ %2, %1 ], [ %7, %6 ]
ret i32 %12
}
/* Type definitions */
struct var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct var *);
void destroy_var(struct var *data) {
  if (data) {
    free(data);
  }
  return;
}


x86 assembly (clang, -O0):
<destroy_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <destroy_var+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_var>:
test   %rdi,%rdi
je     111a <destroy_var+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.var = type { i32 }
define void @destroy_var(%struct.var* %0) {
%2 = alloca %struct.var*
store %struct.var* %0, %struct.var** %2
%3 = load %struct.var*, %struct.var** %2
%4 = icmp ne %struct.var* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.var*, %struct.var** %2
%7 = call i32 @free(%struct.var* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.var = type { i32 }
define void @destroy_var(%struct.var* %0) {
%2 = icmp eq %struct.var* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.var* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void to_uns_short_store_n(__float128 a, unsigned short *p, long n) {
  p[n] = (unsigned short)a;
}


x86 assembly (clang, -O0):
<to_uns_short_store_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movaps -0x10(%rbp),%xmm0
call   1140 <__fixtfsi>
mov    %ax,%dx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
add    $0x20,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<to_uns_short_store_n>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1120 <__fixtfsi>
mov    %ax,(%rbx,%r14,2)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define void @to_uns_short_store_n(fp128 %0, i16* %1, i64 %2) {
%4 = alloca fp128
%5 = alloca i16*
%6 = alloca i64
store fp128 %0, fp128* %4
store i16* %1, i16** %5
store i64 %2, i64* %6
%7 = load fp128, fp128* %4
%8 = fptoui fp128 %7 to i16
%9 = load i16*, i16** %5
%10 = load i64, i64* %6
%11 = getelementptr inbounds i16, i16* %9, i64 %10
store i16 %8, i16* %11
ret void
}

LLVM IR (-O2):
define void @to_uns_short_store_n(fp128 %0, i16* nocapture writeonly %1, i64 %2) {
%4 = fptoui fp128 %0 to i16
%5 = getelementptr inbounds i16, i16* %1, i64 %2
store i16 %4, i16* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void get_log_time(char *log_time) {
  struct tm *sTm;
  time_t now = time(0);
  sTm = localtime(&now);
  strftime(log_time, 22, "[%Y-%m-%d %H:%M:%S]", sTm);
}


x86 assembly (clang, -O0):
<get_log_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x16,%esi
lea    0xe99(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_log_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    $0x16,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [20 x i8] c"[%Y-%m-%d %H:%M:%S]\00"
define void @get_log_time(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tm*
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 @time(i32 0)
store i32 %5, i32* %4
%6 = call %struct.tm* @localtime(i32* %4)
store %struct.tm* %6, %struct.tm** %3
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %3
%9 = call i32 @strftime(i8* %7, i32 22, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [20 x i8] c"[%Y-%m-%d %H:%M:%S]\00"
define void @get_log_time(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32 0)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 22, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
void get_formalparmtype(const char *arg, char *formal) {
  while (*arg != '|' && *arg != '\0') {
    *formal++ = *arg++;
  }
  *formal = '\0';
}


x86 assembly (clang, -O0):
<get_formalparmtype>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x7c,%ecx
mov    %al,-0x11(%rbp)
je     1131 <get_formalparmtype+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <get_formalparmtype+0x41>
jmp    1168 <get_formalparmtype+0x68>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <get_formalparmtype+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_formalparmtype>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1126 <get_formalparmtype+0x26>
cmp    $0x7c,%cl
je     1126 <get_formalparmtype+0x26>
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
jmp    1110 <get_formalparmtype+0x10>
movb   $0x0,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @get_formalparmtype(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %17, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 124
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8, i8* %18
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
store i8 %20, i8* %21
br label %5
23: ; preds = %15
%24 = load i8*, i8** %4
store i8 0, i8* %24
ret void
}

LLVM IR (-O2):
define void @get_formalparmtype(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = phi i8* [ %1, %2 ], [ %9, %7 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 124, label %10
i8 0, label %10
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %3
10: ; preds = %3, %3
store i8 0, i8* %5
ret void
}
unsigned long make_simple_mask(long bit_count) {
  unsigned long local_mask;
  long i;
  local_mask = 0;
  for (i = 0; i < bit_count; i++) {
    local_mask = (local_mask << 1) + 1;
  }
  return (local_mask);
}


x86 assembly (clang, -O0):
<make_simple_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1147 <make_simple_mask+0x47>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <make_simple_mask+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_simple_mask>:
test   %rdi,%rdi
jle    1118 <make_simple_mask+0x18>
lea    -0x1(%rdi),%rax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    111b <make_simple_mask+0x1b>
xor    %eax,%eax
jmp    1140 <make_simple_mask+0x40>
xor    %eax,%eax
ret
and    $0xfffffffffffffff8,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shl    $0x8,%rax
or     $0xff,%rax
add    $0xfffffffffffffff8,%rdi
jne    1130 <make_simple_mask+0x30>
test   %rcx,%rcx
je     115d <make_simple_mask+0x5d>
cs nopw 0x0(%rax,%rax,1)
nop
add    %rax,%rax
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
jne    1150 <make_simple_mask+0x50>
ret

LLVM IR (-O0):
define i64 @make_simple_mask(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 0, i64* %4
br label %5
5: ; preds = %13, %1
%6 = load i64, i64* %4
%7 = load i64, i64* %2
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i64, i64* %3
%11 = shl i64 %10, 1
%12 = add i64 %11, 1
store i64 %12, i64* %3
br label %13
13: ; preds = %9
%14 = load i64, i64* %4
%15 = add nsw i64 %14, 1
store i64 %15, i64* %4
br label %5
16: ; preds = %5
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @make_simple_mask(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %27
3: ; preds = %1
%4 = add i64 %0, -1
%5 = and i64 %0, 7
%6 = icmp ult i64 %4, 7
br i1 %6, label %16, label %7
7: ; preds = %3
%8 = and i64 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i64 [ 0, %7 ], [ %13, %9 ]
%11 = phi i64 [ 0, %7 ], [ %14, %9 ]
%12 = shl i64 %10, 8
%13 = or i64 %12, 255
%14 = add i64 %11, 8
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %3
%17 = phi i64 [ undef, %3 ], [ %13, %9 ]
%18 = phi i64 [ 0, %3 ], [ %13, %9 ]
%19 = icmp eq i64 %5, 0
br i1 %19, label %27, label %20
20: ; preds = %16, %20
%21 = phi i64 [ %24, %20 ], [ %18, %16 ]
%22 = phi i64 [ %25, %20 ], [ 0, %16 ]
%23 = shl i64 %21, 1
%24 = or i64 %23, 1
%25 = add i64 %22, 1
%26 = icmp eq i64 %25, %5
br i1 %26, label %27, label %20
27: ; preds = %16, %20, %1
%28 = phi i64 [ 0, %1 ], [ %17, %16 ], [ %24, %20 ]
ret i64 %28
}
/* Variables and functions */
int close(int);
int closeSafely(int fd) { return (fd == -1) ? 0 : close(fd); }


x86 assembly (clang, -O0):
<closeSafely>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    112f <closeSafely+0x1f>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <closeSafely+0x2a>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeSafely>:
cmp    $0xffffffff,%edi
je     111a <closeSafely+0xa>
jmp    1030 <close@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @closeSafely(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @close(i32 %7)
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 0, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @closeSafely(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_smeanpw(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_smeanpw(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_smeanpw@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_smeanpw@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_smeanpw(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_smeanpw(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double convert_it_4(double x) { return pow(x, -8.0 / 3.0); }


x86 assembly (clang, -O0):
<convert_it_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_it_4>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @convert_it_4(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0xC005555555555555)
ret double %4
}

LLVM IR (-O2):
define double @convert_it_4(double %0) {
%2 = tail call double @pow(double %0, double 0xC005555555555555)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void dispsynt(char **argv) {
  fprintf(stderr, "Syntax: %s i_sacs stftype [-imas] [-gfdir] [-t] [-h]\n",
          argv[0]);
}


x86 assembly (clang, -O0):
<dispsynt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispsynt>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xedd(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Syntax: %s i_sacs stftype [-imas] [-gfdir] [-t] [-h]\0A\00"
define void @dispsynt(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Syntax: %s i_sacs stftype [-imas] [-gfdir] [-t] [-h]\0A\00"
define void @dispsynt(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int t1_iszero(double x) { return x > 1e-6; }


x86 assembly (clang, -O0):
<t1_iszero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_iszero>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @t1_iszero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0x3EB0C6F7A0B5ED8D
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @t1_iszero(double %0) {
%2 = fcmp ogt double %0, 0x3EB0C6F7A0B5ED8D
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ strncpy(char *, char const *, size_t);
int strcpy_s(char *str, size_t size, const char *src) {
  return strncpy(str, src, size) ? 0 : -1;
}


x86 assembly (clang, -O0):
<strcpy_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_s>:
push   %rax
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <strncpy@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @strcpy_s(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = load i64, i64* %5
%10 = call i64 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @strcpy_s(i8* %0, i64 %1, i8* %2) {
%4 = tail call i64 @strncpy(i8* %0, i8* %2, i64 %1)
%5 = icmp eq i64 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
size_t nondetpos();
int /*<<< orphan*/ test(int *);
void main() {
  int *q;
  q = (int *)malloc(sizeof(int) * 2);
  q[nondetpos()] = 0;
  test(q);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <nondetpos@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
call   1050 <test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <nondetpos@plt>
movl   $0x0,(%rbx,%rax,4)
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <test@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i64 (...) @nondetpos()
%6 = getelementptr inbounds i32, i32* %4, i64 %5
store i32 0, i32* %6
%7 = load i32*, i32** %1
%8 = call i32 @test(i32* %7)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i64 (...) @nondetpos()
%4 = getelementptr inbounds i32, i32* %2, i64 %3
store i32 0, i32* %4
%5 = tail call i32 @test(i32* %2)
ret void
}
/* Type definitions */
struct statvfs {
  int dummy;
};
struct statfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __internal_statvfs(char const *, struct statvfs *,
                                      struct statfs *, int);
scalar_t__ __statfs(char const *, struct statfs *);
int __statvfs(const char *file, struct statvfs *buf) {
  struct statfs fsbuf;
  if (__statfs(file, &fsbuf) < 0)
    return -1;
  __internal_statvfs(file, buf, &fsbuf, -1);
  return 0;
}


x86 assembly (clang, -O0):
<__statvfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <__statfs@plt>
cmp    $0x0,%rax
jge    1153 <__statvfs+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <__statvfs+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0xffffffff,%ecx
call   1040 <__internal_statvfs@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__statvfs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <__statfs@plt>
test   %rax,%rax
js     114e <__statvfs+0x2e>
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xffffffff,%ecx
call   1040 <__internal_statvfs@plt>
xor    %eax,%eax
jmp    1153 <__statvfs+0x33>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @__statvfs(i8* %0, %struct.statvfs* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.statvfs*
%6 = alloca %struct.statfs
store i8* %0, i8** %4
store %struct.statvfs* %1, %struct.statvfs** %5
%7 = load i8*, i8** %4
%8 = call i64 @__statfs(i8* %7, %struct.statfs* %6)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load %struct.statvfs*, %struct.statvfs** %5
%14 = call i32 @__internal_statvfs(i8* %12, %struct.statvfs* %13, %struct.statfs* %6, i32 -1)
store i32 0, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @__statvfs(i8* %0, %struct.statvfs* %1) {
%3 = alloca %struct.statfs
%4 = bitcast %struct.statfs* %3 to i8*
%5 = call i64 @__statfs(i8* %0, %struct.statfs* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @__internal_statvfs(i8* %0, %struct.statvfs* %1, %struct.statfs* %3, i32 -1)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %10
}