xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int fchown(int, int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((__weak__, __always___)) int
softboundmpx_fchown(int fd, uid_t owner, gid_t group) {
  return fchown(fd, owner, group);
}


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

x86 assembly (clang, -O2):
<softboundmpx_fchown>:
jmp    1030 <fchown@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_fchown(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fchown(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
void __asan_handle_no_return() {}


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

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

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

LLVM IR (-O2):
define void @__asan_handle_no_return() {
ret void
}
double milesToMillimetres(double miles) { return miles * 1609340; }


x86 assembly (clang, -O0):
<milesToMillimetres>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<milesToMillimetres>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @milesToMillimetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.609340e+06
ret double %4
}

LLVM IR (-O2):
define double @milesToMillimetres(double %0) {
%2 = fmul double %0, 1.609340e+06
ret double %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XGraphicsExposeEvent;

/* Variables and functions */
int get_XGraphicsExposeEvent_type(void *_p) {
  return (int)((XGraphicsExposeEvent *)_p)->type;
}


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

x86 assembly (clang, -O2):
<get_XGraphicsExposeEvent_type>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XGraphicsExposeEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void StreamWriter_WriteNewLine(struct StreamWriter *self) {}


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

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

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

LLVM IR (-O2):
%struct.StreamWriter = type opaque
define void @StreamWriter_WriteNewLine(%struct.StreamWriter* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main();
int /*<<< orphan*/ sysinit();
void start(void) {
  sysinit();
  main();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sysinit@plt>
mov    $0x0,%al
call   1040 <main@plt>
jmp    1132 <start+0x12>

x86 assembly (clang, -O2):
<start>:
push   %rax
xor    %eax,%eax
call   1030 <sysinit@plt>
xor    %eax,%eax
call   1040 <main@plt>
nop
jmp    1130 <start+0x10>

LLVM IR (-O0):
define void @start() {
%1 = call i32 (...) @sysinit()
%2 = call i32 (...) @main()
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define void @start() {
%1 = tail call i32 (...) @sysinit()
%2 = tail call i32 (...) @main()
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ gameDidEnd(int /*<<< orphan*/);
char *strtok(char *, char *);
void didReceiveInfoAboutStatus(char *server_reply) {
  char *status;
  strtok(server_reply, " ");
  status = strtok(NULL, " ");
  gameDidEnd(atoi(status));
}


x86 assembly (clang, -O0):
<didReceiveInfoAboutStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strtok@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xea9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <gameDidEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<didReceiveInfoAboutStatus>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rsi
call   1030 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <strtok@plt>
mov    %rax,%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <gameDidEnd@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @didReceiveInfoAboutStatus(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @atoi(i8* %7)
%9 = call i32 @gameDidEnd(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @didReceiveInfoAboutStatus(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @atoi(i8* %3)
%5 = tail call i32 @gameDidEnd(i32 %4)
ret void
}
unsigned int instr_util_ustuffu16(unsigned int val1, unsigned int val2) {
  unsigned int retval;
  retval = ((val1 << 16) & 0xffff0000);
  retval |= (val2 & 0xffff);
  return retval;
}


x86 assembly (clang, -O0):
<instr_util_ustuffu16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
and    $0xffff0000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instr_util_ustuffu16>:
shl    $0x10,%edi
movzwl %si,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @instr_util_ustuffu16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = shl i32 %6, 16
%8 = and i32 %7, -65536
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 65535
%11 = load i32, i32* %5
%12 = or i32 %11, %10
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @instr_util_ustuffu16(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = and i32 %1, 65535
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
pid_t getppid(void) { return getpid(); }


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

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

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

LLVM IR (-O2):
define i32 @getppid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
void XtMakeGeometryRequest() {}


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

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

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

LLVM IR (-O2):
define void @XtMakeGeometryRequest() {
ret void
}
void roadmap_view_menu(void) {}


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

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

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

LLVM IR (-O2):
define void @roadmap_view_menu() {
ret void
}
char ss2ss(char c) {
  switch (c) {
  case '~':
    return 'C';
  case 'I':
    return 'C';
  case 'i':
    return 'c';
  case 'H':
  case 'E':
  case 'C':
  case 'S':
  case 'T':
  case 'G':
  case 'B':
  case 'h':
  case 'e':
  case 'c':
  case 's':
  case 't':
  case 'g':
  case 'b':
  case '.':
    return c;
  }
  return '-';
}


x86 assembly (clang, -O0):
<ss2ss>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffd2,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x50,%eax
ja     115a <ss2ss+0x5a>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x43,-0x1(%rbp)
jmp    115e <ss2ss+0x5e>
movb   $0x43,-0x1(%rbp)
jmp    115e <ss2ss+0x5e>
movb   $0x63,-0x1(%rbp)
jmp    115e <ss2ss+0x5e>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    115e <ss2ss+0x5e>
movb   $0x2d,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss2ss>:
lea    -0x2e(%rdi),%ecx
cmp    $0x50,%ecx
ja     111d <ss2ss+0x1d>
mov    $0x43,%al
lea    0xeef(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    %edi,%eax
ret
mov    $0x2d,%al
ret
mov    $0x63,%al
ret

LLVM IR (-O0):
define signext i8 @ss2ss(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 126, label %6
i32 73, label %7
i32 105, label %8
i32 72, label %9
i32 69, label %9
i32 67, label %9
i32 83, label %9
i32 84, label %9
i32 71, label %9
i32 66, label %9
i32 104, label %9
i32 101, label %9
i32 99, label %9
i32 115, label %9
i32 116, label %9
i32 103, label %9
i32 98, label %9
i32 46, label %9
]
6: ; preds = %1
store i8 67, i8* %2
br label %12
7: ; preds = %1
store i8 67, i8* %2
br label %12
8: ; preds = %1
store i8 99, i8* %2
br label %12
9: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%10 = load i8, i8* %3
store i8 %10, i8* %2
br label %12
11: ; preds = %1
store i8 45, i8* %2
br label %12
12: ; preds = %11, %9, %8, %7, %6
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @ss2ss(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 126, label %6
i32 73, label %6
i32 105, label %3
i32 72, label %4
i32 69, label %4
i32 67, label %4
i32 83, label %4
i32 84, label %4
i32 71, label %4
i32 66, label %4
i32 104, label %4
i32 101, label %4
i32 99, label %4
i32 115, label %4
i32 116, label %4
i32 103, label %4
i32 98, label %4
i32 46, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3
%7 = phi i8 [ 45, %5 ], [ %0, %4 ], [ 99, %3 ], [ 67, %1 ], [ 67, %1 ]
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void omp_set_dynamic(int nthreads) {
  if (nthreads > 1)
    fprintf(stderr,
            "You are using a dummy OpenMP runtime and cannot set anything! \n");
  return;
}


x86 assembly (clang, -O0):
<omp_set_dynamic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    113a <omp_set_dynamic+0x2a>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omp_set_dynamic>:
cmp    $0x2,%edi
jl     112a <omp_set_dynamic+0x1a>
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"You are using a dummy OpenMP runtime and cannot set anything! \0A\00"
define void @omp_set_dynamic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"You are using a dummy OpenMP runtime and cannot set anything! \0A\00"
define void @omp_set_dynamic(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
ret void
}
void v3d(vec) double vec[3];
{
  float v[3];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  vcall(v, 3);
}


x86 assembly (clang, -O0):
<v3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3d>:
sub    $0x18,%rsp
movsd  (%rdi),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movsd  0x8(%rdi),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
movsd  0x10(%rdi),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v3d(double* %0) {
%2 = alloca double*
%3 = alloca [3 x float]
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = fptrunc double %6 to float
%8 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = fptrunc double %11 to float
%13 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = fptrunc double %16 to float
%18 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%20 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %19, i32 3)
ret void
}

LLVM IR (-O2):
define void @v3d(double* nocapture %0) {
%2 = alloca [3 x float]
%3 = bitcast [3 x float]* %2 to i8*
%4 = load double, double* %0
%5 = fptrunc double %4 to float
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
store float %5, float* %6
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = fptrunc double %8 to float
%10 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
store float %9, float* %10
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = fptrunc double %12 to float
%14 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
store float %13, float* %14
%15 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %6, i32 3)
ret void
}
void CursorForward(HowMuch) int HowMuch;
{
  char Str[10];
  if (HowMuch == 0)
    return;
  sprintf(Str, "\033[%dC", HowMuch);
  WRITETEST(Str);
}


x86 assembly (clang, -O0):
<CursorForward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <CursorForward+0x1a>
jmp    115a <CursorForward+0x3a>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0xe(%rbp),%rdi
mov    $0x0,%al
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CursorForward>:
test   %edi,%edi
je     1150 <CursorForward+0x30>
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xece(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dC\00"
define void @CursorForward(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %3)
br label %8
8: ; preds = %1, %5
ret void
}
/* Type definitions */
struct dyString {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dyStringAppendN(struct dyString *, char *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void dyStringAppend(struct dyString *ds, char *string) {
  dyStringAppendN(ds, string, strlen(string));
}


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

x86 assembly (clang, -O2):
<dyStringAppend>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dyStringAppendN@plt>

LLVM IR (-O0):
%struct.dyString = type { i32 }
define void @dyStringAppend(%struct.dyString* %0, i8* %1) {
%3 = alloca %struct.dyString*
%4 = alloca i8*
store %struct.dyString* %0, %struct.dyString** %3
store i8* %1, i8** %4
%5 = load %struct.dyString*, %struct.dyString** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @dyStringAppendN(%struct.dyString* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.dyString = type { i32 }
define void @dyStringAppend(%struct.dyString* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @dyStringAppendN(%struct.dyString* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int clear_quaddobl_Laurent_data(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(773, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<clear_quaddobl_Laurent_data>:
mov    $0x305,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @clear_quaddobl_Laurent_data() {
%1 = tail call i32 @_ada_use_c2phc(i32 773, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ cprintf(char *, long);
void hexwzs(short n) {
  cprintf((16) <= 8 ? "%02lx" : (16) <= 16 ? "%04lx" : "%08lx", ((long)n));
}


x86 assembly (clang, -O0):
<hexwzs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswq -0x2(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <cprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexwzs>:
movslq %edi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <cprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%04lx\00"
define void @hexwzs(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i64
%5 = call i32 @cprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%04lx\00"
define void @hexwzs(i16 signext %0) {
%2 = sext i16 %0 to i64
%3 = tail call i32 @cprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
/* Variables and functions */
int checker_read_unsigned_int(int /*<<< orphan*/, char const *, int,
                              unsigned int *);
int checker_read_in_unsigned_int(const char *name, int eof_error_flag,
                                 unsigned int *p_val) {
  return checker_read_unsigned_int(0, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_in_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <checker_read_unsigned_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_in_unsigned_int>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <checker_read_unsigned_int@plt>

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

LLVM IR (-O2):
define i32 @checker_read_in_unsigned_int(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @checker_read_unsigned_int(i32 0, i8* %0, i32 %1, i32* %2)
ret i32 %4
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void twatch_print(struct timespec *tspec, const char *name) {
  printf("%s: %lu.%09ld\n", name, tspec->tv_sec, tspec->tv_nsec);
}


x86 assembly (clang, -O0):
<twatch_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twatch_print>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%edx
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@.str = [15 x i8] c"%s: %lu.%09ld\0A\00"
define void @twatch_print(%struct.timespec* %0, i8* %1) {
%3 = alloca %struct.timespec*
%4 = alloca i8*
store %struct.timespec* %0, %struct.timespec** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load %struct.timespec*, %struct.timespec** %3
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = load %struct.timespec*, %struct.timespec** %3
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@.str = [15 x i8] c"%s: %lu.%09ld\0A\00"
define void @twatch_print(%struct.timespec* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %4, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int summa(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int s = summa(0, 0);
  printf("sum=%d\n", s);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"sum=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @summa(i32 0, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void eee() {}


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

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

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

LLVM IR (-O2):
define void @eee() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ FlattenDouble(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 double);
scalar_t__ i16_to_be_buf(int /*<<< orphan*/ *, int /*<<< orphan*/);
size_t i64_to_be_buf(int /*<<< orphan*/ *, int /*<<< orphan*/);
size_t SerializeDouble(uint8_t *buf, double number) {
  int64_t mant;
  int16_t exp;
  size_t result = 0;
  FlattenDouble(&mant, &exp, number);
  result = i64_to_be_buf(buf, mant);
  result += i16_to_be_buf(buf + result, exp);
  return result;
}


x86 assembly (clang, -O0):
<SerializeDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <FlattenDouble@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <i64_to_be_buf@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%esi
call   1030 <i16_to_be_buf@plt>
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerializeDouble>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <FlattenDouble@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1050 <i64_to_be_buf@plt>
mov    %rax,%rbx
lea    (%r14,%rax,4),%rdi
mov    (%rsp),%esi
call   1030 <i16_to_be_buf@plt>
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @SerializeDouble(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %3
store double %1, double* %4
store i64 0, i64* %7
%8 = load double, double* %4
%9 = call i32 @FlattenDouble(i32* %5, i32* %6, double %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = call i64 @i64_to_be_buf(i32* %10, i32 %11)
store i64 %12, i64* %7
%13 = load i32*, i32** %3
%14 = load i64, i64* %7
%15 = getelementptr inbounds i32, i32* %13, i64 %14
%16 = load i32, i32* %6
%17 = call i64 @i16_to_be_buf(i32* %15, i32 %16)
%18 = load i64, i64* %7
%19 = add i64 %18, %17
store i64 %19, i64* %7
%20 = load i64, i64* %7
ret i64 %20
}

LLVM IR (-O2):
define i64 @SerializeDouble(i32* %0, double %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @FlattenDouble(i32* %3, i32* %4, double %1)
%8 = load i32, i32* %3
%9 = call i64 @i64_to_be_buf(i32* %0, i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %4
%12 = call i64 @i16_to_be_buf(i32* %10, i32 %11)
%13 = add i64 %12, %9
ret i64 %13
}
void Network_uninit(void) {}


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

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

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

LLVM IR (-O2):
define void @Network_uninit() {
ret void
}
/* Variables and functions */
int dalavuelta(int);
int es_capicua(int numero) { return numero == dalavuelta(numero); }


x86 assembly (clang, -O0):
<es_capicua>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <dalavuelta@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_capicua>:
push   %rbx
mov    %edi,%ebx
call   1030 <dalavuelta@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @es_capicua(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dalavuelta(i32 %4)
%6 = icmp eq i32 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @es_capicua(i32 %0) {
%2 = tail call i32 @dalavuelta(i32 %0)
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void flush(void) {
  while ((*(volatile unsigned char *)0x101F1018) & (1 << 3))
    barrier();
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flush+0x9>
mov    $0x101f1018,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     113b <flush+0x2b>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1119 <flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rax
testb  $0x8,0x101f1018
08
je     1131 <flush+0x21>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x8,0x101f1018
08
jne    1120 <flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @flush() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i8, i8* inttoptr (i64 270471192 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @barrier()
br label %1
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flush() {
%1 = load volatile i8, i8* inttoptr (i64 270471192 to i8*)
%2 = and i8 %1, 8
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @barrier()
%6 = load volatile i8, i8* inttoptr (i64 270471192 to i8*)
%7 = and i8 %6, 8
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret void
}
int left(int symbol) {
  symbol >>= 4;
  symbol += '0';
  if (symbol > '9')
    symbol += 7;
  return symbol;
}


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x39,-0x4(%rbp)
jle    112c <left+0x2c>
mov    -0x4(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
mov    %edi,%eax
sar    $0x4,%eax
lea    0x30(%rax),%ecx
add    $0x37,%eax
cmp    $0xa0,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = ashr i32 %0, 4
%3 = icmp sgt i32 %0, 159
%4 = select i1 %3, i32 55, i32 48
%5 = add nsw i32 %4, %2
ret i32 %5
}
void break7() {}


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

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

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

LLVM IR (-O2):
define void @break7() {
ret void
}
void g_closure_add_finalize_notifier() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_add_finalize_notifier() {
ret void
}
int rcount_limit(int hpCount) { return hpCount; }


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

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

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

LLVM IR (-O2):
define i32 @rcount_limit(i32 returned %0) {
ret i32 %0
}
int get_int(char **s) {
  int i = 0;
  char *p = *s;
  while ((*p >= '0') && (*p <= '9')) {
    i = i * 10 + (*p - '0');
    p++;
  }
  *s = p;
  return i;
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x19(%rbp)
jl     113f <get_int+0x3f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114f <get_int+0x4f>
jmp    1173 <get_int+0x73>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <get_int+0x1a>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
lea    -0x30(%rdx),%esi
xor    %eax,%eax
cmp    $0x9,%sil
ja     113d <get_int+0x3d>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %dl,%edx
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl 0x1(%rcx),%edx
add    $0x1,%rcx
lea    -0x30(%rdx),%esi
cmp    $0xa,%sil
jb     1120 <get_int+0x20>
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @get_int(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i8*
store i8** %0, i8*** %2
store i32 0, i32* %3
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
store i8* %6, i8** %4
br label %7
7: ; preds = %19, %1
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 48
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp sle i32 %15, 57
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ false, %7 ], [ %16, %12 ]
br i1 %18, label %19, label %29
19: ; preds = %17
%20 = load i32, i32* %3
%21 = mul nsw i32 %20, 10
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 48
%26 = add nsw i32 %21, %25
store i32 %26, i32* %3
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %4
br label %7
29: ; preds = %17
%30 = load i8*, i8** %4
%31 = load i8**, i8*** %2
store i8* %30, i8** %31
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @get_int(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %3, %1 ]
%8 = phi i8* [ %14, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = zext i8 %7 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
%20 = phi i8* [ %2, %1 ], [ %14, %6 ]
store i8* %20, i8** %0
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ PUT32(int, int);
void led_off() { PUT32(0x2020001C, 1 << 16); }


x86 assembly (clang, -O0):
<led_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2020001c,%edi
mov    $0x10000,%esi
call   1030 <PUT32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_off>:
mov    $0x2020001c,%edi
mov    $0x10000,%esi
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @led_off() {
%1 = call i32 @PUT32(i32 538968092, i32 65536)
ret void
}

LLVM IR (-O2):
define void @led_off() {
%1 = tail call i32 @PUT32(i32 538968092, i32 65536)
ret void
}
void gdk_window_get_parent() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_get_parent() {
ret void
}
/* Variables and functions */
int om_wifi_power_swap(int);
int om_wifi_power_set(int value) {
  int res = om_wifi_power_swap(value);
  if (res < 0)
    return res;
  return 0;
}


x86 assembly (clang, -O0):
<om_wifi_power_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <om_wifi_power_swap@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    113b <om_wifi_power_set+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <om_wifi_power_set+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_wifi_power_set>:
push   %rax
call   1030 <om_wifi_power_swap@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @om_wifi_power_set(i32 %0) {
%2 = tail call i32 @om_wifi_power_swap(i32 %0)
%3 = icmp slt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
scalar_t__ xmalloc(int);
char *xstrdup(const char *str) {
  char *new;
  new = (char *)xmalloc((strlen(str) + 1) * sizeof(char));
  strcpy(new, str);
  return new;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i64 @xmalloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @xmalloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wstandout(int /*<<< orphan*/ *);
int ncurses_wstandout(WINDOW *win) { return wstandout(win); }


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

x86 assembly (clang, -O2):
<ncurses_wstandout>:
jmp    1030 <wstandout@plt>

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

LLVM IR (-O2):
define i32 @ncurses_wstandout(i32* %0) {
%2 = tail call i32 @wstandout(i32* %0)
ret i32 %2
}
/* Variables and functions */
int sqrt(int);
int is_perfect_sq(int n) {
  int s = sqrt(n);
  return s * s == n;
}


x86 assembly (clang, -O0):
<is_perfect_sq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_perfect_sq>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
imul   %eax,%eax
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_perfect_sq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sqrt(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = icmp eq i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_perfect_sq(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = mul nsw i32 %2, %2
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
__attribute__((no, noclone)) int fn1(int x) {
  int r;
  __asm__ volatile("" : "=r"(r) : "0"(1), "r"(x) : "memory");
  return r;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "", "=r,0,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 1, i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
%2 = tail call i32 asm sideeffect "", "=r,0,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 1, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ glb_builtin_prior_clean();
int /*<<< orphan*/ glb_clean_up();
void final_clean() {
  glb_builtin_prior_clean();
  glb_clean_up();
  return;
}


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

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

LLVM IR (-O0):
define void @final_clean() {
%1 = call i32 (...) @glb_builtin_prior_clean()
%2 = call i32 (...) @glb_clean_up()
ret void
}

LLVM IR (-O2):
define void @final_clean() {
%1 = tail call i32 (...) @glb_builtin_prior_clean()
%2 = tail call i32 (...) @glb_clean_up()
ret void
}
double Fahrenheit_Celsius(int fahr) {
  double celsius = (5.0 / 9.0) * (fahr - 32);
  return celsius;
}


x86 assembly (clang, -O0):
<Fahrenheit_Celsius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fahrenheit_Celsius>:
add    $0xffffffe0,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Fahrenheit_Celsius(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = sitofp i32 %5 to double
%7 = fmul double 0x3FE1C71C71C71C72, %6
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @Fahrenheit_Celsius(i32 %0) {
%2 = add nsw i32 %0, -32
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ DMA7_DMA23_DriverIRQHandler();
__attribute__((weak)) void DMA7_DMA23_IRQHandler(void) {
  DMA7_DMA23_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @DMA7_DMA23_IRQHandler() {
%1 = tail call i32 (...) @DMA7_DMA23_DriverIRQHandler()
ret void
}
main() {
  int x, y;
  x = 0;
  y = 1;
  if (x == 0) {
    y++;
    printf(y);
  } else
    printf(y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1150 <main+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115b <main+0x4b>
movslq -0xc(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 2 to i8*))
ret i32 0
}