xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ socket(int, int, int);
int isocket(int family, int type, int protocol) {
  return (int)socket(family, type, protocol);
}


x86 assembly (clang, -O0):
<isocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isocket>:
jmp    1030 <socket@plt>

LLVM IR (-O0):
define i32 @isocket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @socket(i32 %7, i32 %8, i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isocket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @socket(i32 %0, i32 %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int get_byte_order() { return (*(u_int32_t *)"a   ") & 0x00000001; }


x86 assembly (clang, -O0):
<get_byte_order>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte_order>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"a \00"
define i32 @get_byte_order() {
%1 = load i32, i32* bitcast ([5 x i8]* @.str to i32*)
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_byte_order() {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ __LDREXB(scalar_t__ volatile *);
scalar_t__ __STREXB(scalar_t__, scalar_t__ volatile *);
uint8_t atomic_incr_u8(uint8_t *valuePtr, uint8_t delta) {
  uint8_t newValue;
  do {
    newValue = __LDREXB((volatile uint8_t *)valuePtr) + delta;
  } while (__STREXB(newValue, (volatile uint8_t *)valuePtr));
  return newValue;
}


x86 assembly (clang, -O0):
<atomic_incr_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__LDREXB@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <__STREXB@plt>
cmp    $0x0,%rax
jne    1130 <atomic_incr_u8+0x10>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_incr_u8>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <__LDREXB@plt>
mov    %rax,%rbx
add    %r14,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <__STREXB@plt>
test   %rax,%rax
jne    1130 <atomic_incr_u8+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @atomic_incr_u8(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @__LDREXB(i64* %0)
%5 = add nsw i64 %4, %1
%6 = tail call i64 @__STREXB(i64 %5, i64* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncasecmp(char *, char *, int);
void strncasecmp_diff_length_6() {
  char *x = "aBDe";
  char *y = "abc";
  clang_analyzer_eval(strncasecmp(x, y, 3) > 0);
}


x86 assembly (clang, -O0):
<strncasecmp_diff_length_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncasecmp_diff_length_6>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"aBDe\00"
@.str.1 = [4 x i8] c"abc\00"
define void @strncasecmp_diff_length_6() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strncasecmp(i8* %3, i8* %4, i32 3)
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"aBDe\00"
@.str.1 = [4 x i8] c"abc\00"
define void @strncasecmp_diff_length_6() {
%1 = tail call i64 @strncasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ choisirMotDictionnairePendu(char *);
int /*<<< orphan*/ faireChoisirMotPendu(char *);
void motMysterePendu(char mot[], int modeDeJeux) {
  if (modeDeJeux == 0)
    choisirMotDictionnairePendu(mot);
  else if (modeDeJeux == 1)
    faireChoisirMotPendu(mot);
}


x86 assembly (clang, -O0):
<motMysterePendu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1147 <motMysterePendu+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <choisirMotDictionnairePendu@plt>
jmp    115f <motMysterePendu+0x3f>
cmpl   $0x1,-0xc(%rbp)
jne    115a <motMysterePendu+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <faireChoisirMotPendu@plt>
jmp    115f <motMysterePendu+0x3f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motMysterePendu>:
cmp    $0x1,%esi
je     112e <motMysterePendu+0xe>
test   %esi,%esi
jne    1133 <motMysterePendu+0x13>
jmp    1030 <choisirMotDictionnairePendu@plt>
jmp    1040 <faireChoisirMotPendu@plt>
ret

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

LLVM IR (-O2):
define void @motMysterePendu(i8* %0, i32 %1) {
switch i32 %1, label %7 [
i32 0, label %3
i32 1, label %5
]
3: ; preds = %2
%4 = tail call i32 @choisirMotDictionnairePendu(i8* %0)
br label %7
5: ; preds = %2
%6 = tail call i32 @faireChoisirMotPendu(i8* %0)
br label %7
7: ; preds = %2, %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int draw_block4x4_uncompressed_rg_half_float(const unsigned char *bitstring,
                                             unsigned int *image_buffer,
                                             int flags) {
  *(uint64_t *)&image_buffer[0] = *(uint64_t *)&bitstring[0];
  return 1;
}


x86 assembly (clang, -O0):
<draw_block4x4_uncompressed_rg_half_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_block4x4_uncompressed_rg_half_float>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @draw_block4x4_uncompressed_rg_half_float(i8* nocapture %0, i32* nocapture writeonly %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
store i32 %5, i32* %1
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ wide_char;
};
struct TYPE_4__ {
  TYPE_1__ string;
};
typedef TYPE_2__ XIMText;

/* Variables and functions */
void *get_XIMText_string_wide_char(void *_p) {
  return (void *)((XIMText *)_p)->string.wide_char;
}


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

x86 assembly (clang, -O2):
<get_XIMText_string_wide_char>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XIMText_string_wide_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XIMText_string_wide_char(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int *test, int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d", test[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func2() { printf("This is func2\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"This is func2\00"
define void @func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double log(double);
double logshift(double y, double y0) { return (log(y) + y0 - 50.); }


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

x86 assembly (clang, -O2):
<logshift>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <log@plt>
addsd  (%rsp),%xmm0
addsd  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logshift(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 = call double @log(double %5)
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = fsub double %8, 5.000000e+01
ret double %9
}

LLVM IR (-O2):
define double @logshift(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = fadd double %3, %1
%5 = fadd double %4, -5.000000e+01
ret double %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ mp2vstart_init(int *, int);
void mp2vseq_init(uint8_t *p_mp2vseq) {
  mp2vstart_init(p_mp2vseq, 0xb3);
  p_mp2vseq[10] = 0x20;
  p_mp2vseq[11] = 0x0;
}


x86 assembly (clang, -O0):
<mp2vseq_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb3,%esi
call   1030 <mp2vstart_init@plt>
mov    -0x8(%rbp),%rax
movl   $0x20,0x28(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x2c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_init>:
push   %rbx
mov    %rdi,%rbx
mov    $0xb3,%esi
call   1030 <mp2vstart_init@plt>
movq   $0x20,0x28(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mp2vseq_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @mp2vstart_init(i32* %3, i32 179)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 10
store i32 32, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 11
store i32 0, i32* %8
ret void
}

LLVM IR (-O2):
define void @mp2vseq_init(i32* %0) {
%2 = tail call i32 @mp2vstart_init(i32* %0, i32 179)
%3 = getelementptr inbounds i32, i32* %0, i64 10
store i32 32, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 11
store i32 0, i32* %4
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void busy_wait_and_clear_event(int evt) {
  const uint32_t evt_addr = (0x40000000) + 0x100 + evt * 4;
  while (!(*((volatile uint32_t *)(evt_addr))))
    ;
  *((volatile uint32_t *)(evt_addr)) = (0);
}


x86 assembly (clang, -O0):
<busy_wait_and_clear_event>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0x40000100,%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1130 <busy_wait_and_clear_event+0x30>
jmp    1135 <busy_wait_and_clear_event+0x35>
jmp    1115 <busy_wait_and_clear_event+0x15>
movslq -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<busy_wait_and_clear_event>:
movslq %edi,%rax
lea    0x40000100(,%rax,4),%rax
40
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,(%rax)
je     1110 <busy_wait_and_clear_event+0x10>
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @busy_wait_and_clear_event(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 4
%6 = add nsw i32 1073742080, %5
store i32 %6, i32* %3
br label %7
7: ; preds = %14, %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %15
14: ; preds = %7
br label %7
15: ; preds = %7
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 0, i32* %18
ret void
}

LLVM IR (-O2):
define void @busy_wait_and_clear_event(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = add nsw i32 %2, 1073742080
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
br label %6
6: ; preds = %6, %1
%7 = load volatile i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %6, label %9
9: ; preds = %6
store volatile i32 0, i32* %5
ret void
}
int euclid_gcd(int a, int b) {
  while (b) {
    int t = b;
    b = a % b;
    a = t;
  }
  return a;
}


x86 assembly (clang, -O0):
<euclid_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <euclid_gcd+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <euclid_gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <euclid_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <euclid_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @euclid_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
float rintf(float);
float nearbyintf(float x) {
  x = rintf(x);
  return x;
}


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

x86 assembly (clang, -O2):
<nearbyintf>:
jmp    1030 <rintf@plt>

LLVM IR (-O0):
define float @nearbyintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.rint.f32(float %3)
store float %4, float* %2
%5 = load float, float* %2
ret float %5
}

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = tail call float @llvm.rint.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ system(char *);
int edit_fstab(void) {
  endwin();
  system(" /usr/bin/ee "
         " /etc/fstab");
  return 0;
}


x86 assembly (clang, -O0):
<edit_fstab>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <endwin@plt>
lea    0xece(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<edit_fstab>:
push   %rax
xor    %eax,%eax
call   1040 <endwin@plt>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c" /usr/bin/ee /etc/fstab\00"
define i32 @edit_fstab() {
%1 = call i32 (...) @endwin()
%2 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c" /usr/bin/ee /etc/fstab\00"
define i32 @edit_fstab() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void SleepMode_Process(void) {}


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

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

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

LLVM IR (-O2):
define void @SleepMode_Process() {
ret void
}
/* Variables and functions */
double floor(double);
double round(double value) {
  if (value < 0)
    return -(floor(-value + 0.5));
  else
    return floor(value + 0.5);
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1179 <round+0x69>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb1(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <round+0x80>
movsd  0xe7f(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    113a <round+0x2a>
movsd  0xedd(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <floor@plt>
xorpd  0xed8(%rip),%xmm0
pop    %rax
ret
addsd  0xebe(%rip),%xmm0
pop    %rax
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = fadd double %8, 5.000000e-01
%10 = call double @llvm.floor.f64(double %9)
%11 = fneg double %10
store double %11, double* %2
br label %16
12: ; preds = %1
%13 = load double, double* %3
%14 = fadd double %13, 5.000000e-01
%15 = call double @llvm.floor.f64(double %14)
store double %15, double* %2
br label %16
16: ; preds = %12, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fsub double 5.000000e-01, %0
%5 = tail call double @llvm.floor.f64(double %4)
%6 = fneg double %5
br label %10
7: ; preds = %1
%8 = fadd double %0, 5.000000e-01
%9 = tail call double @llvm.floor.f64(double %8)
br label %10
10: ; preds = %7, %3
%11 = phi double [ %6, %3 ], [ %9, %7 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void _assert_string_equal(const char *const a, const char *const b,
                          const char *const file, const int line) {
  __coverity_panic__();
}


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

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

LLVM IR (-O0):
define void @_assert_string_equal(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @_assert_string_equal(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 (...) @__coverity_panic__()
ret void
}
void ints(int a, int b, int c, int d) {}


x86 assembly (clang, -O0):
<ints>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ints(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @ints(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
void fry(int *x, int *p) { x = p; }


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

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

LLVM IR (-O0):
define void @fry(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32* %5, i32** %3
ret void
}

LLVM IR (-O2):
define void @fry(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ int_fast64_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_int_fast64_t(int_fast64_t const k1,
                                         int_fast64_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_int_fast64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_int_fast64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_int_fast64_t(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 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_int_fast64_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void GetLocalTime(int *time, int *valid) {
  time = clock();
  valid = 1;
}


x86 assembly (clang, -O0):
<GetLocalTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @GetLocalTime(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 (...) @clock()
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %3
store i32* inttoptr (i64 1 to i32*), i32** %4
ret void
}

LLVM IR (-O2):
define void @GetLocalTime(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 (...) @clock()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ equalizer_is_active();
int /*<<< orphan*/ equalizer_set_active(int);
int /*<<< orphan*/ update_eq_name();
void req_toggle_equalizer() {
  equalizer_set_active(!equalizer_is_active());
  update_eq_name();
}


x86 assembly (clang, -O0):
<req_toggle_equalizer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <equalizer_is_active@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <equalizer_set_active@plt>
mov    $0x0,%al
call   1040 <update_eq_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<req_toggle_equalizer>:
push   %rax
xor    %eax,%eax
call   1030 <equalizer_is_active@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <equalizer_set_active@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <update_eq_name@plt>

LLVM IR (-O0):
define void @req_toggle_equalizer() {
%1 = call i32 (...) @equalizer_is_active()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
%5 = call i32 @equalizer_set_active(i32 %4)
%6 = call i32 (...) @update_eq_name()
ret void
}

LLVM IR (-O2):
define void @req_toggle_equalizer() {
%1 = tail call i32 (...) @equalizer_is_active()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @equalizer_set_active(i32 %3)
%5 = tail call i32 (...) @update_eq_name()
ret void
}
double igraph_fmin(double a, double b) {
  if (b < a) {
    return b;
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<igraph_fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <igraph_fmin+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <igraph_fmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<igraph_fmin>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @igraph_fmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @igraph_fmin(double %0, double %1) {
%3 = fcmp olt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ scanf(char *, int *, int *);
int get_int_pair(int *a, int *b) {
  if (scanf("%d %d", a, b) == EOF) {
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_int_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <scanf@plt>
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <get_int_pair+0x3b>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int_pair>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <scanf@plt>
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
je     1143 <get_int_pair+0x23>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
define i32 @get_int_pair(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 i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
define i32 @get_int_pair(i32* %0, i32* %1) {
%3 = tail call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
ret i32 0
}
void ff_hevc_put_hevc_uni_qpel_h32_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h32_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PWM_in_init(int);
void CCP_init(int mask) { PWM_in_init(mask); }


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

x86 assembly (clang, -O2):
<CCP_init>:
jmp    1030 <PWM_in_init@plt>

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

LLVM IR (-O2):
define void @CCP_init(i32 %0) {
%2 = tail call i32 @PWM_in_init(i32 %0)
ret void
}
int white(char c) {
  if (c == '\t' || c == ' ' || c == '\n')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<white>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1131 <white+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1131 <white+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    113d <white+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <white+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<white>:
cmp    $0x20,%dil
ja     1120 <white+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <white+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @white(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
struct pcg_state_setseq_128 {
  int dummy;
};

/* Variables and functions */
int pcg_setseq_128_xsh_rs_64_random_r(struct pcg_state_setseq_128 *);
uint64_t
pcg_setseq_128_xsh_rs_64_boundedrand_r(struct pcg_state_setseq_128 *rng,
                                       uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_setseq_128_xsh_rs_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_setseq_128_xsh_rs_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_setseq_128_xsh_rs_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_setseq_128_xsh_rs_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_setseq_128_xsh_rs_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_setseq_128_xsh_rs_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_setseq_128_xsh_rs_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_setseq_128_xsh_rs_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_setseq_128 = type { i32 }
define i32 @pcg_setseq_128_xsh_rs_64_boundedrand_r(%struct.pcg_state_setseq_128* %0, i32 %1) {
%3 = alloca %struct.pcg_state_setseq_128*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_setseq_128* %0, %struct.pcg_state_setseq_128** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_setseq_128*, %struct.pcg_state_setseq_128** %3
%13 = call i32 @pcg_setseq_128_xsh_rs_64_random_r(%struct.pcg_state_setseq_128* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_setseq_128 = type { i32 }
define i32 @pcg_setseq_128_xsh_rs_64_boundedrand_r(%struct.pcg_state_setseq_128* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_setseq_128_xsh_rs_64_random_r(%struct.pcg_state_setseq_128* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ spi_do8(int);
int /*<<< orphan*/ spi_start();
int /*<<< orphan*/ spi_stop();
void spi_rom_write_enable(void) {
  spi_start();
  spi_do8(0x06);
  spi_stop();
}


x86 assembly (clang, -O0):
<spi_rom_write_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <spi_start@plt>
mov    $0x6,%edi
call   1040 <spi_do8@plt>
mov    $0x0,%al
call   1050 <spi_stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_rom_write_enable>:
push   %rax
xor    %eax,%eax
call   1030 <spi_start@plt>
mov    $0x6,%edi
call   1040 <spi_do8@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <spi_stop@plt>

LLVM IR (-O0):
define void @spi_rom_write_enable() {
%1 = call i32 (...) @spi_start()
%2 = call i32 @spi_do8(i32 6)
%3 = call i32 (...) @spi_stop()
ret void
}

LLVM IR (-O2):
define void @spi_rom_write_enable() {
%1 = tail call i32 (...) @spi_start()
%2 = tail call i32 @spi_do8(i32 6)
%3 = tail call i32 (...) @spi_stop()
ret void
}
long double zisfinite(x)
long double x;
{
  long double y;
  int k;
  k = isfinitel(x);
  y = k;
  return (y);
}


x86 assembly (clang, -O0):
<zisfinite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
xor    %eax,%eax
call   1030 <isfinitel@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
fildl  -0x28(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zisfinite>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
xor    %eax,%eax
call   1030 <isfinitel@plt>
mov    %eax,0x14(%rsp)
fildl  0x14(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @zisfinite(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca i32
store x86_fp80 %0, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = call i32 (x86_fp80, ...) bitcast (i32 (...)* @isfinitel to i32 (x86_fp80, ...)*)(x86_fp80 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to x86_fp80
store x86_fp80 %8, x86_fp80* %3
%9 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @zisfinite(x86_fp80 %0) {
%2 = tail call i32 (x86_fp80, ...) bitcast (i32 (...)* @isfinitel to i32 (x86_fp80, ...)*)(x86_fp80 %0)
%3 = sitofp i32 %2 to x86_fp80
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ D_Trace(char *);
int /*<<< orphan*/ sprintf(char *, char *, char, long);
void NTraceData(char A, long n) {
  char buf[50];
  sprintf(buf, "TraceData %c %ld !", A, n);
  D_Trace(buf);
}


x86 assembly (clang, -O0):
<NTraceData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rcx
lea    0xebc(%rip),%rsi
movsbl %al,%edx
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <D_Trace@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NTraceData>:
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rcx
mov    %edi,%edx
lea    0xecf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <D_Trace@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"TraceData %c %ld !\00"
define void @NTraceData(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
%5 = alloca [50 x i8]
store i8 %0, i8* %3
store i64 %1, i64* %4
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%7 = load i8, i8* %3
%8 = load i64, i64* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %7, i64 %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%11 = call i32 @D_Trace(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"TraceData %c %ld !\00"
define void @NTraceData(i8 signext %0, i64 %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %0, i64 %1)
%6 = call i32 @D_Trace(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ forktest();
int main(void) {
  forktest();
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <forktest@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <forktest@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @forktest()
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @forktest()
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fabs(int);
float sqrt(int /*<<< orphan*/);
float findtfrom_a_vi_x(float a, float vi, float x) {
  return ((sqrt(fabs((2 * a * x) + (vi * vi))) + vi) / a);
}


x86 assembly (clang, -O0):
<findtfrom_a_vi_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xec1(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
addss  -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findtfrom_a_vi_x>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
movaps %xmm0,%xmm3
addss  %xmm0,%xmm3
movaps %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm2,%xmm3
addss  %xmm0,%xmm3
cvttss2si %xmm3,%edi
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
addss  (%rsp),%xmm0
divss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @findtfrom_a_vi_x(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = fmul float 2.000000e+00, %7
%9 = load float, float* %6
%10 = load float, float* %5
%11 = load float, float* %5
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %8, float %9, float %12)
%14 = fptosi float %13 to i32
%15 = call i32 @fabs(i32 %14)
%16 = call float @sqrt(i32 %15)
%17 = load float, float* %5
%18 = fadd float %16, %17
%19 = load float, float* %4
%20 = fdiv float %18, %19
ret float %20
}

LLVM IR (-O2):
define float @findtfrom_a_vi_x(float %0, float %1, float %2) {
%4 = fmul float %0, 2.000000e+00
%5 = fmul float %1, %1
%6 = tail call float @llvm.fmuladd.f32(float %4, float %2, float %5)
%7 = fptosi float %6 to i32
%8 = tail call i32 @fabs(i32 %7)
%9 = tail call float @sqrt(i32 %8)
%10 = fadd float %9, %1
%11 = fdiv float %10, %0
ret float %11
}
/* Variables and functions */
int EuclidGcd(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main_Gcd() {
  int M = 1989;
  int N = 1590;
  printf("%d and %d Gcd is : %d\n", M, N, EuclidGcd(M, N));
  return 0;
}


x86 assembly (clang, -O0):
<main_Gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7c5,-0x4(%rbp)
movl   $0x636,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <EuclidGcd@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_Gcd>:
push   %rax
mov    $0x7c5,%edi
mov    $0x636,%esi
call   1040 <EuclidGcd@plt>
lea    0xec9(%rip),%rdi
mov    $0x7c5,%esi
mov    $0x636,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%d and %d Gcd is : %d\0A\00"
define i32 @main_Gcd() {
%1 = alloca i32
%2 = alloca i32
store i32 1989, i32* %1
store i32 1590, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @EuclidGcd(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"%d and %d Gcd is : %d\0A\00"
define i32 @main_Gcd() {
%1 = tail call i32 @EuclidGcd(i32 1989, i32 1590)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1989, i32 1590, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *strncpy(char *dest, const char *src, size_t n) {
  memcpy(dest, src, n);
  return dest;
}


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

x86 assembly (clang, -O2):
<strncpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret i8* %0
}