xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ copy_buffer(int, double *, double *);
int /*<<< orphan*/ rand_doubles(int, double *);
void reset_values(int size, double *a, double *b, double *c, double *c_copy) {
  rand_doubles(size, a);
  rand_doubles(size, b);
  rand_doubles(size, c);
  copy_buffer(size, c, c_copy);
}


x86 assembly (clang, -O0):
<reset_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <rand_doubles@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <rand_doubles@plt>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <rand_doubles@plt>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <copy_buffer@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_values>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %edi,%ebp
call   1040 <rand_doubles@plt>
mov    %ebp,%edi
mov    %r15,%rsi
call   1040 <rand_doubles@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <rand_doubles@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <copy_buffer@plt>

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

LLVM IR (-O2):
define void @reset_values(i32 %0, double* %1, double* %2, double* %3, double* %4) {
%6 = tail call i32 @rand_doubles(i32 %0, double* %1)
%7 = tail call i32 @rand_doubles(i32 %0, double* %2)
%8 = tail call i32 @rand_doubles(i32 %0, double* %3)
%9 = tail call i32 @copy_buffer(i32 %0, double* %3, double* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
float bufToFloat(uint8_t *buf) { return *((float *)buf); }


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

x86 assembly (clang, -O2):
<bufToFloat>:
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @bufToFloat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to float*
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @bufToFloat(i32* nocapture %0) {
%2 = bitcast i32* %0 to float*
%3 = load float, float* %2
ret float %3
}
_Bool prefix(const char *x, const char *y) {
  return strncmp(x, y, strlen(x)) == 0;
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
test   %eax,%eax
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define zeroext i1 @prefix(i8* %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 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i64 %8)
%10 = icmp eq i32 %9, 0
ret i1 %10
}

LLVM IR (-O2):
define zeroext i1 @prefix(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i32 %4, 0
ret i1 %5
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void error(const char *s) { write(2, s, strlen(s)); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @error(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ token_delete(void *);
void token_delete_cb(void *p_void) { token_delete(p_void); }


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

x86 assembly (clang, -O2):
<token_delete_cb>:
jmp    1030 <token_delete@plt>

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

LLVM IR (-O2):
define void @token_delete_cb(i8* %0) {
%2 = tail call i32 @token_delete(i8* %0)
ret void
}
/* Variables and functions */
int gword();
int /*<<< orphan*/ lprintf(char *, int);
void reladdr(__attribute__((unused)) char sep) {
  int d = gword();
  lprintf("RELADDR=%d", d);
  return;
}


x86 assembly (clang, -O0):
<reladdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <gword@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1040 <lprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reladdr>:
push   %rax
xor    %eax,%eax
call   1030 <gword@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <lprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"RELADDR=%d\00"
define void @reladdr(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = call i32 (...) @gword()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @lprintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"RELADDR=%d\00"
define void @reladdr(i8 signext %0) {
%2 = tail call i32 (...) @gword()
%3 = tail call i32 @lprintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_JPEG_SelectHT(unsigned char byHTIndex) {
  VIM_HIF_SetReg8((0x0000 + 0x001), (unsigned char)(byHTIndex << 6));
}


x86 assembly (clang, -O0):
<VIM_JPEG_SelectHT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x6,%eax
mov    $0x1,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_SelectHT>:
shl    $0x6,%dil
movzbl %dil,%esi
mov    $0x1,%edi
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_JPEG_SelectHT(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 6
%6 = trunc i32 %5 to i8
%7 = call i32 @VIM_HIF_SetReg8(i32 1, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @VIM_JPEG_SelectHT(i8 zeroext %0) {
%2 = shl i8 %0, 6
%3 = tail call i32 @VIM_HIF_SetReg8(i32 1, i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ push1(int);
void push_at_start(int x) {
  push1(x);
  return;
}


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

x86 assembly (clang, -O2):
<push_at_start>:
jmp    1030 <push1@plt>

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

LLVM IR (-O2):
define void @push_at_start(i32 %0) {
%2 = tail call i32 @push1(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dead();
int test10(void) {
  switch (8) {
  case 8:
    break;
  case 4:
    break;
  default:
    dead();
  }
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @test10() {
ret i32 0
}

LLVM IR (-O2):
define i32 @test10() {
ret i32 0
}
int f(long long int a, long long int b, int *d) {
  long long int c = a - b;
  *d = (c == 0LL);
  return c >= 0LL;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x20(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
xor    %ecx,%ecx
sub    %rsi,%rax
sete   %cl
mov    %ecx,(%rdx)
shr    $0x3f,%rax
xor    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f(i64 %0, i64 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = sub nsw i64 %8, %9
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
%14 = load i32*, i32** %6
store i32 %13, i32* %14
%15 = load i64, i64* %7
%16 = icmp sge i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @f(i64 %0, i64 %1, i32* nocapture writeonly %2) {
%4 = sub nsw i64 %0, %1
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
%7 = lshr i64 %4, 63
%8 = trunc i64 %7 to i32
%9 = xor i32 %8, 1
ret i32 %9
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void blind_rage(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 120)) {
    add_status(target, 28);
  }
}


x86 assembly (clang, -O0):
<blind_rage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x78,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1180 <blind_rage+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x1c,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blind_rage>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x78,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    1171 <blind_rage+0x41>
mov    %r14,%rdi
mov    $0x1c,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @blind_rage(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 120)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 28)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @blind_rage(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 120)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 28)
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
struct metal_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ metal_list_add_after(struct metal_list *,
                                        struct metal_list *);
void metal_list_add_head(struct metal_list *list, struct metal_list *node) {
  metal_list_add_after(list, node);
}


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

x86 assembly (clang, -O2):
<metal_list_add_head>:
jmp    1030 <metal_list_add_after@plt>

LLVM IR (-O0):
%struct.metal_list = type { i32 }
define void @metal_list_add_head(%struct.metal_list* %0, %struct.metal_list* %1) {
%3 = alloca %struct.metal_list*
%4 = alloca %struct.metal_list*
store %struct.metal_list* %0, %struct.metal_list** %3
store %struct.metal_list* %1, %struct.metal_list** %4
%5 = load %struct.metal_list*, %struct.metal_list** %3
%6 = load %struct.metal_list*, %struct.metal_list** %4
%7 = call i32 @metal_list_add_after(%struct.metal_list* %5, %struct.metal_list* %6)
ret void
}

LLVM IR (-O2):
%struct.metal_list = type { i32 }
define void @metal_list_add_head(%struct.metal_list* %0, %struct.metal_list* %1) {
%3 = tail call i32 @metal_list_add_after(%struct.metal_list* %0, %struct.metal_list* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testloop();
int main() { testloop(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @testloop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testloop()
ret i32 0
}
void XNullHandler(void *NullParameter) { (void *)NullParameter; }


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

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

LLVM IR (-O0):
define void @XNullHandler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @XNullHandler(i8* nocapture %0) {
ret void
}
int get_left_available(int ypos, int xpos, int size, int width) {
  int left_available = xpos > 0;
  return left_available;
}


x86 assembly (clang, -O0):
<get_left_available>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_left_available>:
xor    %eax,%eax
test   %esi,%esi
setg   %al
ret

LLVM IR (-O0):
define i32 @get_left_available(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = icmp sgt i32 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %9
%13 = load i32, i32* %9
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_left_available(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ NoPinC__0__GeneralIO__set();
void LedsP__Led1__set(void) { NoPinC__0__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__set() {
%1 = tail call i32 (...) @NoPinC__0__GeneralIO__set()
ret void
}
/* Variables and functions */
void *ft_memchr(const void *mem, unsigned char c, size_t n) {
  size_t i;
  i = 0;
  while (i < n) {
    if (((unsigned char *)mem)[i] == c)
      return ((void *)(mem + i));
    i++;
  }
  return (NULL);
}


x86 assembly (clang, -O0):
<ft_memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1162 <ft_memchr+0x62>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movzbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1151 <ft_memchr+0x51>
mov    -0x10(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <ft_memchr+0x6a>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    111a <ft_memchr+0x1a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memchr>:
test   %rdx,%rdx
je     111f <ft_memchr+0x1f>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1121 <ft_memchr+0x21>
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1110 <ft_memchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @ft_memchr(i8* %0, i8 zeroext %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8 %1, i8* %6
store i64 %2, i64* %7
store i64 0, i64* %8
br label %9
9: ; preds = %26, %3
%10 = load i64, i64* %8
%11 = load i64, i64* %7
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %29
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i64, i64* %8
%16 = getelementptr inbounds i8, i8* %14, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %6
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %18, %20
br i1 %21, label %22, label %26
22: ; preds = %13
%23 = load i8*, i8** %5
%24 = load i64, i64* %8
%25 = getelementptr i8, i8* %23, i64 %24
store i8* %25, i8** %4
br label %30
26: ; preds = %13
%27 = load i64, i64* %8
%28 = add i64 %27, 1
store i64 %28, i64* %8
br label %9
29: ; preds = %9
store i8* null, i8** %4
br label %30
30: ; preds = %29, %22
%31 = load i8*, i8** %4
ret i8* %31
}

LLVM IR (-O2):
define i8* @ft_memchr(i8* %0, i8 zeroext %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %10
%6 = phi i64 [ %11, %10 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %1
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %2
br i1 %12, label %15, label %5
13: ; preds = %5
%14 = getelementptr inbounds i8, i8* %0, i64 %6
br label %15
15: ; preds = %10, %13, %3
%16 = phi i8* [ null, %3 ], [ %14, %13 ], [ null, %10 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int always_one_1(int /*<<< orphan*/);
int always_one_2(int /*<<< orphan*/);
int main(void) {
  if (always_one_1(0) != 1)
    abort();
  if (always_one_2(0) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1050 <always_one_1@plt>
cmp    $0x1,%eax
je     1156 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <always_one_2@plt>
cmp    $0x1,%eax
je     116d <main+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <always_one_1@plt>
cmp    $0x1,%eax
jne    114d <main+0x1d>
xor    %edi,%edi
call   1040 <always_one_2@plt>
cmp    $0x1,%eax
jne    114d <main+0x1d>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @always_one_1(i32 0)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @always_one_2(i32 0)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @always_one_1(i32 0)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @always_one_2(i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
ret i32 0
}
/* Variables and functions */
int check_magic(const void *addr, size_t size) {
  const unsigned char *mem_p;
  mem_p = (unsigned char *)addr + size;
  if (*mem_p == (unsigned char)(0xFAU) &&
      *(mem_p + 1) == (unsigned char)(0xD3U)) {
    return 1;
  } else {
    return 21;
  }
}


x86 assembly (clang, -O0):
<check_magic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xfa,%eax
jne    1149 <check_magic+0x49>
mov    -0x20(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xd3,%eax
jne    1149 <check_magic+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <check_magic+0x50>
movl   $0x15,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_magic>:
cmpb   $0xfa,(%rdi,%rsi,1)
jne    1112 <check_magic+0x12>
mov    $0x1,%eax
cmpb   $0xd3,0x1(%rdi,%rsi,1)
je     1117 <check_magic+0x17>
mov    $0x15,%eax
ret

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

LLVM IR (-O2):
define i32 @check_magic(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, -6
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, -45
br i1 %9, label %11, label %10
10: ; preds = %6, %2
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ 21, %10 ], [ 1, %6 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fxpsin(int /*<<< orphan*/, int /*<<< orphan*/);
uint64_t cfxpsin(uint64_t u) {
  uint32_t a[2];
  *(uint64_t *)a = u;
  return fxpsin(a[0], a[1]);
}


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

x86 assembly (clang, -O2):
<cfxpsin>:
jmp    1030 <fxpsin@plt>

LLVM IR (-O0):
define i32 @cfxpsin(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %4, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%9 = load i32, i32* %8
%10 = call i32 @fxpsin(i32 %7, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @cfxpsin(i32 %0) {
%2 = tail call i32 @fxpsin(i32 %0, i32 undef)
ret i32 %2
}
void av_realloc_array() {}


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

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

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

LLVM IR (-O2):
define void @av_realloc_array() {
ret void
}
int __attribute__((no, noclone)) swap(int x) {
  return (unsigned short)((unsigned short)x << 8 | (unsigned short)x >> 8);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
movzwl %cx,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @swap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
%5 = zext i16 %4 to i32
%6 = shl i32 %5, 8
%7 = load i32, i32* %2
%8 = trunc i32 %7 to i16
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
%13 = zext i16 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @swap(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
__attribute__((always_)) int pci_swiotlb_detect(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @pci_swiotlb_detect() {
ret i32 0
}

LLVM IR (-O2):
define i32 @pci_swiotlb_detect() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mulmv(float *, float const *, float *);
void vtransform(float *src, int num, const float *from) {
  int i;
  for (i = num; i > 0; i--) {
    mulmv(src, from, src);
    src += 3;
  }
}


x86 assembly (clang, -O0):
<vtransform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    115e <vtransform+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <mulmv@plt>
mov    -0x8(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1129 <vtransform+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vtransform>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <vtransform+0x3a>
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <mulmv@plt>
add    $0xc,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <vtransform+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @vtransform(float* %0, i32 %1, float* %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca float*
%7 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store float* %2, float** %6
%8 = load i32, i32* %5
store i32 %8, i32* %7
br label %9
9: ; preds = %19, %3
%10 = load i32, i32* %7
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load float*, float** %4
%14 = load float*, float** %6
%15 = load float*, float** %4
%16 = call i32 @mulmv(float* %13, float* %14, float* %15)
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 3
store float* %18, float** %4
br label %19
19: ; preds = %12
%20 = load i32, i32* %7
%21 = add nsw i32 %20, -1
store i32 %21, i32* %7
br label %9
22: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @vtransform(float* %0, i32 %1, float* %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %1, %3 ]
%7 = phi float* [ %9, %5 ], [ %0, %3 ]
%8 = tail call i32 @mulmv(float* %7, float* %2, float* %7)
%9 = getelementptr inbounds float, float* %7, i64 3
%10 = add nsw i32 %6, -1
%11 = icmp ugt i32 %6, 1
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}
int completeGrid(numberMines) {
  if (numberMines <= 0)
    return (0);
  else
    return (-1);
}


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

x86 assembly (clang, -O2):
<completeGrid>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @completeGrid(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ts;
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *timestamp() {
  static char ts[32];
  struct tm *tp;
  time_t t;
  time(&t);
  tp = gmtime(&t);
  strftime(ts, sizeof(ts), "%Y-%m-%dT%H:%M:%S", tp);
  return (ts);
}


x86 assembly (clang, -O0):
<timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1030 <time@plt>
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0x2ef7(%rip),%rdi
mov    $0x20,%esi
lea    0xe9b(%rip),%rdx
call   1040 <strftime@plt>
lea    0x2edf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <time@plt>
mov    %rbx,%rdi
call   1050 <gmtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@timestamp.ts = internal global [32 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%dT%H:%M:%S\00"
define i8* @timestamp() {
%1 = alloca %struct.tm*
%2 = alloca i32
%3 = call i32 @time(i32* %2)
%4 = call %struct.tm* @gmtime(i32* %2)
store %struct.tm* %4, %struct.tm** %1
%5 = load %struct.tm*, %struct.tm** %1
%6 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @timestamp.ts, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @timestamp.ts, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@timestamp.ts = internal global [32 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%dT%H:%M:%S\00"
define i8* @timestamp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @gmtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @timestamp.ts, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @timestamp.ts, i64 0, i64 0)
}
char *ttyname(int fildes) { return ""; }


x86 assembly (clang, -O0):
<ttyname>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttyname>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @ttyname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @ttyname(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void check_double(double *x, double *y, char *ret) {
  *ret = ((char *)y) - ((char *)x) == sizeof(*x) ? 't' : 'f';
}


x86 assembly (clang, -O0):
<check_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
sub    %rax,%rdx
mov    $0x66,%eax
mov    $0x74,%ecx
cmp    $0x8,%rdx
cmove  %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_double>:
sub    %rdi,%rsi
cmp    $0x8,%rsi
mov    $0x74,%eax
mov    $0x66,%ecx
cmove  %eax,%ecx
mov    %cl,(%rdx)
ret

LLVM IR (-O0):
define void @check_double(double* %0, double* %1, i8* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i8*
store double* %0, double** %4
store double* %1, double** %5
store i8* %2, i8** %6
%7 = load double*, double** %5
%8 = bitcast double* %7 to i8*
%9 = load double*, double** %4
%10 = bitcast double* %9 to i8*
%11 = ptrtoint i8* %8 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = icmp eq i64 %13, 8
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 116, i32 102
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %6
store i8 %17, i8* %18
ret void
}

LLVM IR (-O2):
define void @check_double(double* %0, double* %1, i8* nocapture writeonly %2) {
%4 = ptrtoint double* %1 to i64
%5 = ptrtoint double* %0 to i64
%6 = sub i64 %4, %5
%7 = icmp eq i64 %6, 8
%8 = select i1 %7, i8 116, i8 102
store i8 %8, i8* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int __ms_vswscanf_internal(int /*<<< orphan*/ const *,
                           int /*<<< orphan*/ const *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ swscanf;
int __ms_vswscanf(const wchar_t *__restrict__ s,
                  const wchar_t *__restrict__ format, va_list arg) {
  int ret;
  ret = __ms_vswscanf_internal(s, format, arg, swscanf);
  return ret;
}


x86 assembly (clang, -O0):
<__ms_vswscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2ec3(%rip),%rax
mov    (%rax),%ecx
call   1030 <__ms_vswscanf_internal@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ms_vswscanf>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <__ms_vswscanf_internal@plt>

LLVM IR (-O0):
@swscanf = global i32 0
define i32 @__ms_vswscanf(i32* noalias %0, i32* noalias %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32, i32* @swscanf
%12 = call i32 @__ms_vswscanf_internal(i32* %8, i32* %9, i32 %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
@swscanf = global i32 0
define i32 @__ms_vswscanf(i32* noalias %0, i32* noalias %1, i32 %2) {
%4 = load i32, i32* @swscanf
%5 = tail call i32 @__ms_vswscanf_internal(i32* %0, i32* %1, i32 %2, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *getnonullfile(int);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
void gc_close(void) {
  FILE *f = getnonullfile(2);
  if (f != stdin && f != stdout && f != stderr) {
    { fclose(f); };
  }
}


x86 assembly (clang, -O0):
<gc_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <getnonullfile@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%rax
je     117b <gc_close+0x5b>
mov    -0x8(%rbp),%rax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%rax
je     117b <gc_close+0x5b>
mov    -0x8(%rbp),%rax
mov    0x2e6f(%rip),%rcx
cmp    (%rcx),%rax
je     117b <gc_close+0x5b>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gc_close>:
push   %rax
mov    $0x2,%edi
call   1040 <getnonullfile@plt>
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <gc_close+0x38>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <gc_close+0x38>
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <gc_close+0x38>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
@stderr = global i32* null
define void @gc_close() {
%1 = alloca i32*
%2 = call i32* @getnonullfile(i32 2)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = load i32*, i32** @stdin
%5 = icmp ne i32* %3, %4
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = load i32*, i32** @stdout
%9 = icmp ne i32* %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32*, i32** %1
%12 = load i32*, i32** @stderr
%13 = icmp ne i32* %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32*, i32** %1
%16 = call i32 @fclose(i32* %15)
br label %17
17: ; preds = %14, %10, %6, %0
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
@stderr = global i32* null
define void @gc_close() {
%1 = tail call i32* @getnonullfile(i32 2)
%2 = load i32*, i32** @stdin
%3 = icmp eq i32* %1, %2
%4 = load i32*, i32** @stdout
%5 = icmp eq i32* %1, %4
%6 = select i1 %3, i1 true, i1 %5
%7 = load i32*, i32** @stderr
%8 = icmp eq i32* %1, %7
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %12, label %10
10: ; preds = %0
%11 = tail call i32 @fclose(i32* %1)
br label %12
12: ; preds = %10, %0
ret void
}
void setSource(int source[]) {}


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

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

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

LLVM IR (-O2):
define void @setSource(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ first();
int /*<<< orphan*/ second();
int main(void) {
  first();
  second();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <first@plt>
mov    $0x0,%al
call   1030 <second@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <first@plt>
xor    %eax,%eax
call   1030 <second@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @first()
%2 = tail call i32 (...) @second()
ret i32 0
}
int test_imm_A5int8_reg(signed char val) {
  return ((val) & (0xA5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A5int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xa5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A5int8_reg>:
test   $0xa5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A5int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 165
%6 = icmp ne i32 %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_A5int8_reg(i8 signext %0) {
%2 = and i8 %0, -91
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EPINonBlockingReadStop(uint32_t ui32Base, uint32_t ui32Channel) {
  uint32_t ui32Offset;
  ;
  ;
  ui32Offset = ui32Channel * (0x00000038 - 0x00000028);
  (*((volatile unsigned long *)(ui32Base + 0x00000028 + ui32Offset))) = 0;
}


x86 assembly (clang, -O0):
<EPINonBlockingReadStop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
add    -0xc(%rbp),%eax
cltq
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadStop>:
movslq %esi,%rax
shl    $0x4,%rax
movslq %edi,%rcx
movq   $0x0,0x28(%rcx,%rax,1)
ret

LLVM IR (-O0):
define void @EPINonBlockingReadStop(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 16
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 40
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i64*
store volatile i64 0, i64* %13
ret void
}

LLVM IR (-O2):
define void @EPINonBlockingReadStop(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = add nsw i32 %0, 40
%5 = add nsw i32 %4, %3
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
store volatile i64 0, i64* %7
ret void
}
/* Variables and functions */
scalar_t__ between(char, char, char);
int alpha(char c) { return between('a', 'z', c) || between('A', 'Z', c); }


x86 assembly (clang, -O0):
<alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x61,%edi
mov    $0x7a,%esi
movsbl -0x1(%rbp),%edx
call   1030 <between@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1160 <alpha+0x50>
mov    $0x41,%edi
mov    $0x5a,%esi
movsbl -0x1(%rbp),%edx
call   1030 <between@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha>:
push   %rbx
mov    %edi,%ebx
mov    $0x61,%edi
mov    $0x7a,%esi
mov    %ebx,%edx
call   1030 <between@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1133 <alpha+0x23>
pop    %rbx
ret
movsbl %bl,%edx
mov    $0x41,%edi
mov    $0x5a,%esi
call   1030 <between@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @between(i8 signext 97, i8 signext 122, i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @between(i8 signext 65, i8 signext 90, i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @alpha(i8 signext %0) {
%2 = tail call i64 @between(i8 signext 97, i8 signext 122, i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @between(i8 signext 65, i8 signext 90, i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ pal_intf_lock();
void val_intf_lock(void) { pal_intf_lock(); }


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

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

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

LLVM IR (-O2):
define void @val_intf_lock() {
%1 = tail call i32 (...) @pal_intf_lock()
ret void
}
/* Variables and functions */
int random();
int pick_fil() {
  int i;
  i = random() % 107;
  return (i);
}


x86 assembly (clang, -O0):
<pick_fil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x6b,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pick_fil>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cltq
imul   $0x4c8f8d29,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x6b,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pick_fil() {
%1 = alloca i32
%2 = call i32 (...) @random()
%3 = srem i32 %2, 107
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @pick_fil() {
%1 = tail call i32 (...) @random()
%2 = srem i32 %1, 107
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wmemset(int /*<<< orphan*/ *, int /*<<< orphan*/, size_t);
void uninitvar_wmemset(void) {
  wchar_t *cs;
  wchar_t c;
  size_t n;
  (void)wmemset(cs, c, n);
}


x86 assembly (clang, -O0):
<uninitvar_wmemset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <wmemset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wmemset>:
jmp    1030 <wmemset@plt>

LLVM IR (-O0):
define void @uninitvar_wmemset() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i64
%4 = load i32*, i32** %1
%5 = load i32, i32* %2
%6 = load i64, i64* %3
%7 = call i32 @wmemset(i32* %4, i32 %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wmemset() {
%1 = tail call i32 @wmemset(i32* undef, i32 undef, i64 undef)
ret void
}
void process_restart_list() {}


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

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

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

LLVM IR (-O2):
define void @process_restart_list() {
ret void
}
/* Variables and functions */
int SII9234_HW_IsOn();
int MHD_HW_IsOn(void) { return SII9234_HW_IsOn(); }


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

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

LLVM IR (-O0):
define i32 @MHD_HW_IsOn() {
%1 = call i32 (...) @SII9234_HW_IsOn()
ret i32 %1
}

LLVM IR (-O2):
define i32 @MHD_HW_IsOn() {
%1 = tail call i32 (...) @SII9234_HW_IsOn()
ret i32 %1
}
void handle_SYS(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_SYS(i32 %0) {
ret void
}