xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ is_signed_zero(long double const);
long double pos_zero(const long double a) { return is_signed_zero(a) ? 0 : a; }


x86 assembly (clang, -O0):
<pos_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <is_signed_zero@plt>
cmp    $0x0,%rax
je     113f <pos_zero+0x2f>
fldz
fstpt  -0x1c(%rbp)
jmp    1145 <pos_zero+0x35>
fldt   -0x10(%rbp)
fstpt  -0x1c(%rbp)
fldt   -0x1c(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_zero>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1030 <is_signed_zero@plt>
test   %rax,%rax
fldz
fldt   0x1c(%rsp)
fxch   %st(1)
fcmove %st(1),%st
fstp   %st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @pos_zero(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @is_signed_zero(x86_fp80 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load x86_fp80, x86_fp80* %2
br label %9
9: ; preds = %7, %6
%10 = phi x86_fp80 [ 0xK00000000000000000000, %6 ], [ %8, %7 ]
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @pos_zero(x86_fp80 %0) {
%2 = tail call i64 @is_signed_zero(x86_fp80 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, x86_fp80 %0, x86_fp80 0xK00000000000000000000
ret x86_fp80 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int /*<<< orphan*/ const, int);
int /*<<< orphan*/ wait_ec(int, int, int /*<<< orphan*/);
void do_ec(const uint32_t cmd, const uint32_t port, const uint8_t value) {
  wait_ec(0x66, 1, 0);
  outb(cmd, 0x66);
  wait_ec(0x66, 1, 0);
  outb(port, 0x62);
  wait_ec(0x66, 1, 0);
  outb(value, 0x62);
  wait_ec(0x66, 1, 0);
  return;
}


x86 assembly (clang, -O0):
<do_ec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    -0x4(%rbp),%edi
mov    $0x66,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    -0x8(%rbp),%edi
mov    $0x62,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    -0xc(%rbp),%edi
mov    $0x62,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ec>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    %ebx,%edi
mov    $0x66,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    %ebp,%edi
mov    $0x62,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <wait_ec@plt>
mov    %r14d,%edi
mov    $0x62,%esi
call   1040 <outb@plt>
mov    $0x66,%edi
mov    $0x1,%esi
xor    %edx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <wait_ec@plt>

LLVM IR (-O0):
define void @do_ec(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 = call i32 @wait_ec(i32 102, i32 1, i32 0)
%8 = load i32, i32* %4
%9 = call i32 @outb(i32 %8, i32 102)
%10 = call i32 @wait_ec(i32 102, i32 1, i32 0)
%11 = load i32, i32* %5
%12 = call i32 @outb(i32 %11, i32 98)
%13 = call i32 @wait_ec(i32 102, i32 1, i32 0)
%14 = load i32, i32* %6
%15 = call i32 @outb(i32 %14, i32 98)
%16 = call i32 @wait_ec(i32 102, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @do_ec(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @wait_ec(i32 102, i32 1, i32 0)
%5 = tail call i32 @outb(i32 %0, i32 102)
%6 = tail call i32 @wait_ec(i32 102, i32 1, i32 0)
%7 = tail call i32 @outb(i32 %1, i32 98)
%8 = tail call i32 @wait_ec(i32 102, i32 1, i32 0)
%9 = tail call i32 @outb(i32 %2, i32 98)
%10 = tail call i32 @wait_ec(i32 102, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sscanf(char *, char *, char *);
int main(int argc, char *argv[]) {
  char buf[128] = "";
  sscanf("123abcABC", "%[1-9A-Z]", buf);
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdx
lea    0xe96(%rip),%rdi
lea    0xe99(%rip),%rsi
call   1050 <sscanf@plt>
lea    -0x90(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xea7(%rip),%rdi
lea    0xeaa(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <sscanf@plt>
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"123abcABC\00"
@.str.1 = [10 x i8] c"%[1-9A-Z]\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [128 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [128 x i8]* %6 to i8*
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%9 = call i32 @sscanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"123abcABC\00"
@.str.1 = [10 x i8] c"%[1-9A-Z]\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @sscanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int round2_c();
int round2_b() { return round2_c(); }


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

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

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

LLVM IR (-O2):
define i32 @round2_b() {
%1 = tail call i32 (...) @round2_c()
ret i32 %1
}
void XtAddTimeOut() {}


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

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

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

LLVM IR (-O2):
define void @XtAddTimeOut() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, int);
int swap_8bits(unsigned char);
int main(int argc, char *argv[]) {
  unsigned char data = 0x78;
  printf("data:%X swap:%X\n", data, swap_8bits(data));
  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)
movb   $0x78,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x12(%rbp)
movzbl -0x11(%rbp),%edi
call   1040 <swap_8bits@plt>
mov    %eax,%edx
mov    -0x12(%rbp),%al
lea    0xeab(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"data:%X swap:%X\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @swap_8bits(i8 zeroext 120)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 zeroext 120, i32 %3)
ret i32 0
}
unsigned load4(void) { return 65809; }


x86 assembly (clang, -O0):
<load4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10111,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @load4() {
ret i32 65809
}

LLVM IR (-O2):
define i32 @load4() {
ret i32 65809
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ iterate_path(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "Usage: f3read <PATH>\n");
    return 1;
  }
  iterate_path(argv[1]);
  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   $0x2,-0x8(%rbp)
je     1161 <main+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1175 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <iterate_path@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <iterate_path@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: f3read <PATH>\0A\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 ne i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @iterate_path(i8* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %11, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: f3read <PATH>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @iterate_path(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int write(int, char *, int);
int writeSerial(int s, char *buf, int size) {
  int retval;
  retval = write(s, buf, size);
  if (retval < 0)
    retval = 0;
  return retval;
}


x86 assembly (clang, -O0):
<writeSerial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1145 <writeSerial+0x35>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeSerial>:
push   %rax
call   1030 <write@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @writeSerial(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp sgt i32 %4, 0
%6 = select i1 %5, i32 %4, i32 0
ret i32 %6
}
int test_imm_59int64_lowword_reg(long long val) {
  return ((val) & (0x59 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_59int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 89
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int __test() {
  int x = sizeof("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/bcforres/ccc/refs/heads/"
                 "master/test/tests/cpp/built_in_macros.c");
  x += 5;
  x += sizeof("Mar 17 2022");
  x += sizeof("14:32:13");
  return x;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x9a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0xc,%rax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x9,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__test() {
%1 = alloca i32
store i32 154, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 5
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = add i64 %5, 12
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = add i64 %9, 9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %1
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 180
}
/* Variables and functions */
int /*<<< orphan*/ _Exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void main() {
  printf("th\n");
  _Exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <_Exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <_Exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"th\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_Exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [3 x i8] c"th\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @_Exit(i32 0)
unreachable
}
int do_017() { return 17; }


x86 assembly (clang, -O0):
<do_017>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_017() {
ret i32 17
}

LLVM IR (-O2):
define i32 @do_017() {
ret i32 17
}
/* Variables and functions */
long strtol(char const *, int /*<<< orphan*/ *, int);
long int atol(const char *nptr) { return strtol(nptr, NULL, 10); }


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i64 @atol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i32* null, i32 10)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                   void *(*)(void *), void *);
void thread_new(pthread_t *thread, const pthread_attr_t *attr,
                void *(*handle)(void *), void *arg) {
  int err = pthread_create(thread, attr, handle, arg);
  if (err != 0) {
    perror("pthread_create");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<thread_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <pthread_create@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1184 <thread_new+0x54>
lea    0xe8f(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_new>:
push   %rax
call   1030 <pthread_create@plt>
test   %eax,%eax
jne    113c <thread_new+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"pthread_create\00"
@EXIT_FAILURE = global i32 0
define void @thread_new(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = tail call i32 @pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %4
ret void
}
/* Variables and functions */
unsigned int sleep(unsigned int);
unsigned int Sleep(unsigned int seconds) { return sleep(seconds); }


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

x86 assembly (clang, -O2):
<Sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define i32 @Sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xaa() {
  Assert_real((isgraph(170) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              855, ("isgraph should be 0 for 0xaa"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xaa>:
push   %rax
mov    $0xaa,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x357,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xaa\00"
define void @t_isgraph_0xaa() {
%1 = call i64 @isgraph(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xaa\00"
define void @t_isgraph_0xaa() {
%1 = tail call i64 @isgraph(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void g_object_set_qdata_full() {}


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

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

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

LLVM IR (-O2):
define void @g_object_set_qdata_full() {
ret void
}
/* Variables and functions */
int GetDataHeight(int);
int GetDataPeriod(int h) { return GetDataHeight(h) * 8; }


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

x86 assembly (clang, -O2):
<GetDataPeriod>:
push   %rax
call   1030 <GetDataHeight@plt>
shl    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @GetDataPeriod(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @GetDataHeight(i32 %3)
%5 = mul nsw i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetDataPeriod(i32 %0) {
%2 = tail call i32 @GetDataHeight(i32 %0)
%3 = shl nsw i32 %2, 3
ret i32 %3
}
/* Variables and functions */
int _read_data(int, char *, int, int);
int read_data_quick(int fd, char *buf, int len) {
  return _read_data(fd, buf, len, 2000000);
}


x86 assembly (clang, -O0):
<read_data_quick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1e8480,%ecx
call   1030 <_read_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data_quick>:
mov    $0x1e8480,%ecx
jmp    1030 <_read_data@plt>

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

LLVM IR (-O2):
define i32 @read_data_quick(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @_read_data(i32 %0, i8* %1, i32 %2, i32 2000000)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ triangulo(int);
int main() {
  int n;
  scanf("%d", &n);
  triangulo(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <triangulo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <triangulo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = call i32 @triangulo(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @triangulo(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main(void) {
  switch (fork()) {
  case -1:
    return 1;
  default:
    wait(NULL);
  case 0:
    close(open("/dev/null", O_RDONLY));
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1060 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0xffffffff,%eax
je     1179 <main+0x39>
jmp    1169 <main+0x29>
mov    -0x8(%rbp),%eax
test   %eax,%eax
je     118e <main+0x4e>
jmp    1185 <main+0x45>
movl   $0x1,-0x4(%rbp)
jmp    11b1 <main+0x71>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <wait@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
lea    0xe62(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%edi
call   1030 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
cmp    $0xffffffff,%eax
je     1178 <main+0x38>
test   %eax,%eax
je     1158 <main+0x18>
xor    %edi,%edi
call   1050 <wait@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
lea    0xe98(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
switch i32 %2, label %4 [
i32 -1, label %3
i32 0, label %6
]
3: ; preds = %0
store i32 1, i32* %1
br label %11
4: ; preds = %0
%5 = call i32 @wait(i32* null)
br label %6
6: ; preds = %0, %4
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @close(i32 %8)
br label %10
10: ; preds = %6
store i32 0, i32* %1
br label %11
11: ; preds = %10, %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %2 [
i32 -1, label %8
i32 0, label %4
]
2: ; preds = %0
%3 = tail call i32 @wait(i32* null)
br label %4
4: ; preds = %0, %2
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @close(i32 %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
void *test2(struct dummy *t) {
  struct dummy *tt;
  const enum dummy_enum *e;
  tt = t;
  return t;
}


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

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

LLVM IR (-O0):
%struct.dummy = type opaque
define i8* @test2(%struct.dummy* %0) {
%2 = alloca %struct.dummy*
%3 = alloca %struct.dummy*
%4 = alloca i32*
store %struct.dummy* %0, %struct.dummy** %2
%5 = load %struct.dummy*, %struct.dummy** %2
store %struct.dummy* %5, %struct.dummy** %3
%6 = load %struct.dummy*, %struct.dummy** %2
%7 = bitcast %struct.dummy* %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
%struct.dummy = type opaque
define i8* @test2(%struct.dummy* readnone %0) {
%2 = bitcast %struct.dummy* %0 to i8*
ret i8* %2
}
unsigned xrop3_222_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk1 = S | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_222_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_222_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %ecx,%edx
xor    $0xff,%edx
or     %eax,%edx
not    %ecx
and    %edx,%ecx
or     %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_222_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = or i32 %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = and i32 %39, %40
%42 = or i32 %35, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_222_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = or i32 %7, %4
%9 = xor i32 %6, -1
%10 = and i32 %8, %9
%11 = or i32 %4, %5
%12 = or i32 %11, %10
ret i32 %12
}
const char *mvdu_mode_def_str(int mode) {
  switch (mode) {
  case 1:
  case 2:
    return "SD";
  default:
    return "HD";
  }
}


x86 assembly (clang, -O0):
<mvdu_mode_def_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x1,%eax
ja     112b <mvdu_mode_def_str+0x2b>
jmp    111b <mvdu_mode_def_str+0x1b>
lea    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1136 <mvdu_mode_def_str+0x36>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvdu_mode_def_str>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
lea    0xef3(%rip),%rcx
lea    0xeef(%rip),%rax
cmovb  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"SD\00"
@.str.1 = [3 x i8] c"HD\00"
define i8* @mvdu_mode_def_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1, label %5
i32 2, label %5
]
5: ; preds = %1, %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"SD\00"
@.str.1 = [3 x i8] c"HD\00"
define i8* @mvdu_mode_def_str(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int do_child(void *args) {
  printf("%d\n", getpid());
  _exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<do_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<do_child>:
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @do_child(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @_exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @do_child(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @_exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
int main() {
  c();
  b();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @c()
%2 = tail call i32 (...) @b()
ret i32 0
}
void preempt_inc(void) { asm volatile("lock incl %%gs:0x18" : :); }


x86 assembly (clang, -O0):
<preempt_inc>:
push   %rbp
mov    %rsp,%rbp
lock incl %gs:0x18
pop    %rbp
ret

x86 assembly (clang, -O2):
<preempt_inc>:
lock incl %gs:0x18
ret

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

LLVM IR (-O2):
define void @preempt_inc() {
tail call void asm sideeffect "lock incl %gs:0x18", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int sllq_version_minor(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sllq_version_minor() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sllq_version_minor() {
ret i32 0
}
float flt_mul_sub(float a, float c) { return (a * a) - c; }


x86 assembly (clang, -O0):
<flt_mul_sub>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_mul_sub>:
mulss  %xmm0,%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @flt_mul_sub(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fneg float %7
%9 = call float @llvm.fmuladd.f32(float %5, float %6, float %8)
ret float %9
}

LLVM IR (-O2):
define float @flt_mul_sub(float %0, float %1) {
%3 = fneg float %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
ret float %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int implies(uint32_t a, uint32_t b) { return (a & b) == a; }


x86 assembly (clang, -O0):
<implies>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<implies>:
not    %esi
xor    %eax,%eax
test   %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @implies(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %5, %6
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @implies(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
void check_device(char *input_str) {
  FILE *file = popen("ls /dev/ttyUSB*", "r");
  fgets(input_str, 13, file);
  pclose(file);
}


x86 assembly (clang, -O0):
<check_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xd,%esi
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rdi
call   1030 <pclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_device>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0xd,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pclose@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"ls /dev/ttyUSB*\00"
@.str.1 = [2 x i8] c"r\00"
define void @check_device(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @popen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i8*, i8** %2
%6 = load i32*, i32** %3
%7 = call i32 @fgets(i8* %5, i32 13, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @pclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"ls /dev/ttyUSB*\00"
@.str.1 = [2 x i8] c"r\00"
define void @check_device(i8* %0) {
%2 = tail call i32* @popen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fgets(i8* %0, i32 13, i32* %2)
%4 = tail call i32 @pclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void notOK(const char *text, int result) {
  if (!result)
    printf("[OK] %s\n", text);
  else
    printf("[--] %s\n", text);
}


x86 assembly (clang, -O0):
<notOK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <notOK+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <notOK+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notOK>:
mov    %rdi,%rax
test   %esi,%esi
lea    0xee4(%rip),%rcx
lea    0xee6(%rip),%rdi
cmove  %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"[OK] %s\0A\00"
@.str.1 = [9 x i8] c"[--] %s\0A\00"
define void @notOK(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8* %0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int add(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv, char **envp) {
  printf("Hello, World!\n");
  int c = add(2, 2);
  printf("c is %d\n", c);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%esi
mov    %esi,%edi
call   1030 <add@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <add@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@.str.1 = [9 x i8] c"c is %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @add(i32 2, i32 2)
store i32 %10, i32* %8
%11 = load i32, i32* %8
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"c is %d\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @add(i32 2, i32 2)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
void g_hook_destroy_link() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_destroy_link() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void instruc() { system("less README.md;"); }


x86 assembly (clang, -O0):
<instruc>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"less README.md;\00"
define void @instruc() {
%1 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"less README.md;\00"
define void @instruc() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
int /*<<< orphan*/ b(int /*<<< orphan*/);
int c(int /*<<< orphan*/);
int main() {
  int i = c(b(a(1)));
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <a@plt>
mov    %eax,%edi
call   1030 <b@plt>
mov    %eax,%edi
call   1040 <c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <a@plt>
mov    %eax,%edi
call   1030 <b@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <c@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @a(i32 1)
%4 = call i32 @b(i32 %3)
%5 = call i32 @c(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a(i32 1)
%2 = tail call i32 @b(i32 %1)
%3 = tail call i32 @c(i32 %2)
ret i32 %3
}
int strdelete(char *s1, int pos) {
  char *s;
  for (s = s1 + pos; *s; s++)
    *s = *(s + 1);
  return 1;
}


x86 assembly (clang, -O0):
<strdelete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <strdelete+0x45>
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <strdelete+0x1a>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdelete>:
movslq %esi,%rax
cmpb   $0x0,(%rdi,%rax,1)
je     111e <strdelete+0x1e>
add    %rdi,%rax
add    $0x1,%rax
movzbl (%rax),%ecx
mov    %cl,-0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strdelete+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strdelete(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2, %7
%8 = phi i8* [ %9, %7 ], [ %4, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret i32 1
}