xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __u64;
typedef int __u16;

/* Variables and functions */
int /*<<< orphan*/ update_hash_byte(int /*<<< orphan*/ *, int);
void update_hash_half(__u64 *key, __u16 half) {
  update_hash_byte(key, (half >> 8) & 0xff);
  update_hash_byte(key, half & 0xff);
}


x86 assembly (clang, -O0):
<update_hash_half>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
call   1030 <update_hash_byte@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xff,%esi
call   1030 <update_hash_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_hash_half>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %rdi,%rbx
movzbl %ah,%esi
mov    %eax,%ebp
call   1030 <update_hash_byte@plt>
movzbl %bpl,%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <update_hash_byte@plt>

LLVM IR (-O0):
define void @update_hash_half(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 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @update_hash_byte(i32* %5, i32 %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = call i32 @update_hash_byte(i32* %10, i32 %12)
ret void
}

LLVM IR (-O2):
define void @update_hash_half(i32* %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = tail call i32 @update_hash_byte(i32* %0, i32 %4)
%6 = and i32 %1, 255
%7 = tail call i32 @update_hash_byte(i32* %0, i32 %6)
ret void
}
unsigned char _tolower(const unsigned char c) { return c | 0x20; }


x86 assembly (clang, -O0):
<_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
or     $0x20,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tolower>:
mov    %edi,%eax
or     $0x20,%al
ret

LLVM IR (-O0):
define zeroext i8 @_tolower(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = or i32 %4, 32
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @_tolower(i8 zeroext %0) {
%2 = or i8 %0, 32
ret i8 %2
}
/* Type definitions */
struct gpf {
  int dummy;
};

/* Variables and functions */
scalar_t__ calloc(int, unsigned char);
int /*<<< orphan*/ gp_read(struct gpf *, ...);
void gp_read_string(struct gpf *gpf, const char **dest) {
  unsigned char len = 0;
  char *ret;
  gp_read(gpf, &len, 1);
  ret = (char *)calloc(sizeof(char), len + 1);
  gp_read(gpf, ret, len);
  *dest = ret;
}


x86 assembly (clang, -O0):
<gp_read_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <gp_read@plt>
movzbl -0x11(%rbp),%eax
add    $0x1,%eax
mov    $0x1,%edi
movzbl %al,%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movzbl -0x11(%rbp),%edx
mov    $0x0,%al
call   1030 <gp_read@plt>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp_read_string>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <gp_read@plt>
mov    0xf(%rsp),%al
add    $0x1,%al
movzbl %al,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,%rbx
movzbl 0xf(%rsp),%edx
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <gp_read@plt>
mov    %rbx,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.gpf = type { i32 }
define void @gp_read_string(%struct.gpf* %0, i8** %1) {
%3 = alloca %struct.gpf*
%4 = alloca i8**
%5 = alloca i8
%6 = alloca i8*
store %struct.gpf* %0, %struct.gpf** %3
store i8** %1, i8*** %4
store i8 0, i8* %5
%7 = load %struct.gpf*, %struct.gpf** %3
%8 = call i32 (%struct.gpf*, ...) @gp_read(%struct.gpf* %7, i8* %5, i32 1)
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = add nsw i32 %10, 1
%12 = trunc i32 %11 to i8
%13 = call i64 @calloc(i32 1, i8 zeroext %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %6
%15 = load %struct.gpf*, %struct.gpf** %3
%16 = load i8*, i8** %6
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = call i32 (%struct.gpf*, ...) @gp_read(%struct.gpf* %15, i8* %16, i32 %18)
%20 = load i8*, i8** %6
%21 = load i8**, i8*** %4
store i8* %20, i8** %21
ret void
}

LLVM IR (-O2):
%struct.gpf = type { i32 }
define void @gp_read_string(%struct.gpf* %0, i8** nocapture writeonly %1) {
%3 = alloca i8
store i8 0, i8* %3
%4 = call i32 (%struct.gpf*, ...) @gp_read(%struct.gpf* %0, i8* %3, i32 1)
%5 = load i8, i8* %3
%6 = add i8 %5, 1
%7 = call i64 @calloc(i32 1, i8 zeroext %6)
%8 = inttoptr i64 %7 to i8*
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = call i32 (%struct.gpf*, ...) @gp_read(%struct.gpf* %0, i8* %8, i32 %10)
store i8* %8, i8** %1
ret void
}
/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void videBuffer() {
  char buff = fgetc(stdin);
  while (buff != '\n' && buff != EOF) {
    buff = fgetc(stdin);
  }
}


x86 assembly (clang, -O0):
<videBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1151 <videBuffer+0x41>
movsbl -0x1(%rbp),%eax
mov    0x2e9a(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1161 <videBuffer+0x51>
jmp    1177 <videBuffer+0x67>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
jmp    1129 <videBuffer+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videBuffer>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%al
je     1140 <videBuffer+0x30>
mov    0x2eb2(%rip),%rbx
xchg   %ax,%ax
cmp    (%rbx),%al
je     1140 <videBuffer+0x30>
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1130 <videBuffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i8 0
define void @videBuffer() {
%1 = alloca i8
%2 = load i32, i32* @stdin
%3 = call signext i8 @fgetc(i32 %2)
store i8 %3, i8* %1
br label %4
4: ; preds = %16, %0
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = load i8, i8* @EOF
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %10, %12
br label %14
14: ; preds = %8, %4
%15 = phi i1 [ false, %4 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i32, i32* @stdin
%18 = call signext i8 @fgetc(i32 %17)
store i8 %18, i8* %1
br label %4
19: ; preds = %14
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i8 0
define void @videBuffer() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @fgetc(i32 %1)
%3 = icmp ne i8 %2, 10
%4 = load i8, i8* @EOF
%5 = icmp ne i8 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = load i32, i32* @stdin
%9 = tail call signext i8 @fgetc(i32 %8)
%10 = icmp ne i8 %9, 10
%11 = load i8, i8* @EOF
%12 = icmp ne i8 %9, %11
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret void
}
int ft_mod(int a) {
  if (a < 0)
    return (-1 * a);
  return (a);
}


x86 assembly (clang, -O0):
<ft_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1120 <ft_mod+0x20>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <ft_mod+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_mod>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_mod(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int swap_symbols_for_quaddobl_witness_set(int nvr, int dim) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(818, &nvr, &dim, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<swap_symbols_for_quaddobl_witness_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x332,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_symbols_for_quaddobl_witness_set>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x332,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @swap_symbols_for_quaddobl_witness_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc4c(i32 818, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @swap_symbols_for_quaddobl_witness_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 818, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ h_free(void *);
void component_world_free(void *ptr) { h_free(ptr); }


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

x86 assembly (clang, -O2):
<component_world_free>:
jmp    1030 <h_free@plt>

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

LLVM IR (-O2):
define void @component_world_free(i8* %0) {
%2 = tail call i32 @h_free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
signed char streq(const char *x, const char *y) { return strcmp(x, y) == 0; }


x86 assembly (clang, -O0):
<streq>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @streq(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 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ platform_linux_echoOff();
extern void platform_echoOff(void) {
  platform_linux_echoOff();
  return;
}


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

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

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

LLVM IR (-O2):
define void @platform_echoOff() {
%1 = tail call i32 (...) @platform_linux_echoOff()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ PROT_NONE;
void *mmap(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int /*<<< orphan*/,
           int, int /*<<< orphan*/);
void memleak_mmap(int fd) {
  void *addr = mmap(NULL, 255, PROT_NONE, MAP_PRIVATE, fd, 0);
}


x86 assembly (clang, -O0):
<memleak_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    -0x4(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0xff,%esi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memleak_mmap>:
mov    %edi,%r8d
mov    0x2ed6(%rip),%rax
mov    (%rax),%edx
mov    0x2eb5(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0xff,%esi
xor    %r9d,%r9d
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
define void @memleak_mmap(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* @PROT_NONE
%5 = load i32, i32* @MAP_PRIVATE
%6 = load i32, i32* %2
%7 = call i8* @mmap(i32* null, i32 255, i32 %4, i32 %5, i32 %6, i32 0)
store i8* %7, i8** %3
ret void
}

LLVM IR (-O2):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
define void @memleak_mmap(i32 %0) {
%2 = load i32, i32* @PROT_NONE
%3 = load i32, i32* @MAP_PRIVATE
%4 = tail call i8* @mmap(i32* null, i32 255, i32 %2, i32 %3, i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
void morse_put(char *dest, char mr, const char *dot, const char *tier) {
  if (mr == '.')
    strcat(dest, dot);
  else
    strcat(dest, tier);
}


x86 assembly (clang, -O0):
<morse_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x2e,%eax
jne    1149 <morse_put+0x39>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcat@plt>
jmp    1156 <morse_put+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<morse_put>:
cmp    $0x2e,%sil
cmovne %rcx,%rdx
mov    %rdx,%rsi
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define void @morse_put(i8* %0, i8 signext %1, i8* %2, i8* %3) {
%5 = icmp eq i8 %1, 46
%6 = select i1 %5, i8* %2, i8* %3
%7 = tail call i32 @strcat(i8* %0, i8* %6)
ret void
}
void log_fatal(const char *type, int code, const char *msg) {
  (void)type;
  (void)code;
  (void)msg;
}


x86 assembly (clang, -O0):
<log_fatal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @log_fatal(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
float tanhf(float);
float __ocl_tanh_float(float src) { return tanhf(src); }


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

x86 assembly (clang, -O2):
<__ocl_tanh_float>:
jmp    1030 <tanhf@plt>

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

LLVM IR (-O2):
define float @__ocl_tanh_float(float %0) {
%2 = tail call float @tanhf(float %0)
ret float %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ dec2bin(int);
int main(int argc, char *argv[]) {
  uint16_t i;
  for (i = 0; i <= 1024; i += 1) {
    dec2bin(i);
    dec2bin(-i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jg     115a <main+0x4a>
mov    -0x14(%rbp),%edi
call   1030 <dec2bin@plt>
xor    %edi,%edi
sub    -0x14(%rbp),%edi
call   1030 <dec2bin@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <dec2bin@plt>
mov    %ebx,%edi
call   1030 <dec2bin@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    $0xfffffbff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %8, %3 ]
%5 = tail call i32 @dec2bin(i32 %4)
%6 = sub nsw i32 0, %4
%7 = tail call i32 @dec2bin(i32 %6)
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 1025
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 0
}
void lower_case(s) char *s;
{
  register char *p = s;
  while (*p != ('\0')) {
    if (isupper((int)*p))
      *p = tolower(*p);
    p++;
  }
}


x86 assembly (clang, -O0):
<lower_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117e <lower_case+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     116d <lower_case+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <lower_case+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_case>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1165 <lower_case+0x45>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    114b <lower_case+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <lower_case+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %eax,%eax
je     1140 <lower_case+0x20>
mov    %ebp,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <lower_case+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @lower_case(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @isupper(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @tolower(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %10, %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret void
}
void nonzeroNestedMemset() {
  union U {
    char c;
    int i;
  };
  struct S {
    union U u;
    short i;
  };
  struct S arr[5] = {
      {{0xF0}, 0xF0F0}, {{0xF0}, 0xF0F0}, {{0xF0}, 0xF0F0},
      {{0xF0}, 0xF0F0}, {{0xF0}, 0xF0F0},
  };
}


x86 assembly (clang, -O0):
<nonzeroNestedMemset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    $0xf0,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.S = type { %union.U, i16 }
%union.U = type { i32 }
define void @nonzeroNestedMemset() {
%1 = alloca [5 x %struct.S]
%2 = bitcast [5 x %struct.S]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @nonzeroNestedMemset() {
ret void
}
/* Variables and functions */
double scale_h1(double, double, double);
double scale_h2(double, double, double);
double scale_Sxy(double x, double y, double z, double dx, double dy,
                 double dz) {
  return scale_h1(x, y, z) * scale_h2(x, y, z) * dx * dy;
}


x86 assembly (clang, -O0):
<scale_Sxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <scale_h1@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <scale_h2@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_Sxy>:
sub    $0x38,%rsp
movsd  %xmm4,0x30(%rsp)
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <scale_h1@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <scale_h2@plt>
mulsd  0x20(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
define double @scale_Sxy(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @scale_h1(double %0, double %1, double %2)
%8 = tail call double @scale_h2(double %0, double %1, double %2)
%9 = fmul double %7, %8
%10 = fmul double %9, %3
%11 = fmul double %10, %4
ret double %11
}
float *vec2_multiply(float *result, float *a, float *b) {
  result[0] = a[0] * b[0];
  result[1] = a[1] * b[1];
  return result;
}


x86 assembly (clang, -O0):
<vec2_multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mulss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_multiply>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
mulss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
mulss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define float* @vec2_multiply(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** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fmul float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fmul float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
ret float* %25
}

LLVM IR (-O2):
define float* @vec2_multiply(float* returned writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fmul float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret float* %0
}
/* Variables and functions */
int lastIndexOf(char *, char, int /*<<< orphan*/);
int strlen(char *);
void parse(char *str) {
  int n, i, len = strlen(str);
  n = lastIndexOf(str, '(', 0);
  switch (str[n - 1]) {
  case 's':
    break;
  case 'n':
    break;
  case 'g':
    break;
  case '^':
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x28,%esi
xor    %edx,%edx
call   1040 <lastIndexOf@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    $0xffffffa2,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x15,%eax
ja     1196 <parse+0x76>
mov    -0x20(%rbp),%rax
lea    0xe87(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    119b <parse+0x7b>
jmp    119b <parse+0x7b>
jmp    119b <parse+0x7b>
jmp    119b <parse+0x7b>
jmp    119b <parse+0x7b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x28,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <lastIndexOf@plt>

LLVM IR (-O0):
define void @parse(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %2
%9 = call i32 @lastIndexOf(i8* %8, i8 signext 40, i32 0)
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
switch i32 %16, label %21 [
i32 115, label %17
i32 110, label %18
i32 103, label %19
i32 94, label %20
]
17: ; preds = %1
br label %22
18: ; preds = %1
br label %22
19: ; preds = %1
br label %22
20: ; preds = %1
br label %22
21: ; preds = %1
br label %22
22: ; preds = %21, %20, %19, %18, %17
ret void
}

LLVM IR (-O2):
define void @parse(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @lastIndexOf(i8* %0, i8 signext 40, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *safeMalloc(size_t size) {
  void *mem = malloc(size);
  if (mem == NULL) {
    fprintf(stderr, "Out of RAM memory\n");
    exit(1);
  }
  return mem;
}


x86 assembly (clang, -O0):
<safeMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <safeMalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeMalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <safeMalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Out of RAM memory\0A\00"
define i8* @safeMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Out of RAM memory\0A\00"
define noalias i8* @safeMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int g(int j, int i) { return (j & (1 << i)) > 0; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %esi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
test   %edi,%edx
setg   %al
ret

LLVM IR (-O0):
define i32 @g(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 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int my_lbracket(struct jslex *lexer) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.jslex = type opaque
define i32 @my_lbracket(%struct.jslex* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
void scunit__Second_test(int *scunit__test_failed) {
  sleep(2);
  do {
    if (!((1) == (1))) {
      printf("%s failed ("
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/mchouza/pcb/refs/heads/master/scunit/"
             "test/scunit_1_t.c"
             ":"
             "23"
             "): '"
             "1"
             "' was expected to be "
             "'"
             "1"
             "'"
             ".\n",
             (1) ? "Assertion" : "Expectation");
      *scunit__test_failed = 1;
      if (1)
        return;
    }
  } while (0);
}


x86 assembly (clang, -O0):
<scunit__Second_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <sleep@plt>
jmp    112b <scunit__Second_test+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scunit__Second_test>:
mov    $0x2,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @scunit__Second_test(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @sleep(i32 2)
br label %4
4: ; preds = %1
br label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @scunit__Second_test(i32* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 2)
ret void
}
/* Variables and functions */
short mus_big_endian_short(unsigned char *);
short mus_little_endian_short(unsigned char *);
short big_or_little_endian_short(unsigned char *n, int little) {
  if (little)
    return (mus_little_endian_short(n));
  return (mus_big_endian_short(n));
}


x86 assembly (clang, -O0):
<big_or_little_endian_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114b <big_or_little_endian_short+0x2b>
mov    -0x10(%rbp),%rdi
call   1030 <mus_little_endian_short@plt>
mov    %ax,-0x2(%rbp)
jmp    1158 <big_or_little_endian_short+0x38>
mov    -0x10(%rbp),%rdi
call   1040 <mus_big_endian_short@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_or_little_endian_short>:
test   %esi,%esi
je     1129 <big_or_little_endian_short+0x9>
jmp    1030 <mus_little_endian_short@plt>
jmp    1040 <mus_big_endian_short@plt>

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

LLVM IR (-O2):
define signext i16 @big_or_little_endian_short(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call signext i16 @mus_little_endian_short(i8* %0)
br label %8
6: ; preds = %2
%7 = tail call signext i16 @mus_big_endian_short(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i16 [ %5, %4 ], [ %7, %6 ]
ret i16 %9
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, char **argv) {
  int c;
  c = getchar();
  while (c != EOF) {
    if (c == '\n')
      putchar('\r');
    putchar(c);
    c = getchar();
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%eax
je     117d <main+0x5d>
cmpl   $0xa,-0x14(%rbp)
jne    1166 <main+0x46>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    1141 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
jmp    1165 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     1137 <main+0x17>
cmp    $0xa,%ebx
jne    1150 <main+0x30>
mov    $0xd,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @getchar()
store i32 %7, i32* %6
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* %6
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @putchar(i32 13)
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %6
%19 = call i32 @putchar(i32 %18)
%20 = call i32 (...) @getchar()
store i32 %20, i32* %6
br label %8
21: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %16, label %6
6: ; preds = %2, %11
%7 = phi i32 [ %13, %11 ], [ %3, %2 ]
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @putchar(i32 13)
br label %11
11: ; preds = %9, %6
%12 = tail call i32 @putchar(i32 %7)
%13 = tail call i32 (...) @getchar()
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %6
16: ; preds = %11, %2
ret i32 0
}
/* Variables and functions */
void *malloc(int);
void *my_alloc(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<my_alloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @my_alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
long char_getmaxscr(maxpx, maxpy)
long *maxpx, *maxpy;
{
  *maxpx = 201L - 1L;
  *maxpy = 201L - 1L;
  return (1);
}


x86 assembly (clang, -O0):
<char_getmaxscr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0xc8,(%rax)
mov    -0x10(%rbp),%rax
movq   $0xc8,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @char_getmaxscr(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
store i64 200, i64* %5
%6 = load i64*, i64** %4
store i64 200, i64* %6
ret i64 1
}

LLVM IR (-O2):
define i64 @char_getmaxscr(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
store i64 200, i64* %0
store i64 200, i64* %1
ret i64 1
}
const void *avl_default_item_copy(const void *item) {
  return (const void *)item;
}


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

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

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

LLVM IR (-O2):
define i8* @avl_default_item_copy(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ lock();
scalar_t__ locked();
int /*<<< orphan*/ unlock();
int main() {
  lock();
  f();
  if (locked()) {
    unlock();
    unlock();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <lock@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    $0x0,%al
call   1060 <locked@plt>
cmp    $0x0,%rax
je     117c <main+0x3c>
mov    $0x0,%al
call   1030 <unlock@plt>
mov    $0x0,%al
call   1030 <unlock@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <lock@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
call   1060 <locked@plt>
test   %rax,%rax
je     1169 <main+0x29>
xor    %eax,%eax
call   1030 <unlock@plt>
xor    %eax,%eax
call   1030 <unlock@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @lock()
%3 = call i32 (...) @f()
%4 = call i64 (...) @locked()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 (...) @unlock()
%8 = call i32 (...) @unlock()
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @lock()
%2 = tail call i32 (...) @f()
%3 = tail call i64 (...) @locked()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 (...) @unlock()
%7 = tail call i32 (...) @unlock()
br label %8
8: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test_gai_strerror();
int /*<<< orphan*/ test_netdb_definitions();
void run_posix_netdb_tests() {
  printf("\nRunning Test Case: %s\n", "Test POSIX netdb.h functions");
  ;
  test_netdb_definitions();
  test_gai_strerror();
}


x86 assembly (clang, -O0):
<run_posix_netdb_tests>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_netdb_definitions@plt>
mov    $0x0,%al
call   1050 <test_gai_strerror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_posix_netdb_tests>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <test_netdb_definitions@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_gai_strerror@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0ARunning Test Case: %s\0A\00"
@.str.1 = [29 x i8] c"Test POSIX netdb.h functions\00"
define void @run_posix_netdb_tests() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @test_netdb_definitions()
%3 = call i32 (...) @test_gai_strerror()
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0ARunning Test Case: %s\0A\00"
@.str.1 = [29 x i8] c"Test POSIX netdb.h functions\00"
define void @run_posix_netdb_tests() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @test_netdb_definitions()
%3 = tail call i32 (...) @test_gai_strerror()
ret void
}
/* Variables and functions */
float *f1(double, ...);
float *test_f1(int val, double x, double y) {
  if (val > 5)
    return f1(x, y);
  else
    return f1(x);
}


x86 assembly (clang, -O0):
<test_f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    1149 <test_f1+0x39>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x2,%al
call   1030 <f1@plt>
mov    %rax,-0x8(%rbp)
jmp    1159 <test_f1+0x49>
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1030 <f1@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_f1>:
cmp    $0x6,%edi
jl     111c <test_f1+0xc>
mov    $0x2,%al
jmp    1030 <f1@plt>
mov    $0x1,%al
jmp    1030 <f1@plt>

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

LLVM IR (-O2):
define float* @test_f1(i32 %0, double %1, double %2) {
%4 = icmp sgt i32 %0, 5
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call float* (double, ...) @f1(double %1, double %2)
br label %9
7: ; preds = %3
%8 = tail call float* (double, ...) @f1(double %1)
br label %9
9: ; preds = %7, %5
%10 = phi float* [ %6, %5 ], [ %8, %7 ]
ret float* %10
}
unsigned kol_mouse_btn() { asm("int $0x40" ::"a"(37), "b"(2)); }


x86 assembly (clang, -O0):
<kol_mouse_btn>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
mov    $0x2,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_mouse_btn>:
push   %rbx
mov    $0x25,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @kol_mouse_btn() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @kol_mouse_btn() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 2)
ret i32 undef
}
int tdefault_always_non_stop_p(struct target_ops *self) { return 0; }


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

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

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

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