xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int send_message(int sock, char *message) {
  write(sock, message, strlen(message));
  return 1;
}


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

x86 assembly (clang, -O2):
<send_message>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @send_message(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret i32 1
}

LLVM IR (-O2):
define i32 @send_message(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 1
}
/* Variables and functions */
scalar_t__ foo(int *, int **, int **, int);
int main(int argc, char **argv) {
  int p;
  int A[10];
  int B[10];
  return (int)foo(&p, &A, &B, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x14(%rbp),%rdi
mov    $0xa,%ecx
call   1030 <foo@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
lea    0xc(%rsp),%rdi
lea    0x40(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0xa,%ecx
call   1030 <foo@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i32]
%8 = alloca [10 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [10 x i32]* %7 to i32**
%10 = bitcast [10 x i32]* %8 to i32**
%11 = call i64 @foo(i32* %6, i32** %9, i32** %10, i32 10)
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca [10 x i32]
%6 = bitcast i32* %3 to i8*
%7 = bitcast [10 x i32]* %4 to i8*
%8 = bitcast [10 x i32]* %5 to i8*
%9 = bitcast [10 x i32]* %4 to i32**
%10 = bitcast [10 x i32]* %5 to i32**
%11 = call i64 @foo(i32* %3, i32** %9, i32** %10, i32 10)
%12 = trunc i64 %11 to i32
ret i32 %12
}
void zzAKSC_HDOEProcessS3(void) {}


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

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

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

LLVM IR (-O2):
define void @zzAKSC_HDOEProcessS3() {
ret void
}
void switchuart() {}


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

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

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

LLVM IR (-O2):
define void @switchuart() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hlp_launch_v(char *, char *, char *, int /*<<< orphan*/ *);
void hlp_launch(char *exid, char *flow, char *payload) {
  hlp_launch_v(exid, flow, payload, NULL);
}


x86 assembly (clang, -O0):
<hlp_launch>:
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
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <hlp_launch_v@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlp_launch>:
xor    %ecx,%ecx
jmp    1030 <hlp_launch_v@plt>

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

LLVM IR (-O2):
define void @hlp_launch(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @hlp_launch_v(i8* %0, i8* %1, i8* %2, i32* null)
ret void
}
char *parse_cifs_url(unc_name) { printf("\ncifs url %s\n", unc_name); }


x86 assembly (clang, -O0):
<parse_cifs_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_cifs_url>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0Acifs url %s\0A\00"
define i8* @parse_cifs_url(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0Acifs url %s\0A\00"
define noalias i8* @parse_cifs_url(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ m68ki_exception_illegal();
void m68k_op_trapf(void) {
  if (0) {
    return;
  }
  m68ki_exception_illegal();
}


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

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

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

LLVM IR (-O2):
define void @m68k_op_trapf() {
%1 = tail call i32 (...) @m68ki_exception_illegal()
ret void
}
char *emvPrint_Source(unsigned char source) {
  switch (source) {
  case 1:
    return "ICC";
    break;
  case 0:
    return "Terminal";
    break;
  case 2:
    return "Issuer";
    break;
  }
}


x86 assembly (clang, -O0):
<emvPrint_Source>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1150 <emvPrint_Source+0x50>
jmp    111e <emvPrint_Source+0x1e>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1140 <emvPrint_Source+0x40>
jmp    112f <emvPrint_Source+0x2f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1160 <emvPrint_Source+0x60>
jmp    116b <emvPrint_Source+0x6b>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <emvPrint_Source+0x6b>
lea    0xead(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <emvPrint_Source+0x6b>
lea    0xea6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<emvPrint_Source>:
test   %edi,%edi
lea    0xefb(%rip),%rax
lea    0xef0(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x2,%dil
lea    0xeee(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ICC\00"
@.str.1 = [9 x i8] c"Terminal\00"
@.str.2 = [7 x i8] c"Issuer\00"
define i8* @emvPrint_Source(i8 zeroext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %9 [
i32 1, label %6
i32 0, label %7
i32 2, label %8
]
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %6, %7, %8, %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"ICC\00"
@.str.1 = [9 x i8] c"Terminal\00"
@.str.2 = [7 x i8] c"Issuer\00"
define i8* @emvPrint_Source(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%4 = icmp eq i8 %0, 2
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ crypto_stream_aes128ctr_afternm(unsigned char *,
                                                   unsigned long long,
                                                   unsigned char const *,
                                                   unsigned char *);
int /*<<< orphan*/ crypto_stream_aes128ctr_beforenm(unsigned char *,
                                                    unsigned char const *);
int crypto_stream_aes128ctr(unsigned char *out, unsigned long long outlen,
                            const unsigned char *n, const unsigned char *k) {
  unsigned char d[1408];
  crypto_stream_aes128ctr_beforenm(d, k);
  crypto_stream_aes128ctr_afternm(out, outlen, n, d);
  return 0;
}


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

x86 assembly (clang, -O2):
<crypto_stream_aes128ctr>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x588,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rcx,%rsi
call   1030 <crypto_stream_aes128ctr_beforenm@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
call   1040 <crypto_stream_aes128ctr_afternm@plt>
xor    %eax,%eax
add    $0x588,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @crypto_stream_aes128ctr(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [1408 x i8]
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [1408 x i8], [1408 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %8
%12 = call i32 @crypto_stream_aes128ctr_beforenm(i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = load i8*, i8** %7
%16 = getelementptr inbounds [1408 x i8], [1408 x i8]* %9, i64 0, i64 0
%17 = call i32 @crypto_stream_aes128ctr_afternm(i8* %13, i64 %14, i8* %15, i8* %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @crypto_stream_aes128ctr(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca [1408 x i8]
%6 = getelementptr inbounds [1408 x i8], [1408 x i8]* %5, i64 0, i64 0
%7 = call i32 @crypto_stream_aes128ctr_beforenm(i8* %6, i8* %3)
%8 = call i32 @crypto_stream_aes128ctr_afternm(i8* %0, i64 %1, i8* %2, i8* %6)
ret i32 0
}
/* Variables and functions */
double ln_get_pluto_earth_dist(double);
double ln_get_pluto_solar_dist(double);
int log10(double);
double ln_get_pluto_magnitude(double JD) {
  double delta, r;
  r = ln_get_pluto_solar_dist(JD);
  delta = ln_get_pluto_earth_dist(JD);
  return -1.0 + 5 * log10(r * delta);
}


x86 assembly (clang, -O0):
<ln_get_pluto_magnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <ln_get_pluto_solar_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_pluto_earth_dist@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
imul   $0x5,%eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe87(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_pluto_magnitude>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1050 <ln_get_pluto_solar_dist@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <ln_get_pluto_earth_dist@plt>
mulsd  0x10(%rsp),%xmm0
call   1040 <log10@plt>
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xe93(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ln_get_pluto_magnitude(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @ln_get_pluto_solar_dist(double %5)
store double %6, double* %4
%7 = load double, double* %2
%8 = call double @ln_get_pluto_earth_dist(double %7)
store double %8, double* %3
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = call i32 @log10(double %11)
%13 = mul nsw i32 5, %12
%14 = sitofp i32 %13 to double
%15 = fadd double -1.000000e+00, %14
ret double %15
}

LLVM IR (-O2):
define double @ln_get_pluto_magnitude(double %0) {
%2 = tail call double @ln_get_pluto_solar_dist(double %0)
%3 = tail call double @ln_get_pluto_earth_dist(double %0)
%4 = fmul double %2, %3
%5 = tail call i32 @log10(double %4)
%6 = mul nsw i32 %5, 5
%7 = sitofp i32 %6 to double
%8 = fadd double %7, -1.000000e+00
ret double %8
}
void gtk_widget_has_screen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_has_screen() {
ret void
}
void vnum_result4(int *data) {
  int k = data[2];
  data[k] = 2;
  data[0] = 0;
}


x86 assembly (clang, -O0):
<vnum_result4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnum_result4>:
movslq 0x8(%rdi),%rax
movl   $0x2,(%rdi,%rax,4)
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @vnum_result4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
store i32 2, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 0, i32* %12
ret void
}

LLVM IR (-O2):
define void @vnum_result4(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 2, i32* %5
store i32 0, i32* %0
ret void
}
MOD(statlink, b, a) int *statlink;
int a, b;
{
  int r;
  r = a % b;
  return (r < 0 ? r + (b < 0 ? -b : b) : r);
}


x86 assembly (clang, -O0):
<MOD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1155 <MOD+0x55>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    113f <MOD+0x3f>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1145 <MOD+0x45>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
jmp    115b <MOD+0x5b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MOD>:
mov    %edx,%eax
cltd
idiv   %esi
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
mov    %edx,%eax
sar    $0x1f,%eax
and    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @MOD(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* %6
%9 = load i32, i32* %5
%10 = srem i32 %8, %9
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %25
13: ; preds = %3
%14 = load i32, i32* %7
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %5
%19 = sub nsw i32 0, %18
br label %22
20: ; preds = %13
%21 = load i32, i32* %5
br label %22
22: ; preds = %20, %17
%23 = phi i32 [ %19, %17 ], [ %21, %20 ]
%24 = add nsw i32 %14, %23
br label %27
25: ; preds = %3
%26 = load i32, i32* %7
br label %27
27: ; preds = %25, %22
%28 = phi i32 [ %24, %22 ], [ %26, %25 ]
ret i32 %28
}

LLVM IR (-O2):
define i32 @MOD(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = srem i32 %2, %1
%5 = icmp slt i32 %4, 0
%6 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%7 = select i1 %5, i32 %6, i32 0
%8 = add nsw i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze_all(char *, char *);
int main() {
  char badchars[] = "abcd";
  char source[] = "hhahhbhhchhd";
  printf("\n%s\n", source);
  squeeze_all(source, badchars);
  printf("\n%s\n", source);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x6(%rbp)
lea    -0x12(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x12(%rbp),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <squeeze_all@plt>
lea    -0x12(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movb   $0x0,0x4(%rsp)
movl   $0x64636261,(%rsp)
movabs $0x64686863686862,%rax
mov    %rax,0xd(%rsp)
movabs $0x6868626868616868,%rax
62 68 68
mov    %rax,0x8(%rsp)
lea    0xeba(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <squeeze_all@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.badchars = [5 x i8] c"abcd\00"
@__const.main.source = [13 x i8] c"hhahhbhhchhd\00"
@.str = [5 x i8] c"\0A%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [13 x i8]
%3 = bitcast [5 x i8]* %1 to i8*
%4 = bitcast [13 x i8]* %2 to i8*
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%9 = call i32 @squeeze_all(i8* %7, i8* %8)
%10 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.badchars = [5 x i8] c"abcd\00"
@__const.main.source = [13 x i8] c"hhahhbhhchhd\00"
@.str = [5 x i8] c"\0A%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @squeeze_all(i8* %4, i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void talk(void) { say("Looks like a spinning wheel.", 1); }


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Looks like a spinning wheel.\00"
define void @talk() {
%1 = call i32 @say(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Looks like a spinning wheel.\00"
define void @talk() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ slcat(char *, char const *, int);
int /*<<< orphan*/ slcpy(char *, char const *, int);
const char *concat(const char *a, const char *b) {
  static char buffer[9000];
  slcpy(buffer, a, 9000);
  slcat(buffer, b, 9000);
  return buffer;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f05(%rip),%rdi
mov    $0x2328,%edx
call   1030 <slcpy@plt>
mov    -0x10(%rbp),%rsi
lea    0x2ef0(%rip),%rdi
mov    $0x2328,%edx
call   1040 <slcat@plt>
lea    0x2edf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x2f0f(%rip),%r14
mov    %r14,%rdi
mov    $0x2328,%edx
call   1030 <slcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2328,%edx
call   1040 <slcat@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@concat.buffer = internal global [9000 x i8] zeroinitializer
define i8* @concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @slcpy(i8* getelementptr inbounds ([9000 x i8], [9000 x i8]* @concat.buffer, i64 0, i64 0), i8* %5, i32 9000)
%7 = load i8*, i8** %4
%8 = call i32 @slcat(i8* getelementptr inbounds ([9000 x i8], [9000 x i8]* @concat.buffer, i64 0, i64 0), i8* %7, i32 9000)
ret i8* getelementptr inbounds ([9000 x i8], [9000 x i8]* @concat.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@concat.buffer = internal global [9000 x i8] zeroinitializer
define i8* @concat(i8* %0, i8* %1) {
%3 = tail call i32 @slcpy(i8* getelementptr inbounds ([9000 x i8], [9000 x i8]* @concat.buffer, i64 0, i64 0), i8* %0, i32 9000)
%4 = tail call i32 @slcat(i8* getelementptr inbounds ([9000 x i8], [9000 x i8]* @concat.buffer, i64 0, i64 0), i8* %1, i32 9000)
ret i8* getelementptr inbounds ([9000 x i8], [9000 x i8]* @concat.buffer, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xa8() {
  Assert_real((isodigit(168) == 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_isodigit.c",
              845, ("isodigit should be 0 for 0xa8"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xa8>:
push   %rax
mov    $0xa8,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x34d,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa8\00"
define void @t_isodigit_0xa8() {
%1 = call i64 @isodigit(i32 168)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 845, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa8\00"
define void @t_isodigit_0xa8() {
%1 = tail call i64 @isodigit(i32 168)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 845, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct winsize {
  scalar_t__ ws_col;
  scalar_t__ ws_row;
};
typedef int ioctl;

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
int main(void) {
  struct winsize ws;
  int r = (ioctl)(0, TIOCGWINSZ, &ws);
  return !(r != -1 && ws.ws_col > 0 && ws.ws_row > 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
je     113c <main+0x3c>
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x1d(%rbp)
jle    113c <main+0x3c>
cmpq   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.winsize = type { i64, i64 }
@TIOCGWINSZ = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.winsize
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @TIOCGWINSZ
%5 = ptrtoint %struct.winsize* %2 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %16
8: ; preds = %0
%9 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%10 = load i64, i64* %9
%11 = icmp sgt i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 1
%14 = load i64, i64* %13
%15 = icmp sgt i64 %14, 0
br label %16
16: ; preds = %12, %8, %0
%17 = phi i1 [ false, %8 ], [ false, %0 ], [ %15, %12 ]
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
%struct.winsize = type { i64, i64 }
@TIOCGWINSZ = global i32 0
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ read_number();
int read_degree() {
  int n = 0;
  printf("Entra el grau del polinomi interpolador (n > 0): ");
  n = (int)read_number();
  if (n < 0) {
    printf("ERROR: el grau ha de ser positiu o 0\n");
    exit(1);
  }
  return n;
}


x86 assembly (clang, -O0):
<read_degree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <read_number@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1175 <read_degree+0x45>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_degree>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <read_number@plt>
test   %eax,%eax
js     115a <read_degree+0x1a>
pop    %rcx
ret
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"Entra el grau del polinomi interpolador (n > 0): \00"
@.str.1 = [38 x i8] c"ERROR: el grau ha de ser positiu o 0\0A\00"
define i32 @read_degree() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @read_number()
%4 = trunc i64 %3 to i32
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [50 x i8] c"Entra el grau del polinomi interpolador (n > 0): \00"
@str = [37 x i8] c"ERROR: el grau ha de ser positiu o 0\00"
define i32 @read_degree() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @read_number()
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  puts("Hello world!\n");
  sleep(1);
  puts("Here I am.");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [11 x i8] c"Here I am.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sleep(i32 1)
%4 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [11 x i8] c"Here I am.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _pu_path_is_exe(char const *);
int(cpl_check_exe)(void *data, const char *pathname) {
  return _pu_path_is_exe(pathname);
}


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

x86 assembly (clang, -O2):
<cpl_check_exe>:
mov    %rsi,%rdi
jmp    1030 <_pu_path_is_exe@plt>

LLVM IR (-O0):
define i32 @cpl_check_exe(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @_pu_path_is_exe(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @cpl_check_exe(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @_pu_path_is_exe(i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void printdegrees(double latlon) {
  int degrees = (int)latlon;
  double minutes = (latlon - (double)(degrees)) * ((double)60.0);
  printf("%2d:%02.3lf", degrees, minutes);
}


x86 assembly (clang, -O0):
<printdegrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printdegrees>:
cvttsd2si %xmm0,%esi
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xed8(%rip),%xmm0
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%2d:%02.3lf\00"
define void @printdegrees(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fptosi double %5 to i32
store i32 %6, i32* %3
%7 = load double, double* %2
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fsub double %7, %9
%11 = fmul double %10, 6.000000e+01
store double %11, double* %4
%12 = load i32, i32* %3
%13 = load double, double* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %12, double %13)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%2d:%02.3lf\00"
define void @printdegrees(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = fmul double %4, 6.000000e+01
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, double %5)
ret void
}
void mov_to_cr8(void) {
  unsigned long cr8 = 0;
  asm volatile("mov %0, %%cr8" : : "r"(cr8));
}


x86 assembly (clang, -O0):
<mov_to_cr8>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%cr8
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_to_cr8>:
xor    %eax,%eax
mov    %rax,%cr8
ret

LLVM IR (-O0):
define void @mov_to_cr8() {
%1 = alloca i64
store i64 0, i64* %1
%2 = load i64, i64* %1
ret void
}

LLVM IR (-O2):
define void @mov_to_cr8() {
tail call void asm sideeffect "mov $0, %cr8", "r,~{dirflag},~{fpsr},~{flags}"(i64 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdout;
FILE *xfopen(char *fn, char *mode) {
  FILE *p;
  if ((p = fopen(fn, mode)) == NULL) {
    perror("uniq");
    fflush(stdout);
    exit(1);
  }
  return (p);
}


x86 assembly (clang, -O0):
<xfopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    118f <xfopen+0x4f>
lea    0xe8e(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfopen>:
push   %rax
call   1040 <fopen@plt>
test   %rax,%rax
je     114d <xfopen+0xd>
pop    %rcx
ret
lea    0xeac(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"uniq\00"
@stdout = global i32 0
define noalias i32* @xfopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int cutils_fcmp_double_compare(double, double);
bool cutils_cdar_DynamicArray_double_compare(const void *p1, const void *p2,
                                             size_t s) {
  return cutils_fcmp_double_compare(*(double *)p1, *(double *)p2);
}


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

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_double_compare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
jmp    1030 <cutils_fcmp_double_compare@plt>

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_double_compare(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 = bitcast i8* %7 to double*
%9 = load double, double* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
%13 = call i32 @cutils_fcmp_double_compare(double %9, double %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_double_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
%6 = bitcast i8* %1 to double*
%7 = load double, double* %6
%8 = tail call i32 @cutils_fcmp_double_compare(double %5, double %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fsize(char *);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    fsize(".");
  } else {
    while (--argc) {
      fsize(*++argv);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <fsize@plt>
jmp    117a <main+0x6a>
jmp    1146 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1175 <main+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <fsize@plt>
jmp    1146 <main+0x36>
jmp    117a <main+0x6a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
jne    1128 <main+0x18>
lea    0xedf(%rip),%rdi
call   1030 <fsize@plt>
jmp    1152 <main+0x42>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <fsize@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @fsize(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %21
10: ; preds = %2
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i32 1
store i8** %17, i8*** %5
%18 = load i8*, i8** %17
%19 = call i32 @fsize(i8* %18)
br label %11
20: ; preds = %11
br label %21
21: ; preds = %20, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = add nsw i32 %0, -1
br label %8
6: ; preds = %2
%7 = tail call i32 @fsize(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
8: ; preds = %4, %8
%9 = phi i32 [ %14, %8 ], [ %5, %4 ]
%10 = phi i8** [ %11, %8 ], [ %1, %4 ]
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @fsize(i8* %12)
%14 = add nsw i32 %9, -1
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %6
ret i32 0
}
int test_imm_DDint8_reg(signed char val) {
  return ((val) & (0xDD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DDint8_reg(i8 signext %0) {
%2 = and i8 %0, -35
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
const char *error_simgen_longdesc() {
  return "Generate MIL errors\n"
         "Seed: Ignored";
}


x86 assembly (clang, -O0):
<error_simgen_longdesc>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"Generate MIL errors\0ASeed: Ignored\00"
define i8* @error_simgen_longdesc() {
ret i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [34 x i8] c"Generate MIL errors\0ASeed: Ignored\00"
define i8* @error_simgen_longdesc() {
ret i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ cl_program;
typedef int /*<<< orphan*/ cl_kernel;
typedef int /*<<< orphan*/ cl_int;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_kernel clCreateKernel(cl_program program, const char *kernel_name,
                         cl_int *errcode_ret) {
  unsigned int sys_args[3];
  sys_args[0] = (unsigned int)program;
  sys_args[1] = (unsigned int)kernel_name;
  sys_args[2] = (unsigned int)errcode_ret;
  return (cl_kernel)syscall(325, 1036, sys_args);
}


x86 assembly (clang, -O0):
<clCreateKernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
lea    -0x24(%rbp),%rdx
mov    $0x145,%edi
mov    $0x40c,%esi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clCreateKernel>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rdx
mov    $0x145,%edi
mov    $0x40c,%esi
call   1030 <syscall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @clCreateKernel(i64 %0, i8* %1, i32* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca [3 x i32]
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 %9, i32* %10
%11 = load i8*, i8** %5
%12 = ptrtoint i8* %11 to i32
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i32*, i32** %6
%15 = ptrtoint i32* %14 to i32
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
store i32 %15, i32* %16
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%18 = call i32 @syscall(i32 325, i32 1036, i32* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @clCreateKernel(i64 %0, i8* %1, i32* %2) {
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %4 to i8*
%6 = trunc i64 %0 to i32
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32 %6, i32* %7
%8 = ptrtoint i8* %1 to i64
%9 = trunc i64 %8 to i32
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 %9, i32* %10
%11 = ptrtoint i32* %2 to i64
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
store i32 %12, i32* %13
%14 = call i32 @syscall(i32 325, i32 1036, i32* %7)
ret i32 %14
}
/* Variables and functions */
scalar_t__ GPIOPinLockStatus(unsigned long, unsigned char);
void GPIOPinUnlock(unsigned long ulPort, unsigned char ucPins) {
  ;
  if (GPIOPinLockStatus(ulPort, ucPins)) {
    (*((volatile unsigned long *)(ulPort + 0x00000520))) = 0x4C4F434B;
    (*((volatile unsigned long *)(ulPort + 0x00000524))) |= ucPins;
    (*((volatile unsigned long *)(ulPort + 0x00000520))) = 0x00000000;
  }
}


x86 assembly (clang, -O0):
<GPIOPinUnlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPinLockStatus@plt>
cmp    $0x0,%rax
je     1172 <GPIOPinUnlock+0x62>
mov    -0x8(%rbp),%rax
movq   $0x4c4f434b,0x520(%rax)
4b 43 4f 4c
movzbl -0x9(%rbp),%eax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x524(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x524(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x520(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinUnlock>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <GPIOPinLockStatus@plt>
test   %rax,%rax
je     1143 <GPIOPinUnlock+0x33>
movq   $0x4c4f434b,0x520(%rbx)
4b 43 4f 4c
movzbl %bpl,%eax
or     %rax,0x524(%rbx)
movq   $0x0,0x520(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @GPIOPinUnlock(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = call i64 @GPIOPinLockStatus(i64 %5, i8 zeroext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %2
%10 = load i64, i64* %3
%11 = add i64 %10, 1312
%12 = inttoptr i64 %11 to i64*
store volatile i64 1280262987, i64* %12
%13 = load i8, i8* %4
%14 = zext i8 %13 to i64
%15 = load i64, i64* %3
%16 = add i64 %15, 1316
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = or i64 %18, %14
store volatile i64 %19, i64* %17
%20 = load i64, i64* %3
%21 = add i64 %20, 1312
%22 = inttoptr i64 %21 to i64*
store volatile i64 0, i64* %22
br label %23
23: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @GPIOPinUnlock(i64 %0, i8 zeroext %1) {
%3 = tail call i64 @GPIOPinLockStatus(i64 %0, i8 zeroext %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = add i64 %0, 1312
%7 = inttoptr i64 %6 to i64*
store volatile i64 1280262987, i64* %7
%8 = zext i8 %1 to i64
%9 = add i64 %0, 1316
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, %8
store volatile i64 %12, i64* %10
store volatile i64 0, i64* %7
br label %13
13: ; preds = %5, %2
ret void
}
int is4ByteStarter(unsigned char c) { return c >= 240 && c < 248; }


x86 assembly (clang, -O0):
<is4ByteStarter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xf0,%ecx
mov    %al,-0x2(%rbp)
jl     112e <is4ByteStarter+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0xf8,%eax
setl   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is4ByteStarter>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0xf0,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is4ByteStarter(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 240
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %8, 248
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is4ByteStarter(i8 zeroext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, -16
%4 = zext i1 %3 to i32
ret i32 %4
}