xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ testands();
int /*<<< orphan*/ testoctal();
int main(int argc, char **argv) {
  srand(2673);
  testoctal();
  testands();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa71,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1040 <testoctal@plt>
mov    $0x0,%al
call   1030 <testands@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa71,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1040 <testoctal@plt>
xor    %eax,%eax
call   1030 <testands@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @srand(i32 2673)
%7 = call i32 (...) @testoctal()
%8 = call i32 (...) @testands()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srand(i32 2673)
%4 = tail call i32 (...) @testoctal()
%5 = tail call i32 (...) @testands()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int Bar7(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int res;
  res = Bar7(6, 8, 0);
  printf("main: res = %d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6,%edi
mov    $0x8,%esi
xor    %edx,%edx
call   1040 <Bar7@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
mov    $0x8,%esi
xor    %edx,%edx
call   1040 <Bar7@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"main: res = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @Bar7(i32 6, i32 8, i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"main: res = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @Bar7(i32 6, i32 8, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
signed long signedlong_ignoring_shortint(signed long x, short int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlong_ignoring_shortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlong_ignoring_shortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
void bson_swap_endian32(void *outp, const void *inp) {
  const char *in = (const char *)inp;
  char *out = (char *)outp;
  out[0] = in[3];
  out[1] = in[2];
  out[2] = in[1];
  out[3] = in[0];
}


x86 assembly (clang, -O0):
<bson_swap_endian32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_swap_endian32>:
mov    0x3(%rsi),%al
mov    %al,(%rdi)
mov    0x2(%rsi),%al
mov    %al,0x1(%rdi)
mov    0x1(%rsi),%al
mov    %al,0x2(%rdi)
mov    (%rsi),%al
mov    %al,0x3(%rdi)
ret

LLVM IR (-O0):
define void @bson_swap_endian32(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
store i8* %7, i8** %5
%8 = load i8*, i8** %3
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 3
%11 = load i8, i8* %10
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = load i8*, i8** %6
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %21, i8* %23
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %26, i8* %28
ret void
}

LLVM IR (-O2):
define void @bson_swap_endian32(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
%5 = getelementptr inbounds i8, i8* %1, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %1, i64 1
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = load i8, i8* %1
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
double pow(double, double);
double prv_process_fpa_pow_real64(double a, double b) { return pow(a, b); }


x86 assembly (clang, -O0):
<prv_process_fpa_pow_real64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_process_fpa_pow_real64>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @prv_process_fpa_pow_real64(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @prv_process_fpa_pow_real64(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
int get_c(void *context) { return *(*(unsigned char **)context)++; }


x86 assembly (clang, -O0):
<get_c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_c>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
movzbl (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @get_c(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %2
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ft_memset(char *, int /*<<< orphan*/, size_t);
scalar_t__ malloc(size_t);
void *ft_memalloc(size_t n) {
  char *ptr;
  ptr = (char *)malloc(n);
  if (!ptr)
    return (NULL);
  ft_memset(ptr, 0, n);
  return ((void *)ptr);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <ft_memalloc+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1168 <ft_memalloc+0x48>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <ft_memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
test   %rax,%rax
je     1143 <ft_memalloc+0x23>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <ft_memset@plt>
jmp    1145 <ft_memalloc+0x25>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @ft_memset(i8* %3, i32 0, i64 %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %3, %5 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
double sin(double);
double hl_math_sin(double a) { return sin(a); }


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

x86 assembly (clang, -O2):
<hl_math_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @hl_math_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
void copyStringToBuffer(unsigned char *dst, const char *src, int len) {
  while (len > 1) {
    *(dst + 1) = *(src);
    *(dst) = *(src + 1);
    dst += 2;
    src += 2;
    len -= 2;
  }
}


x86 assembly (clang, -O0):
<copyStringToBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1159 <copyStringToBuffer+0x59>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <copyStringToBuffer+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyStringToBuffer>:
cmp    $0x2,%edx
jl     112c <copyStringToBuffer+0x2c>
add    $0x2,%edx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,0x1(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0xfffffffe,%edx
add    $0x2,%rax
cmp    $0x3,%edx
ja     1110 <copyStringToBuffer+0x10>
ret

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

LLVM IR (-O2):
define void @copyStringToBuffer(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 1
br i1 %4, label %5, label %17
5: ; preds = %3, %5
%6 = phi i32 [ %15, %5 ], [ %2, %3 ]
%7 = phi i8* [ %14, %5 ], [ %1, %3 ]
%8 = phi i8* [ %13, %5 ], [ %0, %3 ]
%9 = load i8, i8* %7
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
store i8 %12, i8* %8
%13 = getelementptr inbounds i8, i8* %8, i64 2
%14 = getelementptr inbounds i8, i8* %7, i64 2
%15 = add nsw i32 %6, -2
%16 = icmp ugt i32 %6, 3
br i1 %16, label %5, label %17
17: ; preds = %5, %3
ret void
}
/* Type definitions */
struct bloom {
  int dummy;
};

/* Variables and functions */
int bloom_init_buf(struct bloom *, int, double, int /*<<< orphan*/ *);
int bloom_init(struct bloom *bloom, int entries, double error) {
  return bloom_init_buf(bloom, entries, error, NULL);
}


x86 assembly (clang, -O0):
<bloom_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
mov    %eax,%edx
call   1030 <bloom_init_buf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bloom_init>:
xor    %edx,%edx
jmp    1030 <bloom_init_buf@plt>

LLVM IR (-O0):
%struct.bloom = type { i32 }
define i32 @bloom_init(%struct.bloom* %0, i32 %1, double %2) {
%4 = alloca %struct.bloom*
%5 = alloca i32
%6 = alloca double
store %struct.bloom* %0, %struct.bloom** %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load %struct.bloom*, %struct.bloom** %4
%8 = load i32, i32* %5
%9 = load double, double* %6
%10 = call i32 @bloom_init_buf(%struct.bloom* %7, i32 %8, double %9, i32* null)
ret i32 %10
}

LLVM IR (-O2):
%struct.bloom = type { i32 }
define i32 @bloom_init(%struct.bloom* %0, i32 %1, double %2) {
%4 = tail call i32 @bloom_init_buf(%struct.bloom* %0, i32 %1, double %2, i32* null)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ObjWrite8(unsigned int);
void ObjWrite16(unsigned V) {
  ObjWrite8(V);
  ObjWrite8(V >> 8);
}


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

x86 assembly (clang, -O2):
<ObjWrite16>:
push   %rbx
mov    %edi,%ebx
call   1030 <ObjWrite8@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ObjWrite8@plt>

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

LLVM IR (-O2):
define void @ObjWrite16(i32 %0) {
%2 = tail call i32 @ObjWrite8(i32 %0)
%3 = lshr i32 %0, 8
%4 = tail call i32 @ObjWrite8(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x1d() {
  Assert_real((iscntrl(29)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              150, ("iscntrl should be 1 for 0x1d"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x1d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1d,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x96,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x1d>:
push   %rax
mov    $0x1d,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x96,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x1d\00"
define void @t_iscntrl_0x1d() {
%1 = call i32 @iscntrl(i32 29)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x1d\00"
define void @t_iscntrl_0x1d() {
%1 = tail call i32 @iscntrl(i32 29)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo002(int p) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @foo002(i32 %0) {
ret void
}
void outsl(int port, const void *addr, unsigned long count) {
  __asm__ __volatile__("rep; outsl" : "+S"(addr), "+c"(count) : "d"(port));
}


x86 assembly (clang, -O0):
<outsl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep outsl %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsl>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsl %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsl(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call { i8*, i64 } asm sideeffect "rep; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsl(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void putnum(int num) {
  putchar('0' + ((num - (num % 10)) / 10));
  putchar('0' + (num % 10));
  putchar('\n');
}


x86 assembly (clang, -O0):
<putnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
sub    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putnum>:
push   %rbx
movslq %edi,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%ebx
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x30,%bl
movsbl %bl,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @putnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
%6 = sub nsw i32 %3, %5
%7 = sdiv i32 %6, 10
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
%10 = call i32 @putchar(i8 signext %9)
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = add nsw i32 48, %12
%14 = trunc i32 %13 to i8
%15 = call i32 @putchar(i8 signext %14)
%16 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @putnum(i32 %0) {
%2 = srem i32 %0, 10
%3 = sdiv i32 %0, 10
%4 = trunc i32 %3 to i8
%5 = add i8 %4, 48
%6 = tail call i32 @putchar(i8 signext %5)
%7 = trunc i32 %2 to i8
%8 = add nsw i8 %7, 48
%9 = tail call i32 @putchar(i8 signext %8)
%10 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *getprogname();
int /*<<< orphan*/ printf(char *, char *, int, int /*<<< orphan*/);
void printUsageAndExit() {
  printf("Usage:\n"
         "  %s [options]\n"
         "Options:\n"
         "  -l <listen addr:listen port>\t\tlisten address and port, >= 1 "
         "required\n"
         "  -r <remote addr:remote port>\t\tremote address and port, >= 1 "
         "required\n"
         "  -c <connect timeout milliseconds>\tdefault = %d\n"
         "  -f\t\t\t\t\tflush stdout on each log\n"
         "  -p <periodic log milliseconds>\t0 = disable, default = %d\n",
         getprogname(), (5000), (0));
  exit(1);
}


x86 assembly (clang, -O0):
<printUsageAndExit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
mov    $0x1388,%edx
xor    %ecx,%ecx
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<printUsageAndExit>:
push   %rax
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
mov    $0x1388,%edx
xor    %ecx,%ecx
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [316 x i8] c"Usage:\0A %s [options]\0AOptions:\0A -l <listen addr:listen port>\09\09listen address and port, >= 1 required\0A -r <remote addr:remote port>\09\09remote address and port, >= 1 required\0A -c <connect timeout milliseconds>\09default = %d\0A -f\09\09\09\09\09flush stdout on each log\0A -p <periodic log milliseconds>\090 = disable, default = %d\0A\00"
define void @printUsageAndExit() {
%1 = call i8* (...) @getprogname()
%2 = call i32 @printf(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str, i64 0, i64 0), i8* %1, i32 5000, i32 0)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [316 x i8] c"Usage:\0A %s [options]\0AOptions:\0A -l <listen addr:listen port>\09\09listen address and port, >= 1 required\0A -r <remote addr:remote port>\09\09remote address and port, >= 1 required\0A -c <connect timeout milliseconds>\09default = %d\0A -f\09\09\09\09\09flush stdout on each log\0A -p <periodic log milliseconds>\090 = disable, default = %d\0A\00"
define void @printUsageAndExit() {
%1 = tail call i8* (...) @getprogname()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str, i64 0, i64 0), i8* %1, i32 5000, i32 0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_port(int /*<<< orphan*/, int, int);
uint8_t io_get_interrupt_type(uint8_t port) {
  return get_port(port, 0x08, 0x09);
}


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

x86 assembly (clang, -O2):
<io_get_interrupt_type>:
mov    $0x8,%esi
mov    $0x9,%edx
jmp    1030 <get_port@plt>

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

LLVM IR (-O2):
define i32 @io_get_interrupt_type(i32 %0) {
%2 = tail call i32 @get_port(i32 %0, i32 8, i32 9)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: mount_unionfs [-o options] directory uniondir\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"usage: mount_unionfs [-o options] directory uniondir\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"usage: mount_unionfs [-o options] directory uniondir\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int wa_sa(int x, int y, int wa, int sa) {
  wa = x + y;
  sa = x - y;
}


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

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

LLVM IR (-O0):
define i32 @wa_sa(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* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %10, %11
store i32 %12, i32* %8
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = sub nsw i32 %13, %14
store i32 %15, i32* %9
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @wa_sa(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 undef
}
/* Type definitions */
struct aiocb {
  int dummy;
};
typedef int /*<<< orphan*/ aio;

/* Variables and functions */
int aio_read(struct aiocb *);
int /*<<< orphan*/ memset(struct aiocb *, int /*<<< orphan*/, int);
int main(void) {
  struct aiocb aio;
  (void)memset(&aio, 0, sizeof(aio));
  return aio_read(&aio);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x8(%rbp),%rdi
call   1040 <aio_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
call   1040 <aio_read@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.aiocb = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.aiocb
store i32 0, i32* %1
%3 = call i32 @memset(%struct.aiocb* %2, i32 0, i32 4)
%4 = call i32 @aio_read(%struct.aiocb* %2)
ret i32 %4
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
define i32 @main() {
%1 = alloca %struct.aiocb
%2 = bitcast %struct.aiocb* %1 to i8*
%3 = call i32 @memset(%struct.aiocb* %1, i32 0, i32 4)
%4 = call i32 @aio_read(%struct.aiocb* %1)
ret i32 %4
}
/* Type definitions */
struct cfm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cfmOutExt(struct cfm *, char, int, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/);
void cfmOut(struct cfm *cfm, char c, int color) {
  cfmOutExt(cfm, c, color, 0, 0, 0);
}


x86 assembly (clang, -O0):
<cfmOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
xor    %r9d,%r9d
movsbl %al,%esi
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <cfmOutExt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfmOut>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <cfmOutExt@plt>

LLVM IR (-O0):
%struct.cfm = type { i32 }
define void @cfmOut(%struct.cfm* %0, i8 signext %1, i32 %2) {
%4 = alloca %struct.cfm*
%5 = alloca i8
%6 = alloca i32
store %struct.cfm* %0, %struct.cfm** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load %struct.cfm*, %struct.cfm** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i32 @cfmOutExt(%struct.cfm* %7, i8 signext %8, i32 %9, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.cfm = type { i32 }
define void @cfmOut(%struct.cfm* %0, i8 signext %1, i32 %2) {
%4 = tail call i32 @cfmOutExt(%struct.cfm* %0, i8 signext %1, i32 %2, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn1();
int fn2() {
  fn1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @fn2() {
%1 = tail call i32 (...) @fn1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ReverseStr(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[100];
  gets(s);
  ReverseStr(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1030 <ReverseStr@plt>
lea    -0x70(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1030 <ReverseStr@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @ReverseStr(i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @ReverseStr(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void _backlight_on(void) { (*(volatile unsigned long *)0x80000340) |= 0x2; }


x86 assembly (clang, -O0):
<_backlight_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000340,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0x80000340,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_backlight_on>:
mov    $0x80000340,%eax
orq    $0x2,(%rax)
ret

LLVM IR (-O0):
define void @_backlight_on() {
%1 = load volatile i64, i64* inttoptr (i64 2147484480 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 2147484480 to i64*)
ret void
}

LLVM IR (-O2):
define void @_backlight_on() {
%1 = load volatile i64, i64* inttoptr (i64 2147484480 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 2147484480 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_ptr(int /*<<< orphan*/);
int /*<<< orphan*/ sub();
void sub_by_ptr(uint32_t x) {
  by_ptr(x);
  sub();
}


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

x86 assembly (clang, -O2):
<sub_by_ptr>:
push   %rax
call   1030 <by_ptr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sub@plt>

LLVM IR (-O0):
define void @sub_by_ptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr(i32 %3)
%5 = call i32 (...) @sub()
ret void
}

LLVM IR (-O2):
define void @sub_by_ptr(i32 %0) {
%2 = tail call i32 @by_ptr(i32 %0)
%3 = tail call i32 (...) @sub()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), void *);
int create_thread(pthread_t *thr, void *(*thread_func)(void *), void *async) {
  return pthread_create(thr, NULL, thread_func, async);
}


x86 assembly (clang, -O0):
<create_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_thread>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <pthread_create@plt>

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

LLVM IR (-O2):
define i32 @create_thread(i32* %0, i8* (i8*)* %1, i8* %2) {
%4 = tail call i32 @pthread_create(i32* %0, i32* null, i8* (i8*)* %1, i8* %2)
ret i32 %4
}
void myputc(c) char c;
{ write(2, &c, sizeof c); }


x86 assembly (clang, -O0):
<myputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myputc>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
mov    $0x2,%edi
xor    %eax,%eax
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @myputc(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %2, i64 1)
ret void
}

LLVM IR (-O2):
define void @myputc(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %2, i64 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTFDoGroup(int, int);
int RTFGetBraceLevel();
void RTFExecuteGroup(void) {
  int level = RTFGetBraceLevel();
  RTFDoGroup(1, level);
}


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

x86 assembly (clang, -O2):
<RTFExecuteGroup>:
push   %rax
xor    %eax,%eax
call   1030 <RTFGetBraceLevel@plt>
mov    $0x1,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <RTFDoGroup@plt>

LLVM IR (-O0):
define void @RTFExecuteGroup() {
%1 = alloca i32
%2 = call i32 (...) @RTFGetBraceLevel()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @RTFDoGroup(i32 1, i32 %3)
ret void
}

LLVM IR (-O2):
define void @RTFExecuteGroup() {
%1 = tail call i32 (...) @RTFGetBraceLevel()
%2 = tail call i32 @RTFDoGroup(i32 1, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ receiveMessages();
int /*<<< orphan*/ sleep(int);
int main(void) {
  puts("This is a sample test...");
  receiveMessages();
  int i = 100;
  while (i > 0) {
    sleep(1);
    i--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <receiveMessages@plt>
movl   $0x64,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    117b <main+0x4b>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <main+0x29>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <receiveMessages@plt>
mov    $0x65,%ebx
nopl   0x0(%rax)
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"This is a sample test...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @receiveMessages()
store i32 100, i32* %2
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = call i32 @sleep(i32 1)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %5
12: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"This is a sample test...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @receiveMessages()
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 100, %0 ], [ %6, %3 ]
%5 = tail call i32 @sleep(i32 1)
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void ADC1_2_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @ADC1_2_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @ADC1_2_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int system(char *);
void clear() {
  if (system("clear") == -1) {
    fprintf(stderr, "error -> %d\n", errno);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
jne    1171 <clear+0x41>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
lea    0xea4(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
je     1144 <clear+0x14>
pop    %rax
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@stderr = global i32 0
@.str.1 = [13 x i8] c"error -> %d\0A\00"
@errno = global i32 0
define void @clear() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@stderr = global i32 0
@.str.1 = [13 x i8] c"error -> %d\0A\00"
@errno = global i32 0
define void @clear() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ marker(int /*<<< orphan*/);
int main(void) {
  marker(0);
  marker(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @marker(i32 0)
%2 = tail call i32 @marker(i32 0)
ret i32 0
}
void error(s) char *s;
{
  (void)move(21 + 2, 0);
  (void)clrtoeol();
  if (s) {
    (void)addstr(s);
    (void)write(1, "\007", 1);
    ;
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x17,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1060 <move@plt>
mov    $0x0,%al
call   1040 <clrtoeol@plt>
cmpq   $0x0,-0x8(%rbp)
je     118c <error+0x4c>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <addstr@plt>
mov    $0x1,%edx
lea    0xe7d(%rip),%rsi
mov    %edx,%edi
mov    $0x0,%al
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
mov    $0x17,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <move@plt>
xor    %eax,%eax
call   1040 <clrtoeol@plt>
test   %rbx,%rbx
je     1181 <error+0x41>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <addstr@plt>
lea    0xe91(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <write@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 23, i32 0)
%4 = call i32 (...) @clrtoeol()
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @addstr to i32 (i8*, ...)*)(i8* %8)
%10 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\07\00"
define void @error(i8* %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 23, i32 0)
%3 = tail call i32 (...) @clrtoeol()
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @addstr to i32 (i8*, ...)*)(i8* %0)
%7 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %8
8: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ klock_getT1(int *);
int getTIssue(int x) {
  int *a, *b;
  int c = 30;
  klock_getT1(b);
  a = b;
  while (c > 20) {
    klock_getT1(b);
    c = *a - *b;
    a = b;
  }
  return c;
}


x86 assembly (clang, -O0):
<getTIssue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1e,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <klock_getT1@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jle    1162 <getTIssue+0x52>
mov    -0x18(%rbp),%rdi
call   1030 <klock_getT1@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1133 <getTIssue+0x23>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getTIssue(i32 %0) {
%2 = tail call i32 @klock_getT1(i32* undef)
%3 = tail call i32 @klock_getT1(i32* undef)
ret i32 0
}
void *XSharpCreateFontStruct(void *dpy, const char *family, int pointSize,
                             int style) {
  return 0;
}


x86 assembly (clang, -O0):
<XSharpCreateFontStruct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @XSharpCreateFontStruct(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i8* null
}