xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xa3() {
  Assert_real((isalpha(163) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              820, ("isalpha should be 0 for 0xa3"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xa3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa3,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x334,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xa3>:
push   %rax
mov    $0xa3,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x334,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xa3\00"
define void @t_isalpha_0xa3() {
%1 = call i64 @isalpha(i32 163)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 820, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xa3\00"
define void @t_isalpha_0xa3() {
%1 = tail call i64 @isalpha(i32 163)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 820, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t ntoh16(const uint8_t *src) { return (uint16_t)src[0] << 8 | src[1]; }


x86 assembly (clang, -O0):
<ntoh16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntoh16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ntoh16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ntoh16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
void boardInit() {}


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

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

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

LLVM IR (-O2):
define void @boardInit() {
ret void
}
/* Type definitions */
struct ascii85 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ascii85_close(struct ascii85 *);
void ascii85_close(void *ctx) { _ascii85_close((struct ascii85 *)ctx); }


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

x86 assembly (clang, -O2):
<ascii85_close>:
jmp    1030 <_ascii85_close@plt>

LLVM IR (-O0):
%struct.ascii85 = type { i32 }
define void @ascii85_close(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.ascii85*
%5 = call i32 @_ascii85_close(%struct.ascii85* %4)
ret void
}

LLVM IR (-O2):
%struct.ascii85 = type { i32 }
define void @ascii85_close(i8* %0) {
%2 = bitcast i8* %0 to %struct.ascii85*
%3 = tail call i32 @_ascii85_close(%struct.ascii85* %2)
ret void
}
/* Type definitions */
struct pilha {
  int dummy;
};

/* Variables and functions */
scalar_t__ pop(struct pilha *);
int makenull(struct pilha *p) {
  while (pop(p) != 0) {
  }
  return 1;
}


x86 assembly (clang, -O0):
<makenull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pop@plt>
cmp    $0x0,%rax
je     1134 <makenull+0x24>
jmp    111c <makenull+0xc>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makenull>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <pop@plt>
test   %rax,%rax
jne    1120 <makenull+0x10>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.pilha = type { i32 }
define i32 @makenull(%struct.pilha* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @pop(%struct.pilha* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void Controls_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_0");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_1");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame2_l");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame1_r");
}


x86 assembly (clang, -O0):
<Controls_Cache>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef1(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xefd(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf0b(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Controls_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef4(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf00(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf0e(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.1 = [24 x i8] c"menu/art_blueish/back_1\00"
@.str.2 = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.3 = [26 x i8] c"menu/art_blueish/frame1_r\00"
define void @Controls_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.1 = [24 x i8] c"menu/art_blueish/back_1\00"
@.str.2 = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.3 = [26 x i8] c"menu/art_blueish/frame1_r\00"
define void @Controls_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_scs(int);
int sane_cs(int);
int reset_scs(int g) {
  int n = sane_cs(g);
  do_scs(n);
  return n;
}


x86 assembly (clang, -O0):
<reset_scs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sane_cs@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <do_scs@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_scs>:
push   %rbx
call   1030 <sane_cs@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <do_scs@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @reset_scs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sane_cs(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @do_scs(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @reset_scs(i32 %0) {
%2 = tail call i32 @sane_cs(i32 %0)
%3 = tail call i32 @do_scs(i32 %2)
ret i32 %2
}
unsigned char *PopCharPixel(const unsigned char pixel, unsigned char *pixels) {
  *pixels++ = (unsigned char)(pixel);
  return (pixels);
}


x86 assembly (clang, -O0):
<PopCharPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopCharPixel>:
mov    %dil,(%rsi)
lea    0x1(%rsi),%rax
ret

LLVM IR (-O0):
define i8* @PopCharPixel(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
store i8 %5, i8* %6
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define i8* @PopCharPixel(i8 zeroext %0, i8* writeonly %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %0, i8* %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ pause();
void Pause() { (void)pause(); }


x86 assembly (clang, -O0):
<Pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pause@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pause>:
xor    %eax,%eax
jmp    1030 <pause@plt>

LLVM IR (-O0):
define void @Pause() {
%1 = call i32 (...) @pause()
ret void
}

LLVM IR (-O2):
define void @Pause() {
%1 = tail call i32 (...) @pause()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_rev(char *);
void _rev_or_not(char *s) {
  if (s[0] == '-') {
    str_rev(&s[1]);
  } else {
    str_rev(s);
  }
}


x86 assembly (clang, -O0):
<_rev_or_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    113e <_rev_or_not+0x2e>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <str_rev@plt>
jmp    1147 <_rev_or_not+0x37>
mov    -0x8(%rbp),%rdi
call   1030 <str_rev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rev_or_not>:
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
sete   %al
add    %rax,%rdi
jmp    1030 <str_rev@plt>

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

LLVM IR (-O2):
define void @_rev_or_not(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
%6 = tail call i32 @str_rev(i8* %5)
ret void
}
void __srpc_init() {}


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

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

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

LLVM IR (-O2):
define void @__srpc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int);
int alldigits(char *s) {
  int ch;
  while ((ch = *s++) != '\0') {
    if (!isdigit(ch)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<alldigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     115c <alldigits+0x4c>
mov    -0x14(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1157 <alldigits+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1163 <alldigits+0x53>
jmp    111c <alldigits+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alldigits>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1116 <alldigits+0x16>
add    $0x1,%rdi
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     1100 <alldigits>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @alldigits(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = sext i8 %4 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = add nsw i32 %7, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %2, label %11
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void get_the_time(void) {
  time_t timer;
  char buffer[32];
  struct tm *tm_info;
  time(&timer);
  tm_info = localtime(&timer);
  strftime(buffer, 32, "%Y-%m-%dT%H:%M:%S%z", tm_info);
  printf("%s\n", buffer);
}


x86 assembly (clang, -O0):
<get_the_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x20,%esi
lea    0xe8e(%rip),%rdx
call   1060 <strftime@plt>
lea    -0x30(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_the_time>:
push   %rbx
sub    $0x30,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0xe9f(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [20 x i8] c"%Y-%m-%dT%H:%M:%S%z\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @get_the_time() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @time(i32* %1)
%6 = call %struct.tm* @localtime(i32* %1)
%7 = call i32 @strftime(i8* %4, i32 32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double cd_util_rand_double(double min, double max) {
  return min + (max - min) * ((double)rand() / (double)RAND_MAX);
}


x86 assembly (clang, -O0):
<cd_util_rand_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
cvtsi2sd %rax,%xmm2
mov    0x2e90(%rip),%rax
cvtsi2sdq (%rax),%xmm3
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_util_rand_double>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eae(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @cd_util_rand_double(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* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = call i64 (...) @rand()
%10 = sitofp i64 %9 to double
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to double
%13 = fdiv double %10, %12
%14 = call double @llvm.fmuladd.f64(double %8, double %13, double %5)
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @cd_util_rand_double(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
%9 = tail call double @llvm.fmuladd.f64(double %3, double %8, double %0)
ret double %9
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_initialize_number_of_dobldobl_Laurentials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(553, &length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_initialize_number_of_dobldobl_Laurentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x229,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_initialize_number_of_dobldobl_Laurentials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x229,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_initialize_number_of_dobldobl_Laurentials(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 553, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_dobldobl_Laurentials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 553, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(char *progname) {
  printf("Usage: %s <minetest.model> <texture.png> <resolution> <output.png> "
         "[parameters]\n"
         "Resolution is integer. Output image will be square.\n"
         "Parameters:\n\t-left-tex <texture.png> - left side texture\n\t"
         "-right-tex <texture.png> - right side texture\n\t"
         "-factor <x> - render x times larger image and downscale it before "
         "output\n\t"
         "-rotx, -roty, -rotz - rotate image along axis clockwise\n\t"
         "-flipx, -flipy, -flipz - flip image along axis\n",
         progname);
}


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

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

LLVM IR (-O0):
@.str = [416 x i8] c"Usage: %s <minetest.model> <texture.png> <resolution> <output.png> [parameters]\0AResolution is integer. Output image will be square.\0AParameters:\0A\09-left-tex <texture.png> - left side texture\0A\09-right-tex <texture.png> - right side texture\0A\09-factor <x> - render x times larger image and downscale it before output\0A\09-rotx, -roty, -rotz - rotate image along axis clockwise\0A\09-flipx, -flipy, -flipz - flip image along axis\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([416 x i8], [416 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [416 x i8] c"Usage: %s <minetest.model> <texture.png> <resolution> <output.png> [parameters]\0AResolution is integer. Output image will be square.\0AParameters:\0A\09-left-tex <texture.png> - left side texture\0A\09-right-tex <texture.png> - right side texture\0A\09-factor <x> - render x times larger image and downscale it before output\0A\09-rotx, -roty, -rotz - rotate image along axis clockwise\0A\09-flipx, -flipy, -flipz - flip image along axis\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([416 x i8], [416 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int dasm_ffs(unsigned long long x) {
  int n = -1;
  while (x) {
    x >>= 1;
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<dasm_ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <dasm_ffs+0x34>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <dasm_ffs+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dasm_ffs>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111f <dasm_ffs+0x1f>
mov    %rdi,%rcx
nopl   (%rax)
shr    %rcx
add    $0x1,%eax
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <dasm_ffs+0x10>
ret

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

LLVM IR (-O2):
define i32 @dasm_ffs(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ -1, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nsw i32 %4, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %10
}
int f3(unsigned char c) {
  int i = c;
  if (i < 0 || i > 255)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1128 <f3+0x28>
cmpl   $0xff,-0xc(%rbp)
jle    1134 <f3+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    113b <f3+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f3(i8 zeroext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char str1[15];
  strcpy(str1, "Linkerist");
  puts(str1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xf(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xf(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rsi
lea    0x1(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Linkerist\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Linkerist\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int c;
  float mm[2] = {1, 2};
  c = mm[1] > mm[0];
  print("c 1");
  printid(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.mm = [2 x float] [float 1.000000e+00, float 2.000000e+00]
@.str = [4 x i8] c"c 1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x float]
store i32 0, i32* %1
%4 = bitcast [2 x float]* %3 to i8*
%5 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%8 = load float, float* %7
%9 = fcmp ogt float %6, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %2
%11 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @printid(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"c 1\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _printk(char *, char *);
_warn(char *msg) { _printk("*** Warning: %s UNIMPLEMENTED!\n", msg); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"*** Warning: %s UNIMPLEMENTED!\0A\00"
define i32 @_warn(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @_printk(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [32 x i8] c"*** Warning: %s UNIMPLEMENTED!\0A\00"
define i32 @_warn(i8* %0) {
%2 = tail call i32 @_printk(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ bmi_test();
void __attribute__((no)) do_test(void) { bmi_test(); }


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bmi_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
xor    %eax,%eax
jmp    1030 <bmi_test@plt>

LLVM IR (-O0):
define void @do_test() {
%1 = call i32 (...) @bmi_test()
ret void
}

LLVM IR (-O2):
define void @do_test() {
%1 = tail call i32 (...) @bmi_test()
ret void
}
int test_imm_56uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x56 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_56uint64_highword_reg>:
movabs $0x5600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_56uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 369367187456
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float det2x2(float a, float b, float c, float d) {
  return ((a) * (d) - (b) * (c));
}


x86 assembly (clang, -O0):
<det2x2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<det2x2>:
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @det2x2(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %8
%11 = load float, float* %6
%12 = load float, float* %7
%13 = fmul float %11, %12
%14 = fneg float %13
%15 = call float @llvm.fmuladd.f32(float %9, float %10, float %14)
ret float %15
}

LLVM IR (-O2):
define float @det2x2(float %0, float %1, float %2, float %3) {
%5 = fneg float %1
%6 = fmul float %5, %2
%7 = tail call float @llvm.fmuladd.f32(float %0, float %3, float %6)
ret float %7
}
/* Variables and functions */
double factorial(int);
double binomial_distribution(int n, int k) {
  return factorial(n) / (double)(factorial(k) * factorial(n - k));
}


x86 assembly (clang, -O0):
<binomial_distribution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factorial@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binomial_distribution>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <factorial@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
call   1030 <factorial@plt>
movsd  %xmm0,0x8(%rsp)
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <factorial@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @binomial_distribution(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 = call double @factorial(i32 %5)
%7 = load i32, i32* %4
%8 = call double @factorial(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call double @factorial(i32 %11)
%13 = fmul double %8, %12
%14 = fdiv double %6, %13
ret double %14
}

LLVM IR (-O2):
define double @binomial_distribution(i32 %0, i32 %1) {
%3 = tail call double @factorial(i32 %0)
%4 = tail call double @factorial(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call double @factorial(i32 %5)
%7 = fmul double %4, %6
%8 = fdiv double %3, %7
ret double %8
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateRTCSSMatchSet(uint32_t ui32Match, uint32_t ui32Value) {
  ASSERT(ui32Match == 0);
  (*((volatile uint32_t *)(0x400FC028))) = ui32Value << 16;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCSSMatchSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
mov    $0x400fc028,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCSSMatchSet>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
mov    %eax,%edi
call   1040 <ASSERT@plt>
shl    $0x10,%rbx
mov    %rbx,0x400fc028
40
xor    %eax,%eax
pop    %rbx
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCSSMatchSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = shl i64 %9, 16
store volatile i64 %10, i64* inttoptr (i64 1074774056 to i64*)
%11 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCSSMatchSet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = shl i64 %1, 16
store volatile i64 %6, i64* inttoptr (i64 1074774056 to i64*)
%7 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
void kPanic(void) {
  userPanic();
  while (1) {
    asm("nop");
  }
}


x86 assembly (clang, -O0):
<kPanic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <userPanic@plt>
nop
jmp    111b <kPanic+0xb>

x86 assembly (clang, -O2):
<kPanic>:
push   %rax
xor    %eax,%eax
call   1030 <userPanic@plt>
nopl   0x0(%rax,%rax,1)
nop
jmp    1120 <kPanic+0x10>

LLVM IR (-O0):
define void @kPanic() {
%1 = call i32 (...) @userPanic()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @kPanic() {
%1 = tail call i32 (...) @userPanic()
br label %2
2: ; preds = %0, %2
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test_no_clause() {
  int i;
#pragma omp single
  foo();
#pragma omp single
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_clause>:
xor    %eax,%eax
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test_no_clause() {
%1 = alloca i32
%2 = call i32 (...) @foo()
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
ret void
}

LLVM IR (-O2):
define void @test_no_clause() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  while (1)
    printf("getchar() != EOF的值：%d\n", getchar() != EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
movzbl %al,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
lea    0xece(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %esi,%esi
cmp    (%r14),%rax
setne  %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [29 x i8] c"getchar() != EOF\E7\9A\84\E5\80\BC\EF\BC\9A%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %2
}

LLVM IR (-O2):
@.str = [29 x i8] c"getchar() != EOF\E7\9A\84\E5\80\BC\EF\BC\9A%d\0A\00"
@EOF = global i64 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %1
}
/* Variables and functions */
scalar_t__ malloc(int);
double *alloc_matrix(int n) {
  double *res = (double *)malloc(sizeof(double) * n * n);
  return res;
}


x86 assembly (clang, -O0):
<alloc_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_matrix>:
imul   %edi,%edi
shl    $0x3,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define double* @alloc_matrix(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 8, %5
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = mul i64 %6, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to double*
store double* %12, double** %3
%13 = load double*, double** %3
ret double* %13
}

LLVM IR (-O2):
define double* @alloc_matrix(i32 %0) {
%2 = shl i32 %0, 3
%3 = mul i32 %2, %0
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to double*
ret double* %5
}
/* Variables and functions */
int strcmp(char *, char *);
int descending(const void *a1, const void *a2) {
  return strcmp((char *)a2, (char *)a1);
}


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

x86 assembly (clang, -O2):
<descending>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @descending(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @descending(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
ret i32 %3
}
int ss_leb128skip(char *src) {
  unsigned char *start = (unsigned char *)src;
  while (*((unsigned char *)src++) >= 128)
    ;
  return (unsigned char *)src - start;
}


x86 assembly (clang, -O0):
<ss_leb128skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
cmp    $0x80,%eax
jl     1132 <ss_leb128skip+0x32>
jmp    1110 <ss_leb128skip+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_leb128skip>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
js     1110 <ss_leb128skip+0x10>
ret

LLVM IR (-O0):
define i32 @ss_leb128skip(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = icmp sge i32 %9, 128
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ss_leb128skip(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp slt i8 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("test\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"test\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int arg(int);
int first_(int list) { return arg(list); }


x86 assembly (clang, -O0):
<first_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <arg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_>:
jmp    1030 <arg@plt>

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

LLVM IR (-O2):
define i32 @first_(i32 %0) {
%2 = tail call i32 @arg(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ uwsgi_php_init();
void uwsgi_opt_early_php(char *opt, char *value, void *foobar) {
  uwsgi_php_init();
}


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

x86 assembly (clang, -O2):
<uwsgi_opt_early_php>:
xor    %eax,%eax
jmp    1030 <uwsgi_php_init@plt>

LLVM IR (-O0):
define void @uwsgi_opt_early_php(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 = call i32 (...) @uwsgi_php_init()
ret void
}

LLVM IR (-O2):
define void @uwsgi_opt_early_php(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @uwsgi_php_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void fatal_error(char msg[]) {
  printf("Error: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @fatal_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int digitCount(int digit) {
  int counter = 0;
  if (digit < 0) {
    digit *= -1;
  }
  while (digit) {
    digit /= 10;
    counter++;
  }
  return counter;
}


x86 assembly (clang, -O0):
<digitCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <digitCount+0x1f>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <digitCount+0x24>
cmpl   $0x0,-0x4(%rbp)
je     114a <digitCount+0x4a>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <digitCount+0x24>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitCount>:
test   %edi,%edi
je     1133 <digitCount+0x33>
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
nopl   (%rax)
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    $0x1,%eax
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <digitCount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @digitCount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i32 [ %8, %5 ], [ %4, %3 ]
%8 = sdiv i32 %7, 10
%9 = add nuw nsw i32 %6, 1
%10 = add i32 %7, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %13
}