xunge/DecIR huggingface dataset:
void foo() {
  ({ asm("nop"); });
}


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

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

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

LLVM IR (-O2):
define void @foo() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int pthread_join(int /*<<< orphan*/, void **);
void std_pthread_join(pthread_t th, void **thread_return) {
  if (pthread_join(th, thread_return) == -1) {
    perror("pthread_join");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_pthread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_join@plt>
cmp    $0xffffffff,%eax
jne    116a <std_pthread_join+0x3a>
lea    0xea5(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_pthread_join>:
push   %rax
call   1050 <pthread_join@plt>
cmp    $0xffffffff,%eax
je     113d <std_pthread_join+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"pthread_join\00"
define void @std_pthread_join(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @pthread_join(i32 %5, i8** %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"pthread_join\00"
define void @std_pthread_join(i32 %0, i8** %1) {
%3 = tail call i32 @pthread_join(i32 %0, i8** %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Type definitions */
struct aa_node_ {
  int dummy;
};

/* Variables and functions */
struct aa_node_ *skew(struct aa_node_ *);
struct aa_node_ *split(struct aa_node_ *);
struct aa_node_ *aa_inserted_(struct aa_node_ *t) {
  t = skew(t);
  t = split(t);
  return t;
}


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

x86 assembly (clang, -O2):
<aa_inserted_>:
push   %rax
call   1040 <skew@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <split@plt>

LLVM IR (-O0):
%struct.aa_node_ = type { i32 }
define %struct.aa_node_* @aa_inserted_(%struct.aa_node_* %0) {
%2 = alloca %struct.aa_node_*
store %struct.aa_node_* %0, %struct.aa_node_** %2
%3 = load %struct.aa_node_*, %struct.aa_node_** %2
%4 = call %struct.aa_node_* @skew(%struct.aa_node_* %3)
store %struct.aa_node_* %4, %struct.aa_node_** %2
%5 = load %struct.aa_node_*, %struct.aa_node_** %2
%6 = call %struct.aa_node_* @split(%struct.aa_node_* %5)
store %struct.aa_node_* %6, %struct.aa_node_** %2
%7 = load %struct.aa_node_*, %struct.aa_node_** %2
ret %struct.aa_node_* %7
}

LLVM IR (-O2):
%struct.aa_node_ = type { i32 }
define %struct.aa_node_* @aa_inserted_(%struct.aa_node_* %0) {
%2 = tail call %struct.aa_node_* @skew(%struct.aa_node_* %0)
%3 = tail call %struct.aa_node_* @split(%struct.aa_node_* %2)
ret %struct.aa_node_* %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int intcelcon_length_of_supports(int *r, int *length) {
  int fail, i;
  double *c;
  fail = _ada_use_c2phc4c(746, r, length, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<intcelcon_length_of_supports>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2ea,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcelcon_length_of_supports>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2ea,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @intcelcon_length_of_supports(i32* %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc4c(i32 746, i32* %0, i32* %1, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
char const **sentsuppress_names();
const char **corpus_sentsuppress_names(void) { return sentsuppress_names(); }


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

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

LLVM IR (-O0):
define i8** @corpus_sentsuppress_names() {
%1 = call i8** (...) @sentsuppress_names()
ret i8** %1
}

LLVM IR (-O2):
define i8** @corpus_sentsuppress_names() {
%1 = tail call i8** (...) @sentsuppress_names()
ret i8** %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ mchelp(char *);
int /*<<< orphan*/ stderr;
void mcusage(char *pgmname) {
  fprintf(stderr, "Error: incorrect command line arguments\n");
  mchelp(pgmname);
  exit(1);
}


x86 assembly (clang, -O0):
<mcusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <mchelp@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<mcusage>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <mchelp@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Error: incorrect command line arguments\0A\00"
define void @mcusage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @mchelp(i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Error: incorrect command line arguments\0A\00"
define void @mcusage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @mchelp(i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_43int64_midword_reg(long long val) {
  return ((val >> 16) & (0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x43,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_43int64_midword_reg>:
test   $0x430000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_43int64_midword_reg(i64 %0) {
%2 = and i64 %0, 4390912
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
__attribute__((__weak__, __always___)) int
softboundcets_strncasecmp(const char *s1, const char *s2, size_t n) {
  return strncasecmp(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<softboundcets_strncasecmp>:
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_strncasecmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
void s5pv210_default_sdhci0(void) {}


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

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

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

LLVM IR (-O2):
define void @s5pv210_default_sdhci0() {
ret void
}
float absFloat(float f) {
  if (f < 0)
    return -1.0 * f;
  return f;
}


x86 assembly (clang, -O0):
<absFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1139 <absFloat+0x39>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1143 <absFloat+0x43>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absFloat>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @absFloat(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fmul double -1.000000e+00, %8
%10 = fptrunc double %9 to float
store float %10, float* %2
br label %13
11: ; preds = %1
%12 = load float, float* %3
store float %12, float* %2
br label %13
13: ; preds = %11, %6
%14 = load float, float* %2
ret float %14
}

LLVM IR (-O2):
define float @absFloat(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
scalar_t__ matches(char const *, char *);
char *os_get();
char path_getseparator(const char *type) {
  if (type == NULL)
    type = os_get();
  if (matches(type, "windows"))
    return '\\';
  else
    return '/';
}


x86 assembly (clang, -O0):
<path_getseparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <path_getseparator+0x22>
mov    $0x0,%al
call   1030 <os_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <matches@plt>
cmp    $0x0,%rax
je     1165 <path_getseparator+0x45>
movb   $0x5c,-0x1(%rbp)
jmp    1169 <path_getseparator+0x49>
movb   $0x2f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_getseparator>:
push   %rax
test   %rdi,%rdi
jne    1130 <path_getseparator+0x10>
xor    %eax,%eax
call   1030 <os_get@plt>
mov    %rax,%rdi
lea    0xec9(%rip),%rsi
call   1040 <matches@plt>
test   %rax,%rax
mov    $0x2f,%ecx
mov    $0x5c,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"windows\00"
define signext i8 @path_getseparator(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i8* (...) @os_get()
store i8* %7, i8** %3
br label %8
8: ; preds = %6, %1
%9 = load i8*, i8** %3
%10 = call i64 @matches(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 92, i8* %2
br label %14
13: ; preds = %8
store i8 47, i8* %2
br label %14
14: ; preds = %13, %12
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"windows\00"
define signext i8 @path_getseparator(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i8* (...) @os_get()
br label %5
5: ; preds = %3, %1
%6 = phi i8* [ %4, %3 ], [ %0, %1 ]
%7 = tail call i64 @matches(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8 47, i8 92
ret i8 %9
}
int LocIntPos(int n, int i, int *v) {
  int j;
  for (j = 0; j < n && i != v[j]; ++j)
    ;
  return (j);
}


x86 assembly (clang, -O0):
<LocIntPos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x15(%rbp)
jge    113a <LocIntPos+0x3a>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114a <LocIntPos+0x4a>
jmp    115d <LocIntPos+0x5d>
jmp    114f <LocIntPos+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <LocIntPos+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LocIntPos>:
test   %edi,%edi
jle    1121 <LocIntPos+0x21>
mov    %edi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %esi,(%rdx,%rax,4)
je     1120 <LocIntPos+0x20>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <LocIntPos+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @LocIntPos(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 0, i32* %7
br label %8
8: ; preds = %23, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32*, i32** %6
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = icmp ne i32 %13, %18
br label %20
20: ; preds = %12, %8
%21 = phi i1 [ false, %8 ], [ %19, %12 ]
br i1 %21, label %22, label %26
22: ; preds = %20
br label %23
23: ; preds = %22
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %8
26: ; preds = %20
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @LocIntPos(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %2, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ 0, %3 ], [ %16, %15 ], [ %0, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xe8() {
  Assert_real((isgraph(232) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1165, ("isgraph should be 0 for 0xe8"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xe8>:
push   %rax
mov    $0xe8,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x48d,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe8\00"
define void @t_isgraph_0xe8() {
%1 = call i64 @isgraph(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe8\00"
define void @t_isgraph_0xe8() {
%1 = tail call i64 @isgraph(i32 232)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dstdevpn(int, int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dstdevpn(N, 1, x, stride);
  printf("sample standard deviation: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%ecx
mov    $0x1,%esi
call   1030 <stdlib_strided_dstdevpn@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1030 <stdlib_strided_dstdevpn@plt>
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [32 x i8] c"sample standard deviation: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dstdevpn(i32 %6, i32 1, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [32 x i8] c"sample standard deviation: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dstdevpn(i32 4, i32 1, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
void displayW(int tempNumber, int sizeTemp) {
  while (sizeTemp) {
    my_putchar((char)(tempNumber / sizeTemp) + 48);
    tempNumber %= sizeTemp;
    sizeTemp /= 10;
  }
}


x86 assembly (clang, -O0):
<displayW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115c <displayW+0x4c>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
movsbl %al,%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <my_putchar@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    111e <displayW+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayW>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     1150 <displayW+0x40>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%eax
cltd
idiv   %ebx
add    $0x30,%al
movsbl %al,%edi
mov    %edx,%ebp
call   1030 <my_putchar@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rbx
mov    %rbx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rbx
add    %ecx,%ebx
add    $0x9,%eax
cmp    $0x12,%eax
ja     1120 <displayW+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @displayW(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sdiv i32 %9, %10
%12 = trunc i32 %11 to i8
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 48
%15 = trunc i32 %14 to i8
%16 = call i32 @my_putchar(i8 signext %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = srem i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = sdiv i32 %20, 10
store i32 %21, i32* %4
br label %5
22: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @displayW(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %1, %2 ]
%6 = phi i32 [ %11, %4 ], [ %0, %2 ]
%7 = sdiv i32 %6, %5
%8 = trunc i32 %7 to i8
%9 = add i8 %8, 48
%10 = tail call i32 @my_putchar(i8 signext %9)
%11 = srem i32 %6, %5
%12 = sdiv i32 %5, 10
%13 = add i32 %5, 9
%14 = icmp ult i32 %13, 19
br i1 %14, label %15, label %4
15: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
int /*<<< orphan*/ genlab(int);
int label();
int /*<<< orphan*/ lgen(char *, char *, int);
void cgbr(char *how, int n) {
  int lab = label();
  gen("or\tax,ax");
  lgen("%s\t%c%d", how, lab);
  lgen("%s\t%c%d", "jmp", n);
  genlab(lab);
}


x86 assembly (clang, -O0):
<cgbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <label@plt>
mov    %eax,-0x10(%rbp)
lea    0xea0(%rip),%rdi
call   1060 <gen@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xe96(%rip),%rdi
call   1030 <lgen@plt>
mov    -0xc(%rbp),%edx
lea    0xe87(%rip),%rdi
lea    0xe88(%rip),%rsi
call   1030 <lgen@plt>
mov    -0x10(%rbp),%edi
call   1050 <genlab@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgbr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <label@plt>
mov    %eax,%ebp
lea    0xea3(%rip),%rdi
call   1060 <gen@plt>
lea    0xea0(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <lgen@plt>
lea    0xe94(%rip),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <lgen@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <genlab@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"or\09ax,ax\00"
@.str.1 = [8 x i8] c"%s\09%c%d\00"
@.str.2 = [4 x i8] c"jmp\00"
define void @cgbr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (...) @label()
store i32 %6, i32* %5
%7 = call i32 @gen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @genlab(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"or\09ax,ax\00"
@.str.1 = [8 x i8] c"%s\09%c%d\00"
@.str.2 = [4 x i8] c"jmp\00"
define void @cgbr(i8* %0, i32 %1) {
%3 = tail call i32 (...) @label()
%4 = tail call i32 @gen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %3)
%6 = tail call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%7 = tail call i32 @genlab(i32 %3)
ret void
}
int getdtablesize(void) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<getdtablesize>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdtablesize>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getdtablesize = [14 x i8] c"getdtablesize\00"
define i32 @getdtablesize() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.getdtablesize, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getdtablesize = [14 x i8] c"getdtablesize\00"
define i32 @getdtablesize() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.getdtablesize, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ printf(char *);
int loadError() {
  printf("Error: failed to load one of the files.\n");
  return EXIT_FAILURE;
}


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

x86 assembly (clang, -O2):
<loadError>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Error: failed to load one of the files.\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @loadError() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
ret i32 %2
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [40 x i8] c"Error: failed to load one of the files.\00"
define i32 @loadError() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ my_malloc1(int);
int /*<<< orphan*/ my_malloc2(int);
void a7550(void) {
  my_malloc1(48000);
  my_malloc2(7200);
}


x86 assembly (clang, -O0):
<a7550>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbb80,%edi
call   1030 <my_malloc1@plt>
mov    $0x1c20,%edi
call   1040 <my_malloc2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a7550>:
push   %rax
mov    $0xbb80,%edi
call   1030 <my_malloc1@plt>
mov    $0x1c20,%edi
pop    %rax
jmp    1040 <my_malloc2@plt>

LLVM IR (-O0):
define void @a7550() {
%1 = call i32 @my_malloc1(i32 48000)
%2 = call i32 @my_malloc2(i32 7200)
ret void
}

LLVM IR (-O2):
define void @a7550() {
%1 = tail call i32 @my_malloc1(i32 48000)
%2 = tail call i32 @my_malloc2(i32 7200)
ret void
}
void gdk_pixmap_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pixmap_get_type() {
ret void
}
unsigned uDivTest1(unsigned X, unsigned Y) { return 0 / X; }


x86 assembly (clang, -O0):
<uDivTest1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
xor    %edx,%edx
divl   -0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @uDivTest1(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 = udiv i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @uDivTest1(i32 %0, i32 %1) {
ret i32 0
}
int position(int i, int *list, int n) {
  while (n--) {
    if (*(list + n) == i)
      return (n + 1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1149 <position+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1144 <position+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <position+0x50>
jmp    110e <position+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<position>:
movslq %edx,%rcx
lea    0x1(%rcx),%eax
cs nopw 0x0(%rax,%rax,1)
sub    $0x1,%rcx
jb     111f <position+0x1f>
add    $0xffffffff,%eax
cmp    %edi,(%rsi,%rcx,4)
jne    1110 <position+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @position(i32 %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
br label %5
5: ; preds = %9, %3
%6 = phi i64 [ %7, %9 ], [ %4, %3 ]
%7 = add nsw i64 %6, -1
%8 = icmp eq i64 %6, 0
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = getelementptr inbounds i32, i32* %1, i64 %7
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %5
13: ; preds = %9
%14 = trunc i64 %6 to i32
br label %15
15: ; preds = %5, %13
%16 = phi i32 [ %14, %13 ], [ 0, %5 ]
ret i32 %16
}
int test(int a) {
  a += 3;
  a *= 2;
  return a;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
lea    (%rdi,%rdi,1),%eax
add    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
store i32 %6, i32* %2
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %2, 6
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Meu primeiro programa");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Meu primeiro programa\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Meu primeiro programa\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Label_Printf(char *);
void Dico_String_Start(int nb_consts) { Label_Printf(".cstring"); }


x86 assembly (clang, -O0):
<Dico_String_Start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <Label_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c".cstring\00"
define void @Dico_String_Start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Label_Printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c".cstring\00"
define void @Dico_String_Start(i32 %0) {
%2 = tail call i32 @Label_Printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct TennisGame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TennisGame_P1Score(struct TennisGame *);
void TennisGame_SetP1Score(struct TennisGame *game, int number) {
  for (int i = 0; i < number; i++) {
    TennisGame_P1Score(game);
  }
}


x86 assembly (clang, -O0):
<TennisGame_SetP1Score>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <TennisGame_SetP1Score+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <TennisGame_P1Score@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <TennisGame_SetP1Score+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TennisGame_SetP1Score>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    112d <TennisGame_SetP1Score+0x1d>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <TennisGame_P1Score@plt>
add    $0xffffffff,%ebx
jne    1120 <TennisGame_SetP1Score+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TennisGame = type { i32 }
define void @TennisGame_SetP1Score(%struct.TennisGame* %0, i32 %1) {
%3 = alloca %struct.TennisGame*
%4 = alloca i32
%5 = alloca i32
store %struct.TennisGame* %0, %struct.TennisGame** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load %struct.TennisGame*, %struct.TennisGame** %3
%12 = call i32 @TennisGame_P1Score(%struct.TennisGame* %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.TennisGame = type { i32 }
define void @TennisGame_SetP1Score(%struct.TennisGame* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @TennisGame_P1Score(%struct.TennisGame* %0)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ read_line(char *, int);
int read_int() {
  char buf[16] = {0};
  read_line(buf, sizeof(buf));
  return atoi(buf);
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1040 <read_line@plt>
lea    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rbx
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <read_line@plt>
mov    %rbx,%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_int() {
%1 = alloca [16 x i8]
%2 = bitcast [16 x i8]* %1 to i8*
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = call i32 @read_line(i8* %3, i32 16)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%6 = call i32 @atoi(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @read_int() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @read_line(i8* %2, i32 16)
%4 = call i32 @atoi(i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ echo();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ system(char *);
void cleanup_terminal_bcircle(void) {
  echo();
  system("setfont >/dev/null 2>&1");
  system(
      "setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz  >/dev/null 2>&1");
  system("setterm -blank 10");
  endwin();
  system("clear");
}


x86 assembly (clang, -O0):
<cleanup_terminal_bcircle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <echo@plt>
lea    0xebe(%rip),%rdi
call   1040 <system@plt>
lea    0xeca(%rip),%rdi
call   1040 <system@plt>
lea    0xf03(%rip),%rdi
call   1040 <system@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
lea    0xf02(%rip),%rdi
call   1040 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_terminal_bcircle>:
push   %rax
xor    %eax,%eax
call   1030 <echo@plt>
lea    0xec1(%rip),%rdi
call   1040 <system@plt>
lea    0xecd(%rip),%rdi
call   1040 <system@plt>
lea    0xf06(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
lea    0xf05(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"setfont >/dev/null 2>&1\00"
@.str.1 = [69 x i8] c"setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz >/dev/null 2>&1\00"
@.str.2 = [18 x i8] c"setterm -blank 10\00"
@.str.3 = [6 x i8] c"clear\00"
define void @cleanup_terminal_bcircle() {
%1 = call i32 (...) @echo()
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @endwin()
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"setfont >/dev/null 2>&1\00"
@.str.1 = [69 x i8] c"setfont /usr/share/consolefonts/Lat2-Fixed16.psf.gz >/dev/null 2>&1\00"
@.str.2 = [18 x i8] c"setterm -blank 10\00"
@.str.3 = [6 x i8] c"clear\00"
define void @cleanup_terminal_bcircle() {
%1 = tail call i32 (...) @echo()
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (...) @endwin()
%6 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int bcm2835_peri_read(int volatile *);
int /*<<< orphan*/ bcm2835_peri_write(int volatile *, int);
void bcm2835_peri_set_bits(volatile uint32_t *paddr, uint32_t value,
                           uint32_t mask) {
  uint32_t v = bcm2835_peri_read(paddr);
  v = (v & ~mask) | (value & mask);
  bcm2835_peri_write(paddr, v);
}


x86 assembly (clang, -O0):
<bcm2835_peri_set_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bcm2835_peri_read@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0xc(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <bcm2835_peri_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcm2835_peri_set_bits>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <bcm2835_peri_read@plt>
xor    %eax,%ebp
and    %r14d,%ebp
xor    %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <bcm2835_peri_write@plt>

LLVM IR (-O0):
define void @bcm2835_peri_set_bits(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = call i32 @bcm2835_peri_read(i32* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = xor i32 %11, -1
%13 = and i32 %10, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
%17 = or i32 %13, %16
store i32 %17, i32* %7
%18 = load i32*, i32** %4
%19 = load i32, i32* %7
%20 = call i32 @bcm2835_peri_write(i32* %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @bcm2835_peri_set_bits(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @bcm2835_peri_read(i32* %0)
%5 = xor i32 %2, -1
%6 = and i32 %4, %5
%7 = and i32 %2, %1
%8 = or i32 %6, %7
%9 = tail call i32 @bcm2835_peri_write(i32* %0, i32 %8)
ret void
}
void uDMAChannel16_23SelectAltMapping(unsigned long ulAltPeriphs) {
  (*((volatile unsigned long *)(0x400FF518))) |= ulAltPeriphs;
}


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

x86 assembly (clang, -O2):
<uDMAChannel16_23SelectAltMapping>:
or     %rdi,0x400ff518
40
ret

LLVM IR (-O0):
define void @uDMAChannel16_23SelectAltMapping(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074787608 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074787608 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannel16_23SelectAltMapping(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074787608 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074787608 to i64*)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int lstat(char *, struct stat *);
int check_dir(char *cmd) {
  struct stat buf;
  int rc = lstat(cmd, &buf);
  if (rc == 0) {
    if (S_ISDIR(buf.st_mode)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1169 <check_dir+0x49>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1164 <check_dir+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1170 <check_dir+0x50>
jmp    1169 <check_dir+0x49>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
test   %eax,%eax
jne    1141 <check_dir+0x21>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1141 <check_dir+0x21>
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @check_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @lstat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i64 @S_ISDIR(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 0, i32* %2
br label %18
16: ; preds = %10
br label %17
17: ; preds = %16, %1
store i32 1, i32* %2
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @check_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISDIR(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6, %1
br label %12
12: ; preds = %6, %11
%13 = phi i32 [ 1, %11 ], [ 0, %6 ]
ret i32 %13
}
/* Variables and functions */
void *malloc(long long);
void *AllocateHeap(long long n) { return malloc(n); }


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

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

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

LLVM IR (-O2):
define noalias i8* @AllocateHeap(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
float __ocml_rhypot_f32(float, float);
float rhypotf(float x, float y) { return __ocml_rhypot_f32(x, y); }


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

x86 assembly (clang, -O2):
<rhypotf>:
jmp    1030 <__ocml_rhypot_f32@plt>

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

LLVM IR (-O2):
define float @rhypotf(float %0, float %1) {
%3 = tail call float @__ocml_rhypot_f32(float %0, float %1)
ret float %3
}