xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_cfg_ext_listen_time_usage(void) {
  printf("Usage : wifidirect_cfg_ext_listen_time [<duration> <interval>]\n");
  printf("If extended listen timing parameters are provided, "
         "'set' is performed otherwise 'get' is performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wifidirect_cfg_ext_listen_time_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Usage : wifidirect_cfg_ext_listen_time [<duration> <interval>]\0A\00"
@.str.1 = [101 x i8] c"If extended listen timing parameters are provided, 'set' is performed otherwise 'get' is performed.\0A\00"
define void @print_wifidirect_cfg_ext_listen_time_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"Usage : wifidirect_cfg_ext_listen_time [<duration> <interval>]\00"
@str.2 = [100 x i8] c"If extended listen timing parameters are provided, 'set' is performed otherwise 'get' is performed.\00"
define void @print_wifidirect_cfg_ext_listen_time_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str.2, i64 0, i64 0))
ret void
}
void construct_candidates(int a[], int k, int n, int c[], int *ncandidates) {
  c[0] = 1;
  c[1] = 0;
  *ncandidates = 2;
}


x86 assembly (clang, -O0):
<construct_candidates>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x20(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<construct_candidates>:
movq   $0x1,(%rcx)
movl   $0x2,(%r8)
ret

LLVM IR (-O0):
define void @construct_candidates(i32* %0, i32 %1, i32 %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %9
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 1, i32* %12
%13 = load i32*, i32** %9
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 0, i32* %14
%15 = load i32*, i32** %10
store i32 2, i32* %15
ret void
}

LLVM IR (-O2):
define void @construct_candidates(i32* nocapture readnone %0, i32 %1, i32 %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
store i32 1, i32* %3
%6 = getelementptr inbounds i32, i32* %3, i64 1
store i32 0, i32* %6
store i32 2, i32* %4
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_mov_data(FILE *stream, uint8_t data) {
  fprintf(stream,
          "MOV   A, #"
          "0x%02X"
          "                  ",
          data);
}


x86 assembly (clang, -O0):
<fprint_mov_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_data>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"MOV A,x%02X \00"
define void @fprint_mov_data(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"MOV A,x%02X \00"
define void @fprint_mov_data(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ ssize_t;

/* Variables and functions */
ssize_t imcd_packints_encode(const uint8_t *src, const ssize_t srcsize,
                             uint8_t *dst, const ssize_t dstsize,
                             const int bps) {
  if (srcsize == 0) {
    return 0;
  }
  return -4;
}


x86 assembly (clang, -O0):
<imcd_packints_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1130 <imcd_packints_encode+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1138 <imcd_packints_encode+0x38>
movq   $0xfffffffffffffffc,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imcd_packints_encode>:
xor    %eax,%eax
test   %rsi,%rsi
sete   %al
lea    -0x4(,%rax,4),%rax
ff
ret

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

LLVM IR (-O2):
define i64 @imcd_packints_encode(i32* nocapture readnone %0, i64 %1, i32* nocapture readnone %2, i64 %3, i32 %4) {
%6 = icmp eq i64 %1, 0
%7 = select i1 %6, i64 0, i64 -4
ret i64 %7
}
/* Variables and functions */
int omap_rev();
int is_omap5912(void) {
  return (((omap_rev() >> 16) & 0xffff) == (0x1611)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap5912>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1611,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap5912>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x16110000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap5912() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 65535
%4 = icmp eq i32 %3, 5649
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap5912() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 370212864
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *cpputest_malloc_location(unsigned long, char *, int);
char *mallocAllocation() {
  return cpputest_malloc_location(
      10UL,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/List3nt0/CodeLibrary/refs/heads/master/COTS/"
      "CppUTest/2.4/tests/AllocationInCFile.c",
      17);
}


x86 assembly (clang, -O0):
<mallocAllocation>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
lea    0xee0(%rip),%rsi
mov    $0x11,%edx
call   1030 <cpputest_malloc_location@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocAllocation>:
lea    0xee9(%rip),%rsi
mov    $0xa,%edi
mov    $0x11,%edx
jmp    1030 <cpputest_malloc_location@plt>

LLVM IR (-O0):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/List3nt0/CodeLibrary/refs/heads/master/COTS/CppUTest/2.4/tests/AllocationInCFile.c\00"
define i8* @mallocAllocation() {
%1 = call i8* @cpputest_malloc_location(i64 10, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 17)
ret i8* %1
}

LLVM IR (-O2):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/List3nt0/CodeLibrary/refs/heads/master/COTS/CppUTest/2.4/tests/AllocationInCFile.c\00"
define i8* @mallocAllocation() {
%1 = tail call i8* @cpputest_malloc_location(i64 10, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 17)
ret i8* %1
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char const *, int);
int strlen(char const *);
int eq(const char *s1, const char *s2) {
  int s1_len = strlen(s1);
  int s2_len = strlen(s2);
  return s1_len == s2_len && memcmp(s1, s2, s1_len) == 0;
}


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x18(%rbp),%ecx
mov    %al,-0x19(%rbp)
jne    1173 <eq+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%ebp
jne    1159 <eq+0x39>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = call i64 @memcmp(i8* %15, i8* %16, i32 %17)
%19 = icmp eq i64 %18, 0
br label %20
20: ; preds = %14, %2
%21 = phi i1 [ false, %2 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @eq(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @memcmp(i8* %0, i8* %1, i32 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ regex_flag_basic_short(char, void *);
void regex_flag_basic_long(const char *const s __attribute__((unused)),
                           const char *const unused __attribute__((unused)),
                           void *data) {
  regex_flag_basic_short('b', data);
}


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

x86 assembly (clang, -O2):
<regex_flag_basic_long>:
mov    $0x62,%edi
mov    %rdx,%rsi
jmp    1030 <regex_flag_basic_short@plt>

LLVM IR (-O0):
define void @regex_flag_basic_long(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @regex_flag_basic_short(i8 signext 98, i8* %7)
ret void
}

LLVM IR (-O2):
define void @regex_flag_basic_long(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = tail call i32 @regex_flag_basic_short(i8 signext 98, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void a() { printf("b.c\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"b.c\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aligned_free(void *ptr) { free(((void **)(ptr))[-1]); }


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

x86 assembly (clang, -O2):
<aligned_free>:
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @aligned_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = getelementptr inbounds i8*, i8** %4, i64 -1
%6 = load i8*, i8** %5
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @aligned_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isOdd(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  for (int i = 0; i < 50; i++) {
    printf("i=%d", i);
    isOdd(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1165 <main+0x45>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <isOdd@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <isOdd@plt>
add    $0x1,%ebx
cmp    $0x32,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"i=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 50
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @isOdd(i32 %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"i=%d\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isOdd(i32 %3)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 50
br i1 %7, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void supcon_putc(unsigned char c) {
  char buffer[2];
  buffer[0] = c;
  buffer[1] = 0;
  fputs((const char *)buffer, stdout);
}


x86 assembly (clang, -O0):
<supcon_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supcon_putc>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
lea    0x6(%rsp),%rdi
call   1030 <fputs@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @supcon_putc(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %4, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* @stdout
%9 = call i32 @fputs(i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @supcon_putc(i8 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i8* %3, i32 %5)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int next();
double uni() {
  uint64_t t;
  t = next();
  t >>= 12;
  return t / 4503599627370496.;
}


x86 assembly (clang, -O0):
<uni>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <next@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
mov    %eax,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xec8(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uni>:
push   %rax
xor    %eax,%eax
call   1030 <next@plt>
sar    $0xc,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @uni() {
%1 = alloca i32
%2 = call i32 (...) @next()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 12
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 0x4330000000000000
ret double %7
}

LLVM IR (-O2):
define double @uni() {
%1 = tail call i32 (...) @next()
%2 = ashr i32 %1, 12
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CB0000000000000
ret double %4
}
/* Type definitions */
struct wl_region {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_region_set_user_data(struct wl_region *wl_region, void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_region, user_data);
}


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

x86 assembly (clang, -O2):
<wl_region_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.wl_region = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_region_set_user_data(%struct.wl_region* %0, i8* %1) {
%3 = alloca %struct.wl_region*
%4 = alloca i8*
store %struct.wl_region* %0, %struct.wl_region** %3
store i8* %1, i8** %4
%5 = load %struct.wl_region*, %struct.wl_region** %3
%6 = bitcast %struct.wl_region* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_region = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_region_set_user_data(%struct.wl_region* %0, i8* %1) {
%3 = bitcast %struct.wl_region* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
unsigned long dos_clustertoabsolute(const unsigned long clusterid,
                                    const unsigned long sectorspercluster,
                                    const unsigned long bytespersector,
                                    const unsigned long dataregion) {
  return (dataregion +
          (((clusterid - 2) * sectorspercluster) * bytespersector));
}


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

x86 assembly (clang, -O2):
<dos_clustertoabsolute>:
lea    -0x2(%rdi),%rax
imul   %rdx,%rsi
imul   %rsi,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @dos_clustertoabsolute(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %5
%11 = sub i64 %10, 2
%12 = load i64, i64* %6
%13 = mul i64 %11, %12
%14 = load i64, i64* %7
%15 = mul i64 %13, %14
%16 = add i64 %9, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @dos_clustertoabsolute(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %0, -2
%6 = mul i64 %5, %1
%7 = mul i64 %6, %2
%8 = add i64 %7, %3
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void exit_input_error(int line_num) {
  fprintf(stderr, "wrong input format at line %d\n", line_num);
  exit(1);
}


x86 assembly (clang, -O0):
<exit_input_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_input_error>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"wrong input format at line %d\0A\00"
define void @exit_input_error(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int ft_isdigit(int c) { return ('0' <= c && c <= '9'); }


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <ft_isdigit+0x24>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ aff_stuff(char **);
int checking_is_file(char **);
int /*<<< orphan*/ parsing(char **);
void checking(char **av) {
  int e_check;
  e_check = 0;
  aff_stuff(av);
  e_check = checking_is_file(av);
  if (e_check == 0)
    parsing(av);
}


x86 assembly (clang, -O0):
<checking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <aff_stuff@plt>
mov    -0x8(%rbp),%rdi
call   1040 <checking_is_file@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    116b <checking+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <parsing@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checking>:
push   %rbx
mov    %rdi,%rbx
call   1050 <aff_stuff@plt>
mov    %rbx,%rdi
call   1040 <checking_is_file@plt>
test   %eax,%eax
je     1147 <checking+0x17>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <parsing@plt>

LLVM IR (-O0):
define void @checking(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
%4 = load i8**, i8*** %2
%5 = call i32 @aff_stuff(i8** %4)
%6 = load i8**, i8*** %2
%7 = call i32 @checking_is_file(i8** %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8**, i8*** %2
%12 = call i32 @parsing(i8** %11)
br label %13
13: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @checking(i8** %0) {
%2 = tail call i32 @aff_stuff(i8** %0)
%3 = tail call i32 @checking_is_file(i8** %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @parsing(i8** %0)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int COLOR_WHITE;
short CSLP_GetCurrentPair();
int CSLP_GetForegroundColor() {
  short pair = CSLP_GetCurrentPair();
  if (pair == 0) {
    return COLOR_WHITE;
  }
  return (pair - 1) & 0x07;
}


x86 assembly (clang, -O0):
<CSLP_GetForegroundColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <CSLP_GetCurrentPair@plt>
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
cmp    $0x0,%eax
jne    1141 <CSLP_GetForegroundColor+0x31>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <CSLP_GetForegroundColor+0x3e>
movswl -0x6(%rbp),%eax
sub    $0x1,%eax
and    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSLP_GetForegroundColor>:
push   %rax
xor    %eax,%eax
call   1030 <CSLP_GetCurrentPair@plt>
test   %ax,%ax
jne    1128 <CSLP_GetForegroundColor+0x18>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
add    $0xffffffff,%eax
and    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
@COLOR_WHITE = global i32 0
define i32 @CSLP_GetForegroundColor() {
%1 = alloca i32
%2 = alloca i16
%3 = call signext i16 (...) @CSLP_GetCurrentPair()
store i16 %3, i16* %2
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* @COLOR_WHITE
store i32 %8, i32* %1
br label %14
9: ; preds = %0
%10 = load i16, i16* %2
%11 = sext i16 %10 to i32
%12 = sub nsw i32 %11, 1
%13 = and i32 %12, 7
store i32 %13, i32* %1
br label %14
14: ; preds = %9, %7
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@COLOR_WHITE = global i32 0
define i32 @CSLP_GetForegroundColor() {
%1 = tail call signext i16 (...) @CSLP_GetCurrentPair()
%2 = icmp eq i16 %1, 0
%3 = load i32, i32* @COLOR_WHITE
%4 = add i16 %1, 7
%5 = and i16 %4, 7
%6 = zext i16 %5 to i32
%7 = select i1 %2, i32 %3, i32 %6
ret i32 %7
}
int test_imm_72int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x72 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_72int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x72,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_72int64_highword_mem>:
testb  $0x72,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_72int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 114
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_72int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 489626271744
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void pumax_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @pumax_dummy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printNewlines(int i) {
  for (; i > 0; i--)
    printf("\n");
}


x86 assembly (clang, -O0):
<printNewlines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113f <printNewlines+0x2f>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <printNewlines+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNewlines>:
push   %rbx
test   %edi,%edi
jle    1132 <printNewlines+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <printNewlines+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @printNewlines(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @printNewlines(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @putchar(i32 10)
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
void ADC_SAR_1_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_SAR_1_ISR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buildProgramFromAmdBin(int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void main(int argc, char **argv) {
  if (argc < 2) {
    printf("USAGE <./clbinuse><KernelBin>\n");
    exit(-1);
  }
  buildProgramFromAmdBin(1, 0, argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    115f <main+0x2f>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <buildProgramFromAmdBin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1147 <main+0x17>
mov    0x8(%rsi),%rdx
mov    $0x1,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <buildProgramFromAmdBin@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"USAGE <./clbinuse><KernelBin>\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @buildProgramFromAmdBin(i32 1, i32 0, i8* %13)
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"USAGE <./clbinuse><KernelBin>\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @buildProgramFromAmdBin(i32 1, i32 0, i8* %9)
ret void
}
/* Variables and functions */
int gfarm_hash_casefold(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int gfarm_hash_casefold_strptr(const void *key, int keylen) {
  const char *const *strptr = key;
  const char *str = *strptr;
  return (gfarm_hash_casefold(str, strlen(str)));
}


x86 assembly (clang, -O0):
<gfarm_hash_casefold_strptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <gfarm_hash_casefold@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfarm_hash_casefold_strptr>:
push   %rbx
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <gfarm_hash_casefold@plt>

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

LLVM IR (-O2):
define i32 @gfarm_hash_casefold_strptr(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @gfarm_hash_casefold(i8* %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void n(int i) {
  int j = 0;
  int t = 0;
  switch (i) {
  case 1:
    j = 1;
  case 2:
    j = 2;
    t = 2;
    break;
  }
  assert(j == 2 && t == 2 || j == 0 && t == 0);
}


x86 assembly (clang, -O0):
<n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     114e <n+0x3e>
jmp    113d <n+0x2d>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1155 <n+0x45>
jmp    1163 <n+0x53>
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    117c <n+0x6c>
mov    $0x1,%al
cmpl   $0x2,-0xc(%rbp)
mov    %al,-0x11(%rbp)
je     119b <n+0x8b>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x12(%rbp)
jne    1195 <n+0x85>
cmpl   $0x0,-0xc(%rbp)
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @n(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
switch i32 %5, label %8 [
i32 1, label %6
i32 2, label %7
]
6: ; preds = %1
store i32 1, i32* %3
br label %7
7: ; preds = %1, %6
store i32 2, i32* %3
store i32 2, i32* %4
br label %8
8: ; preds = %1, %7
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 2
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 0
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11
%23 = phi i1 [ true, %11 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
ret void
}

LLVM IR (-O2):
define void @n(i32 %0) {
%2 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __settimeofday(const struct timeval *tv, const struct timezone *tz) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__settimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__settimeofday>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@ENOSYS = global i32 0
define i32 @__settimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@ENOSYS = global i32 0
define i32 @__settimeofday(%struct.timeval* nocapture readnone %0, %struct.timezone* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
char isAlpha(char c) {
  if (c >= ' ' && c < 127) {
    return (c);
  }
  return ('.');
}


x86 assembly (clang, -O0):
<isAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     112f <isAlpha+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jge    112f <isAlpha+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1133 <isAlpha+0x33>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlpha>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%al
mov    $0x2e,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @isAlpha(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 127
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %14
13: ; preds = %7, %1
store i8 46, i8* %2
br label %14
14: ; preds = %13, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @isAlpha(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = select i1 %3, i8 %0, i8 46
ret i8 %4
}
/* Variables and functions */
int exp(double);
double hiTinhib(double T) {
  double hiTinhib;
  hiTinhib = 1. / (1. + exp(1.3 * (T - 55.)));
  return hiTinhib;
}


x86 assembly (clang, -O0):
<hiTinhib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xee6(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb5(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiTinhib>:
push   %rax
addsd  0xee7(%rip),%xmm0
mulsd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xede(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hiTinhib(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 5.500000e+01
%6 = fmul double 1.300000e+00, %5
%7 = call i32 @exp(double %6)
%8 = sitofp i32 %7 to double
%9 = fadd double 1.000000e+00, %8
%10 = fdiv double 1.000000e+00, %9
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @hiTinhib(double %0) {
%2 = fadd double %0, -5.500000e+01
%3 = fmul double %2, 1.300000e+00
%4 = tail call i32 @exp(double %3)
%5 = sitofp i32 %4 to double
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double 1.000000e+00, %6
ret double %7
}
int d_bge_mr1(double *a1, double a2) {
  return (__builtin_isgreaterequal(*a1, a2));
}


x86 assembly (clang, -O0):
<d_bge_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bge_mr1>:
movsd  (%rdi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @d_bge_mr1(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp oge double %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_bge_mr1(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp oge double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned char mc_is_deadspace(unsigned char i) {
  if (i >= 14 && i <= 16) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<mc_is_deadspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xe,%eax
jl     112d <mc_is_deadspace+0x2d>
movzbl -0x2(%rbp),%eax
cmp    $0x10,%eax
jg     112d <mc_is_deadspace+0x2d>
movb   $0x1,-0x1(%rbp)
jmp    1131 <mc_is_deadspace+0x31>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_is_deadspace>:
add    $0xf2,%dil
cmp    $0x3,%dil
setb   %al
ret

LLVM IR (-O0):
define zeroext i8 @mc_is_deadspace(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 14
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 16
br i1 %10, label %11, label %12
11: ; preds = %7
store i8 1, i8* %2
br label %13
12: ; preds = %7, %1
store i8 0, i8* %2
br label %13
13: ; preds = %12, %11
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @mc_is_deadspace(i8 zeroext %0) {
%2 = add i8 %0, -14
%3 = icmp ult i8 %2, 3
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timespec {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ abort();
int clock_gettime(int /*<<< orphan*/, struct timespec *);
time_t mt_time(void) {
  int res;
  struct timespec ts;
  res = clock_gettime(CLOCK_MONOTONIC, &ts);
  if (res)
    abort();
  return ts.tv_sec;
}


x86 assembly (clang, -O0):
<mt_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114e <mt_time+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_time>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <clock_gettime@plt>
test   %eax,%eax
jne    113b <mt_time+0x1b>
mov    (%rsp),%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @mt_time() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %2)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @mt_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int sort_utils_int64_t_icmp(const void *const a, const void *const b) {
  const int64_t *const x = (const int64_t *const)a;
  const int64_t *const y = (const int64_t *const)b;
  return (*x < *y) - (*x > *y);
}


x86 assembly (clang, -O0):
<sort_utils_int64_t_icmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_utils_int64_t_icmp>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setl   %al
setg   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @sort_utils_int64_t_icmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %6
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = icmp slt i64 %12, %14
%16 = zext i1 %15 to i32
%17 = load i64*, i64** %5
%18 = load i64, i64* %17
%19 = load i64*, i64** %6
%20 = load i64, i64* %19
%21 = icmp sgt i64 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @sort_utils_int64_t_icmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ hw_done();
int /*<<< orphan*/ printf(char *);
void exitFunction() {
  printf("Exit function\n");
  hw_done();
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Exit function\0A\00"
define void @exitFunction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @hw_done()
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Exit function\00"
define void @exitFunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @hw_done()
ret void
}
void av_get_pix_fmt_string() {}


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

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

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

LLVM IR (-O2):
define void @av_get_pix_fmt_string() {
ret void
}