xunge/DecIR huggingface dataset:
/* Variables and functions */
int gob_encode_string_int_helper(char *, size_t, char const *, int);
int gob_encode_common_type(char *buf, size_t buf_size, const char *name,
                           int id) {
  return gob_encode_string_int_helper(buf, buf_size, name, id);
}


x86 assembly (clang, -O0):
<gob_encode_common_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <gob_encode_string_int_helper@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gob_encode_common_type>:
jmp    1030 <gob_encode_string_int_helper@plt>

LLVM IR (-O0):
define i32 @gob_encode_common_type(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @gob_encode_string_int_helper(i8* %9, i64 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @gob_encode_common_type(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @gob_encode_string_int_helper(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
struct timeval tvTOD(void) {
  struct timeval timeOfDay;
  gettimeofday(&timeOfDay, NULL);
  return (timeOfDay);
}


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

x86 assembly (clang, -O2):
<tvTOD>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @tvTOD() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @tvTOD() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}
int vl_string_length(char const *str) {
  int i;
  for (i = 0; str[i]; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<vl_string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <vl_string_length+0x34>
jmp    1126 <vl_string_length+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <vl_string_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vl_string_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <vl_string_length+0x10>
ret

LLVM IR (-O0):
define i32 @vl_string_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %4
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @vl_string_length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_wait(long *ivar, long cmp_value) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

x86 assembly (clang, -O2):
<shmem_wait>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_wait(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_wait(i64* nocapture readnone %0, i64 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
char *StrCat(char *dest, const char *src) {
  char *tmp = dest;
  while (*dest)
    dest++;
  while ((*dest++ = *src++) != '\0')
    ;
  return tmp;
}


x86 assembly (clang, -O0):
<StrCat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <StrCat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <StrCat+0x14>
jmp    1137 <StrCat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116a <StrCat+0x6a>
jmp    1137 <StrCat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrCat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <StrCat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <StrCat+0x20>
ret

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

LLVM IR (-O2):
define i8* @StrCat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
int compare_thunk(const void *a, const void *b, void *aux) {
  int (**compare)(const void *, const void *) = aux;
  return (*compare)(a, b);
}


x86 assembly (clang, -O0):
<compare_thunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_thunk>:
mov    (%rdx),%rax
jmp    *%rax

LLVM IR (-O0):
define i32 @compare_thunk(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32 (i8*, i8*)**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i32 (i8*, i8*)**
store i32 (i8*, i8*)** %9, i32 (i8*, i8*)*** %7
%10 = load i32 (i8*, i8*)**, i32 (i8*, i8*)*** %7
%11 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %10
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i32 %11(i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @compare_thunk(i8* %0, i8* %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32 (i8*, i8*)**
%5 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %4
%6 = tail call i32 %5(i8* %0, i8* %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ stderr;
void panic(const char *msg, const char *file, int line) {
  fprintf(stderr, "[ERROR] in %s:%d\n", file, line);
  if (msg != NULL) {
    fprintf(stderr, "[ERROR] %s\n", msg);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1177 <panic+0x57>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
lea    0xec3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %rbx,%rbx
je     115d <panic+0x3d>
mov    (%r14),%edi
lea    0xebf(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"[ERROR] in %s:%d\0A\00"
@.str.1 = [12 x i8] c"[ERROR] %s\0A\00"
define void @panic(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %4
%16 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %13, %3
%18 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"[ERROR] in %s:%d\0A\00"
@.str.1 = [12 x i8] c"[ERROR] %s\0A\00"
define void @panic(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
%6 = icmp eq i8* %0, null
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %7, %3
%11 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int HandleInputView_inputAdminUpdateSubject();
int /*<<< orphan*/ printf(char *);
int HandleInputView_inputTeacherUpdateSubject() {
  printf("Update Subject\n");
  printf("  1) Update Subject Criteria\n");
  printf("  2) Update Subject Grade Range\n");
  printf("  3) Exit\n");
  return HandleInputView_inputAdminUpdateSubject();
}


x86 assembly (clang, -O0):
<HandleInputView_inputTeacherUpdateSubject>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1040 <printf@plt>
lea    0xf00(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <HandleInputView_inputAdminUpdateSubject@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleInputView_inputTeacherUpdateSubject>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
lea    0xf00(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <HandleInputView_inputAdminUpdateSubject@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Update Subject\0A\00"
@.str.1 = [30 x i8] c" 1) Update Subject Criteria\0A\00"
@.str.2 = [33 x i8] c" 2) Update Subject Grade Range\0A\00"
@.str.3 = [11 x i8] c" 3) Exit\0A\00"
define i32 @HandleInputView_inputTeacherUpdateSubject() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (...) @HandleInputView_inputAdminUpdateSubject()
ret i32 %5
}

LLVM IR (-O2):
@str = [15 x i8] c"Update Subject\00"
@str.4 = [29 x i8] c" 1) Update Subject Criteria\00"
@str.5 = [32 x i8] c" 2) Update Subject Grade Range\00"
@str.6 = [10 x i8] c" 3) Exit\00"
define i32 @HandleInputView_inputTeacherUpdateSubject() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 (...) @HandleInputView_inputAdminUpdateSubject()
ret i32 %5
}
/* Variables and functions */
int fc8180_bypass_read(void *, unsigned char, unsigned char, unsigned char *,
                       unsigned char);
signed int fci_bypass_read(void *handle, unsigned char chip, unsigned char addr,
                           unsigned char alen, unsigned char *data,
                           unsigned char len) {
  signed int res;
  res = fc8180_bypass_read(handle, chip, addr, data, len);
  return res;
}


x86 assembly (clang, -O0):
<fci_bypass_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r9b,%al
mov    %rdi,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %dl,-0xa(%rbp)
mov    %cl,-0xb(%rbp)
mov    %r8,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%dl
mov    -0xa(%rbp),%al
mov    -0x18(%rbp),%rcx
movzbl %dl,%esi
movzbl %al,%edx
movzbl -0x19(%rbp),%r8d
call   1030 <fc8180_bypass_read@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fci_bypass_read>:
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    1030 <fc8180_bypass_read@plt>

LLVM IR (-O0):
define i32 @fci_bypass_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* %4, i8 zeroext %5) {
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8*
%12 = alloca i8
%13 = alloca i32
store i8* %0, i8** %7
store i8 %1, i8* %8
store i8 %2, i8* %9
store i8 %3, i8* %10
store i8* %4, i8** %11
store i8 %5, i8* %12
%14 = load i8*, i8** %7
%15 = load i8, i8* %8
%16 = load i8, i8* %9
%17 = load i8*, i8** %11
%18 = load i8, i8* %12
%19 = call i32 @fc8180_bypass_read(i8* %14, i8 zeroext %15, i8 zeroext %16, i8* %17, i8 zeroext %18)
store i32 %19, i32* %13
%20 = load i32, i32* %13
ret i32 %20
}

LLVM IR (-O2):
define i32 @fci_bypass_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* %4, i8 zeroext %5) {
%7 = tail call i32 @fc8180_bypass_read(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %4, i8 zeroext %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_version() { printf("%s\n", "0.1"); }


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float sin(int);
int main(int argc, const char *argv[]) {
  float sine = sin(1);
  printf("sin(1) = %.3f\n", sine);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <sin@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <sin@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"sin(1) = %.3f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca float
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call float @sin(i32 1)
store float %6, float* %5
%7 = load float, float* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"sin(1) = %.3f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float @sin(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *_free(void *ptr) {
  free(ptr);
  return NULL;
}


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

x86 assembly (clang, -O2):
<_free>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i8* null
}
/* Variables and functions */
double db_pos(float);
float psd_estimate(float re, float im) {
  float power;
  float psd;
  power = re * re + im * im;
  psd = 90.302 + db_pos(power);
  return psd;
}


x86 assembly (clang, -O0):
<psd_estimate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <db_pos@plt>
movaps %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psd_estimate>:
push   %rax
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <db_pos@plt>
addsd  0xed6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @psd_estimate(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = load float, float* %3
%9 = load float, float* %4
%10 = load float, float* %4
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
store float %12, float* %5
%13 = load float, float* %5
%14 = call double @db_pos(float %13)
%15 = fadd double 9.030200e+01, %14
%16 = fptrunc double %15 to float
store float %16, float* %6
%17 = load float, float* %6
ret float %17
}

LLVM IR (-O2):
define float @psd_estimate(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = tail call double @db_pos(float %4)
%6 = fadd double %5, 9.030200e+01
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
scalar_t__ lock(int);
int /*<<< orphan*/ unlock(int);
int /*<<< orphan*/ use_resource(int);
void *thread_body(void *arg) {
  int thread = *((int *)arg);
  if (lock(thread)) {
    use_resource(thread);
    unlock(thread);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<thread_body>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <lock@plt>
cmp    $0x0,%rax
je     1167 <thread_body+0x37>
mov    -0xc(%rbp),%edi
call   1050 <use_resource@plt>
mov    -0xc(%rbp),%edi
call   1030 <unlock@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_body>:
push   %rbx
mov    (%rdi),%ebx
mov    %ebx,%edi
call   1040 <lock@plt>
test   %rax,%rax
je     114d <thread_body+0x1d>
mov    %ebx,%edi
call   1050 <use_resource@plt>
mov    %ebx,%edi
call   1030 <unlock@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @thread_body(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i64 @lock(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @use_resource(i32 %11)
%13 = load i32, i32* %3
%14 = call i32 @unlock(i32 %13)
br label %15
15: ; preds = %10, %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_body(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i64 @lock(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 @use_resource(i32 %3)
%8 = tail call i32 @unlock(i32 %3)
br label %9
9: ; preds = %6, %1
ret i8* null
}
void test43_BlinkEnvLed_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test43_BlinkEnvLed_targetInit__I() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint8_t read_uint8(uint32_t offset) { return 0; }


x86 assembly (clang, -O0):
<read_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint8>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @read_uint8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @read_uint8(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(unsigned int, int, unsigned int *, unsigned int *,
                         unsigned int *, unsigned int *);
void cpuid4(unsigned int CPU_number, unsigned long long idx, unsigned int *eax,
            unsigned int *ebx, unsigned int *ecx, unsigned int *edx) {
  cpuid(CPU_number, 4 | (idx << 32), eax, ebx, ecx, edx);
}


x86 assembly (clang, -O0):
<cpuid4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     $0x4,%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <cpuid@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid4>:
mov    $0x4,%esi
jmp    1030 <cpuid@plt>

LLVM IR (-O0):
define void @cpuid4(i32 %0, i64 %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %7
store i64 %1, i64* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32, i32* %7
%14 = load i64, i64* %8
%15 = shl i64 %14, 32
%16 = or i64 4, %15
%17 = trunc i64 %16 to i32
%18 = load i32*, i32** %9
%19 = load i32*, i32** %10
%20 = load i32*, i32** %11
%21 = load i32*, i32** %12
%22 = call i32 @cpuid(i32 %13, i32 %17, i32* %18, i32* %19, i32* %20, i32* %21)
ret void
}

LLVM IR (-O2):
define void @cpuid4(i32 %0, i64 %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = tail call i32 @cpuid(i32 %0, i32 4, i32* %2, i32* %3, i32* %4, i32* %5)
ret void
}
void AR30ToAB30() {}


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

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

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

LLVM IR (-O2):
define void @AR30ToAB30() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ hxd_log(char *, unsigned long);
void xdie(size_t size) {
  hxd_log("xmalloc: could not allocate %lu bytes", (unsigned long)size);
  abort();
  exit(111);
}


x86 assembly (clang, -O0):
<xdie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <hxd_log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<xdie>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <hxd_log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"xmalloc: could not allocate %lu bytes\00"
define void @xdie(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @hxd_log(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"xmalloc: could not allocate %lu bytes\00"
define void @xdie(i64 %0) {
%2 = tail call i32 @hxd_log(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = tail call i32 (...) @abort()
unreachable
}
int base64_encoded_len(int len) { return (len + 2) / 3 * 4; }


x86 assembly (clang, -O0):
<base64_encoded_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encoded_len>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @base64_encoded_len(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @base64_encoded_len(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("This is a good reason for %s\n", "you");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xef1(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"This is a good reason for %s\0A\00"
@.str.1 = [4 x i8] c"you\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"This is a good reason for %s\0A\00"
@.str.1 = [4 x i8] c"you\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float atan2f(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ cosf(float);
int /*<<< orphan*/ sinf(float);
float angleSubtractf(float angleOne, float angleTwo) {
  return atan2f(sinf(angleOne - angleTwo), cosf(angleOne - angleTwo));
}


x86 assembly (clang, -O0):
<angleSubtractf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <sinf@plt>
mov    %eax,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1040 <cosf@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1050 <atan2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angleSubtractf>:
push   %rbx
sub    $0x10,%rsp
subss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
call   1030 <sinf@plt>
mov    %eax,%ebx
movss  0xc(%rsp),%xmm0
call   1040 <cosf@plt>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <atan2f@plt>

LLVM IR (-O0):
define float @angleSubtractf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = call i32 @sinf(float %7)
%9 = load float, float* %3
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = call i32 @cosf(float %11)
%13 = call float @atan2f(i32 %8, i32 %12)
ret float %13
}

LLVM IR (-O2):
define float @angleSubtractf(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call i32 @sinf(float %3)
%5 = tail call i32 @cosf(float %3)
%6 = tail call float @atan2f(i32 %4, i32 %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(0);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
char *skipwhite(char *);
char *skipdelim(char *cp) {
  cp = skipwhite(cp);
  if (*cp == ',')
    cp = skipwhite(cp + 1);
  return cp;
}


x86 assembly (clang, -O0):
<skipdelim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <skipwhite@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    114a <skipdelim+0x3a>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <skipwhite@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipdelim>:
push   %rax
call   1030 <skipwhite@plt>
cmpb   $0x2c,(%rax)
jne    1128 <skipdelim+0x18>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rax
jmp    1030 <skipwhite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @skipdelim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @skipwhite(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 44
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = call i8* @skipwhite(i8* %11)
store i8* %12, i8** %2
br label %13
13: ; preds = %9, %1
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @skipdelim(i8* %0) {
%2 = tail call i8* @skipwhite(i8* %0)
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 44
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = tail call i8* @skipwhite(i8* %6)
br label %8
8: ; preds = %5, %1
%9 = phi i8* [ %7, %5 ], [ %2, %1 ]
ret i8* %9
}
void mp_squh(int n, int radix, int in[], int out[], int nfft, double outfft[]) {
  void mp_mul_i2d(int n, int radix, int nfft, int shift, int in[],
                  double dout[]);
  void mp_mul_csqu(int nfft, double d1[]);
  void mp_mul_d2i(int n, int radix, int nfft, double din[], int out[]);
  mp_mul_i2d(n, radix, nfft, 0, in, outfft);
  mp_mul_csqu(nfft, outfft);
  mp_mul_d2i(n, radix, nfft, outfft, out);
}


x86 assembly (clang, -O0):
<mp_squh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %ecx,%ecx
call   1030 <mp_mul_i2d@plt>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1040 <mp_mul_csqu@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1050 <mp_mul_d2i@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_squh>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9,%rbx
mov    %r8d,%ebp
mov    %rcx,%r14
mov    %rdx,%r8
mov    %esi,%r15d
mov    %edi,%r12d
mov    %ebp,%edx
xor    %ecx,%ecx
call   1030 <mp_mul_i2d@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <mp_mul_csqu@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <mp_mul_d2i@plt>

LLVM IR (-O0):
define void @mp_squh(i32 %0, i32 %1, i32* %2, i32* %3, i32 %4, double* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca double*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32 %4, i32* %11
store double* %5, double** %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %11
%16 = load i32*, i32** %9
%17 = load double*, double** %12
%18 = load i32, i32* %11
%19 = load double*, double** %12
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = load i32, i32* %11
%23 = load double*, double** %12
%24 = load i32*, i32** %10
ret void
}

LLVM IR (-O2):
define void @mp_squh(i32 %0, i32 %1, i32* %2, i32* %3, i32 %4, double* %5) {
tail call void @mp_mul_i2d(i32 %0, i32 %1, i32 %4, i32 0, i32* %2, double* %5)
tail call void @mp_mul_csqu(i32 %4, double* %5)
tail call void @mp_mul_d2i(i32 %0, i32 %1, i32 %4, double* %5, i32* %3)
ret void
}
int feraiseexcept(int excepts) {
  if (excepts == 0)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<feraiseexcept>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <feraiseexcept+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <feraiseexcept+0x24>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feraiseexcept>:
neg    %edi
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @feraiseexcept(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *get_version();
int /*<<< orphan*/ printf(char *, ...);
void greet(void) {
  printf("====================================================\n");
  printf("MagtiSun-SMS: %s\n", get_version());
  printf("====================================================\n");
}


x86 assembly (clang, -O0):
<greet>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <get_version@plt>
mov    %rax,%rsi
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<greet>:
push   %rbx
lea    0xeda(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <get_version@plt>
lea    0xeb2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"====================================================\0A\00"
@.str.1 = [18 x i8] c"MagtiSun-SMS: %s\0A\00"
define void @greet() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i8* (...) @get_version()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"MagtiSun-SMS: %s\0A\00"
@str.2 = [53 x i8] c"====================================================\00"
define void @greet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.2, i64 0, i64 0))
%2 = tail call i8* (...) @get_version()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.2, i64 0, i64 0))
ret void
}
unsigned f2(unsigned x, unsigned y) {
  if (y == 0)
    return x;
  y &= 8 * 4 - 1;
  return (x << y) | (x >> (8 * 4 - y));
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <f2+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <f2+0x44>
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %21
10: ; preds = %2
%11 = load i32, i32* %5
%12 = and i32 %11, 31
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = shl i32 %13, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sub i32 32, %17
%19 = lshr i32 %16, %18
%20 = or i32 %15, %19
store i32 %20, i32* %3
br label %21
21: ; preds = %10, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
void timeout(int signo) { return; }


x86 assembly (clang, -O0):
<timeout>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @timeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @timeout(i32 %0) {
ret void
}
int glyph_hash(int index, int size, int style) {
  unsigned int h;
  h = index + (style << 24) + (size << 16);
  return h % 263;
}


x86 assembly (clang, -O0):
<glyph_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x107,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glyph_hash>:
shl    $0x18,%edx
shl    $0x10,%esi
lea    (%rsi,%rdi,1),%eax
add    %edx,%eax
imul   $0x7c97d911,%rax,%rcx
shr    $0x27,%rcx
imul   $0x107,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @glyph_hash(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = shl i32 %9, 24
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %5
%13 = shl i32 %12, 16
%14 = add nsw i32 %11, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = urem i32 %15, 263
ret i32 %16
}

LLVM IR (-O2):
define i32 @glyph_hash(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 24
%5 = shl i32 %1, 16
%6 = add i32 %5, %0
%7 = add i32 %6, %4
%8 = urem i32 %7, 263
ret i32 %8
}
/* Type definitions */
struct prime_current_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_early_prime_group_1_type(struct prime_current_block *,
                                               int, int /*<<< orphan*/);
void do_early_prime_11(struct prime_current_block *pcb) {
  do_early_prime_group_1_type(pcb, 11, 0);
}


x86 assembly (clang, -O0):
<do_early_prime_11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
xor    %edx,%edx
call   1030 <do_early_prime_group_1_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_early_prime_11>:
mov    $0xb,%esi
xor    %edx,%edx
jmp    1030 <do_early_prime_group_1_type@plt>

LLVM IR (-O0):
%struct.prime_current_block = type { i32 }
define void @do_early_prime_11(%struct.prime_current_block* %0) {
%2 = alloca %struct.prime_current_block*
store %struct.prime_current_block* %0, %struct.prime_current_block** %2
%3 = load %struct.prime_current_block*, %struct.prime_current_block** %2
%4 = call i32 @do_early_prime_group_1_type(%struct.prime_current_block* %3, i32 11, i32 0)
ret void
}

LLVM IR (-O2):
%struct.prime_current_block = type { i32 }
define void @do_early_prime_11(%struct.prime_current_block* %0) {
%2 = tail call i32 @do_early_prime_group_1_type(%struct.prime_current_block* %0, i32 11, i32 0)
ret void
}
/* Variables and functions */
char *getenv(char *);
char *_get_fake_time_format() {
  char *format;
  format = getenv("FAKE_TIME_FORMAT");
  if (!format)
    format = "%Y-%m-%d %H:%M:%S";
  return format;
}


x86 assembly (clang, -O0):
<_get_fake_time_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <_get_fake_time_format+0x2e>
lea    0xed7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_fake_time_format>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xeea(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"FAKE_TIME_FORMAT\00"
@.str.1 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @_get_fake_time_format() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"FAKE_TIME_FORMAT\00"
@.str.1 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @_get_fake_time_format() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ stat(char *, struct stat *);
int isSystemd(char *initscript) {
  char tmppath[500];
  struct stat sbuf;
  snprintf(tmppath, 500, "/lib/systemd/system/%s.service", initscript);
  if (!stat(tmppath, &sbuf))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSystemd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1f4,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
lea    -0x218(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%eax
jne    1173 <isSystemd+0x53>
movl   $0x1,-0x4(%rbp)
jmp    117a <isSystemd+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSystemd>:
push   %rbx
sub    $0x210,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1f4,%esi
call   1030 <snprintf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x210,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [31 x i8] c"/lib/systemd/system/%s.service\00"
define i32 @isSystemd(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [500 x i8]
%5 = alloca %struct.stat
store i8* %0, i8** %3
%6 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @snprintf(i8* %6, i32 500, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 0
%10 = call i32 @stat(i8* %9, %struct.stat* %5)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %1
store i32 1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [31 x i8] c"/lib/systemd/system/%s.service\00"
define i32 @isSystemd(i8* %0) {
%2 = alloca [500 x i8]
%3 = alloca %struct.stat
%4 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%5 = bitcast %struct.stat* %3 to i8*
%6 = call i32 @snprintf(i8* %4, i32 500, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @stat(i8* %4, %struct.stat* %3)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
__attribute__((always_)) int PageHWPoison(struct page *page) { return 0; }


x86 assembly (clang, -O0):
<PageHWPoison>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PageHWPoison>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.page = type opaque
define i32 @PageHWPoison(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
ret i32 0
}

LLVM IR (-O2):
%struct.page = type opaque
define i32 @PageHWPoison(%struct.page* nocapture readnone %0) {
ret i32 0
}