xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ blink();
int main(void) { blink(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @blink()
ret i32 0
}
int test_imm_E0int16_mem(short *val) {
  return ((*val) & (0xE0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E0int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xe0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E0int16_mem>:
testb  $0xe0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E0int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 224
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
#pragma pomp inst init
  printf("Hello from main.\n");
  foo();
  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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <foo@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>
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Hello from main.\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 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Hello from main.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char symbol;
  int number;
  scanf("%c", &symbol);
  number = 122 - (symbol - 97);
  printf("%c", number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%eax
mov    $0xdb,%esi
sub    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 97
%8 = sub nsw i32 122, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = sub nsw i32 219, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void gendsra32() {}


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

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

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

LLVM IR (-O2):
define void @gendsra32() {
ret void
}
__attribute__((always_)) int hausy_is_low_pulse(unsigned long pulse) {
  return (pulse <= ((unsigned long)300 + 200) &&
          pulse >= ((unsigned long)300 - 200));
}


x86 assembly (clang, -O0):
<hausy_is_low_pulse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x1f4,-0x8(%rbp)
mov    %al,-0x9(%rbp)
ja     1126 <hausy_is_low_pulse+0x26>
cmpq   $0x64,-0x8(%rbp)
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hausy_is_low_pulse>:
add    $0xffffffffffffff9c,%rdi
xor    %eax,%eax
cmp    $0x191,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @hausy_is_low_pulse(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 %3, 500
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp uge i64 %6, 100
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @hausy_is_low_pulse(i64 %0) {
%2 = add i64 %0, -100
%3 = icmp ult i64 %2, 401
%4 = zext i1 %3 to i32
ret i32 %4
}
void *dlopen() { return 0; }


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

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

LLVM IR (-O0):
define i8* @dlopen() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @dlopen() {
ret i8* null
}
int multipleBy3(int inputNum) {
  int result = inputNum % 3;
  if (result == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<multipleBy3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112b <multipleBy3+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1132 <multipleBy3+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multipleBy3>:
imul   $0xaaaaaaab,%edi,%ecx
add    $0x2aaaaaaa,%ecx
xor    %eax,%eax
cmp    $0x55555555,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @multipleBy3(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo428(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo428(i32 %0) {
ret void
}
char _q_x2c(char hex_up, char hex_low) {
  char digit;
  digit = 16 * (hex_up >= 'A' ? ((hex_up & 0xdf) - 'A') + 10 : hex_up - '0');
  digit += (hex_low >= 'A' ? ((hex_low & 0xdf) - 'A') + 10 : hex_low - '0');
  return digit;
}


x86 assembly (clang, -O0):
<_q_x2c>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1134 <_q_x2c+0x34>
movsbl -0x1(%rbp),%eax
and    $0xdf,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <_q_x2c+0x3e>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     116b <_q_x2c+0x6b>
movsbl -0x2(%rbp),%eax
and    $0xdf,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    1175 <_q_x2c+0x75>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
movsbl -0x3(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_q_x2c>:
mov    %esi,%eax
and    $0xdf,%al
add    $0xc9,%al
lea    -0x30(%rsi),%ecx
cmp    $0x41,%sil
movzbl %cl,%ecx
movzbl %al,%edx
cmovl  %ecx,%edx
mov    %edi,%eax
shl    $0x4,%al
lea    -0x70(%rax),%ecx
cmp    $0x41,%dil
movzbl %al,%esi
movzbl %cl,%eax
cmovl  %esi,%eax
add    %dl,%al
ret

LLVM IR (-O0):
define signext i8 @_q_x2c(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = and i32 %11, 223
%13 = sub nsw i32 %12, 65
%14 = add nsw i32 %13, 10
br label %19
15: ; preds = %2
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 48
br label %19
19: ; preds = %15, %9
%20 = phi i32 [ %14, %9 ], [ %18, %15 ]
%21 = mul nsw i32 16, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %5
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = icmp sge i32 %24, 65
br i1 %25, label %26, label %32
26: ; preds = %19
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = and i32 %28, 223
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
br label %36
32: ; preds = %19
%33 = load i8, i8* %4
%34 = sext i8 %33 to i32
%35 = sub nsw i32 %34, 48
br label %36
36: ; preds = %32, %26
%37 = phi i32 [ %31, %26 ], [ %35, %32 ]
%38 = load i8, i8* %5
%39 = sext i8 %38 to i32
%40 = add nsw i32 %39, %37
%41 = trunc i32 %40 to i8
store i8 %41, i8* %5
%42 = load i8, i8* %5
ret i8 %42
}

LLVM IR (-O2):
define signext i8 @_q_x2c(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, 64
%4 = icmp sgt i8 %1, 64
%5 = and i8 %1, -33
%6 = add i8 %5, -55
%7 = add i8 %1, -48
%8 = select i1 %4, i8 %6, i8 %7
%9 = shl i8 %0, 4
%10 = add i8 %9, -112
%11 = select i1 %3, i8 %10, i8 %9
%12 = add i8 %8, %11
ret i8 %12
}
int isdigit(int ch) { return ch >= '0' && ch <= '9'; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *prog) {
  printf("usage: %s ADDR VAL\n", prog);
  printf("\n");
  printf("ADDR and VAL may be specified as hex values\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"usage: %s ADDR VAL\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [45 x i8] c"ADDR and VAL may be specified as hex values\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"usage: %s ADDR VAL\0A\00"
@str = [44 x i8] c"ADDR and VAL may be specified as hex values\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p1(int *, int);
void p4(int *a, int b, int *c) {
  p1(c, b);
  *a = *a + b + *c;
}


x86 assembly (clang, -O0):
<p4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <p1@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p4>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1030 <p1@plt>
add    (%rbx),%ebp
add    (%r14),%ebp
mov    %ebp,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @p4(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %5
%9 = call i32 @p1(i32* %7, i32 %8)
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = add nsw i32 %13, %15
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @p4(i32* nocapture %0, i32 %1, i32* %2) {
%4 = tail call i32 @p1(i32* %2, i32 %1)
%5 = load i32, i32* %0
%6 = add nsw i32 %5, %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
store i32 %8, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void printusage() {
  fputs(
      "Usage: hsplit [OPTION]... [FILE]...\n"
      "Distribute lines of standard input evenly among FILE(s), such that "
      "identical\n"
      "lines end up in the same FILE.\n\n"
      "Lines in any particular output FILE will have the same order they did "
      "in the\n"
      "input.  hsplit does not add a final newline if the input lacks one.\n\n"
      "With no FILE(s), print the 32-bit unsigned integer hash code for each "
      "input\n"
      "line to standard output.\n\n"
      "  -h,  --help                display this help and exit\n"
      "  -a,  --append              append to FILE(s) rather than overwrite\n"
      "\n",
      stderr);
}


x86 assembly (clang, -O0):
<printusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printusage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [520 x i8] c"Usage: hsplit [OPTION]... [FILE]...\0ADistribute lines of standard input evenly among FILE(s), such that identical\0Alines end up in the same FILE.\0A\0ALines in any particular output FILE will have the same order they did in the\0Ainput. hsplit does not add a final newline if the input lacks one.\0A\0AWith no FILE(s), print the 32-bit unsigned integer hash code for each input\0Aline to standard output.\0A\0A -h, --help display this help and exit\0A -a, --append append to FILE(s) rather than overwrite\0A\0A\00"
@stderr = global i32 0
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([520 x i8], [520 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [520 x i8] c"Usage: hsplit [OPTION]... [FILE]...\0ADistribute lines of standard input evenly among FILE(s), such that identical\0Alines end up in the same FILE.\0A\0ALines in any particular output FILE will have the same order they did in the\0Ainput. hsplit does not add a final newline if the input lacks one.\0A\0AWith no FILE(s), print the 32-bit unsigned integer hash code for each input\0Aline to standard output.\0A\0A -h, --help display this help and exit\0A -a, --append append to FILE(s) rather than overwrite\0A\0A\00"
@stderr = global i32 0
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([520 x i8], [520 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, int);
int main(int argc, char **argv) {
  float f = 0.12372642183;
  int i = f;
  printf("%f %d\n", f, i);
  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)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x18(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%f %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float 0x3FBFAC88E0000000, i32 0)
ret i32 0
}
char *lower(char *str1) {
  while (*str1 != '\0') {
    if (*str1 < 91 && *str1 > 64) {
      *str1 = *str1 + 32;
    }
    str1++;
  }
  return str1;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <lower+0x5b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jge    114a <lower+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jle    114a <lower+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <lower+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
mov    %rdi,%rax
mov    (%rdi),%cl
jmp    1118 <lower+0x18>
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     112b <lower+0x2b>
lea    -0x41(%rcx),%edx
cmp    $0x19,%dl
ja     1110 <lower+0x10>
add    $0x20,%cl
mov    %cl,(%rax)
jmp    1110 <lower+0x10>
ret

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

LLVM IR (-O2):
define i8* @lower(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
%16 = phi i8* [ %0, %1 ], [ %12, %11 ]
ret i8* %16
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ lk_set_aled_state_(int, int);
void lk_set_aled(uint8_t number, uint8_t state) {
  switch (number) {
  case 0:
    number = 0x80;
    break;
  case 1:
    number = 0x10;
    break;
  case 2:
    number = 0x8;
    break;
  case 3:
    number = 0x4;
    break;
  default:
    return;
  };
  lk_set_aled_state_(number, state);
}


x86 assembly (clang, -O0):
<lk_set_aled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1173 <lk_set_aled+0x63>
mov    -0x10(%rbp),%rax
lea    0xec6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x80,-0x4(%rbp)
jmp    1178 <lk_set_aled+0x68>
movl   $0x10,-0x4(%rbp)
jmp    1178 <lk_set_aled+0x68>
movl   $0x8,-0x4(%rbp)
jmp    1178 <lk_set_aled+0x68>
movl   $0x4,-0x4(%rbp)
jmp    1178 <lk_set_aled+0x68>
jmp    1183 <lk_set_aled+0x73>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <lk_set_aled_state_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lk_set_aled>:
cmp    $0x3,%edi
ja     1127 <lk_set_aled+0x17>
movslq %edi,%rax
lea    0xee1(%rip),%rcx
mov    (%rcx,%rax,4),%edi
jmp    1030 <lk_set_aled_state_@plt>
ret

LLVM IR (-O0):
define void @lk_set_aled(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
switch i32 %5, label %10 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
i32 3, label %9
]
6: ; preds = %2
store i32 128, i32* %3
br label %11
7: ; preds = %2
store i32 16, i32* %3
br label %11
8: ; preds = %2
store i32 8, i32* %3
br label %11
9: ; preds = %2
store i32 4, i32* %3
br label %11
10: ; preds = %2
br label %15
11: ; preds = %9, %8, %7, %6
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @lk_set_aled_state_(i32 %12, i32 %13)
br label %15
15: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
@switch.table.lk_set_aled = [4 x i32] [i32 128, i32 16, i32 8, i32 4]
define void @lk_set_aled(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 4
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.lk_set_aled, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @lk_set_aled_state_(i32 %7, i32 %1)
br label %9
9: ; preds = %2, %4
ret void
}
/* Type definitions */
typedef long long int64_t;

/* Variables and functions */
int64_t return_int64_6() { return 4611686018427387903LL; }


x86 assembly (clang, -O0):
<return_int64_6>:
push   %rbp
mov    %rsp,%rbp
movabs $0x3fffffffffffffff,%rax
ff ff 3f
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_int64_6>:
movabs $0x3fffffffffffffff,%rax
ff ff 3f
ret

LLVM IR (-O0):
define i64 @return_int64_6() {
ret i64 4611686018427387903
}

LLVM IR (-O2):
define i64 @return_int64_6() {
ret i64 4611686018427387903
}
void cook_buf(void *fp) {
  int ch;
  for (; (ch = ((fp) ? 1 : 1));) {
    if ((fp ? 1 : 1))
      break;
  }
}


x86 assembly (clang, -O0):
<cook_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
cmp    $0x0,%rcx
cmovne %eax,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1157 <cook_buf+0x57>
cmpq   $0x0,-0x8(%rbp)
je     113e <cook_buf+0x3e>
mov    $0x1,%al
test   $0x1,%al
jne    114d <cook_buf+0x4d>
jmp    1152 <cook_buf+0x52>
mov    $0x1,%al
test   $0x1,%al
jne    114d <cook_buf+0x4d>
jmp    1152 <cook_buf+0x52>
jmp    1157 <cook_buf+0x57>
jmp    1108 <cook_buf+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cook_buf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
char *gettext(char *);
int /*<<< orphan*/ print_usage(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_error(void) {
  const char *program = "ypset";
  print_usage(stderr);
  fprintf(stderr,
          gettext("Try `%s --help' or `%s --usage' for more information.\n"),
          program, program);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <print_usage@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xea2(%rip),%rdi
call   1030 <gettext@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
call   1050 <print_usage@plt>
mov    (%rbx),%ebx
lea    0xebe(%rip),%rdi
call   1030 <gettext@plt>
lea    0xeac(%rip),%rcx
mov    %ebx,%edi
mov    %rax,%rsi
mov    %rcx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ypset\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Try `%s --help' or `%s --usage' for more information.\0A\00"
define void @print_error() {
%1 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @stderr
%3 = call i32 @print_usage(i32 %2)
%4 = load i32, i32* @stderr
%5 = call i8* @gettext(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = load i8*, i8** %1
%8 = call i32 @fprintf(i32 %4, i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ypset\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Try `%s --help' or `%s --usage' for more information.\0A\00"
define void @print_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @print_usage(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i8* @gettext(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @fprintf(i32 %3, i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *argv0, char *text) {
  printf("%s\n", text);
  printf("\n\nUsage:\n\n%s <number>\n\n", argv0);
  printf("allocates number pieces of memory of sizes 1..number");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [24 x i8] c"\0A\0AUsage:\0A\0A%s <number>\0A\0A\00"
@.str.2 = [53 x i8] c"allocates number pieces of memory of sizes 1..number\00"
define void @usage(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 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"\0A\0AUsage:\0A\0A%s <number>\0A\0A\00"
@.str.2 = [53 x i8] c"allocates number pieces of memory of sizes 1..number\00"
define void @usage(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) %1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
void modify(int *a, int *b) {
  *a = 11;
  *b = 5;
  return;
}


x86 assembly (clang, -O0):
<modify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xb,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<modify>:
movl   $0xb,(%rdi)
movl   $0x5,(%rsi)
ret

LLVM IR (-O0):
define void @modify(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
store i32 11, i32* %5
%6 = load i32*, i32** %4
store i32 5, i32* %6
ret void
}

LLVM IR (-O2):
define void @modify(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 11, i32* %0
store i32 5, i32* %1
ret void
}
void handle_WAITING(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_WAITING(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_printf(char *);
void system_interrupt_test() { io_printf("software interrupt test: passed\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"software interrupt test: passed\0A\00"
define void @system_interrupt_test() {
%1 = call i32 @io_printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"software interrupt test: passed\0A\00"
define void @system_interrupt_test() {
%1 = tail call i32 @io_printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
scalar_t__ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int close(int file) { return (int)syscall(6, (uint)file, 0, 0); }


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x6,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    %edi,%esi
mov    $0x6,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @syscall(i32 6, i32 %3, i32 0, i32 0)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i64 @syscall(i32 6, i32 %0, i32 0, i32 0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
size_t __VERIFIER_nondet_size_t() { return 0; }


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

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

LLVM IR (-O0):
define i64 @__VERIFIER_nondet_size_t() {
ret i64 0
}

LLVM IR (-O2):
define i64 @__VERIFIER_nondet_size_t() {
ret i64 0
}
int main(void) {
  struct {
    int x, y;
  } y;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type { i32, i32 }
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ atan(float);
float atanf(float x) { return (float)atan(x); }


x86 assembly (clang, -O0):
<atanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atan@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanf>:
push   %rax
call   1030 <atan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @atan(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @atanf(float %0) {
%2 = tail call i64 @atan(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
char *strstr(char *, char *);
int strStartsWith(char *str, char *key) { return strstr(str, key) == str; }


x86 assembly (clang, -O0):
<strStartsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strStartsWith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strStartsWith(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 = load i8*, i8** %4
%7 = call i8* @strstr(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = icmp eq i8* %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @strStartsWith(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
int fileExist(char *filename) {
  struct stat buf;
  int i = stat(filename, &buf);
  if (i == 0)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<fileExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1142 <fileExist+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <fileExist+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fileExist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
FILE *open_master(void) {
  FILE *master = fopen("platform_headers/master.h", "w");
  if (master == NULL) {
    fprintf(stderr, "ERROR: unable to open file platform_headers/master.h\n");
    exit(-2);
  }
  return master;
}


x86 assembly (clang, -O0):
<open_master>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1179 <open_master+0x49>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_master>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     114b <open_master+0x1b>
pop    %rcx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"platform_headers/master.h\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.2 = [54 x i8] c"ERROR: unable to open file platform_headers/master.h\0A\00"
define i32* @open_master() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @exit(i32 -2)
unreachable
9: ; preds = %0
%10 = load i32*, i32** %1
ret i32* %10
}

LLVM IR (-O2):
@.str = [26 x i8] c"platform_headers/master.h\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.2 = [54 x i8] c"ERROR: unable to open file platform_headers/master.h\0A\00"
define noalias i32* @open_master() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -2)
unreachable
7: ; preds = %0
ret i32* %1
}
int func() { return 1; }


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

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

LLVM IR (-O0):
define i32 @func() {
ret i32 1
}

LLVM IR (-O2):
define i32 @func() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
float func_float(float f1, float f2) {
  printf("%f %f\n", f1, f2);
  return f1;
}


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

x86 assembly (clang, -O2):
<func_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%f %f\0A\00"
define float @func_float(float returned %0, float %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %0, float %1)
ret float %0
}
void enable_signal() {}


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

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

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

LLVM IR (-O2):
define void @enable_signal() {
ret void
}
void __attribute__((weak)) can2_tx_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<can2_tx_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<can2_tx_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.can2_tx_isr = [12 x i8] c"can2_tx_isr\00"
define weak void @can2_tx_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.can2_tx_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.can2_tx_isr = [12 x i8] c"can2_tx_isr\00"
define weak void @can2_tx_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.can2_tx_isr, i64 0, i64 0))
ret void
}
int g(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 4
}

LLVM IR (-O2):
define i32 @g() {
ret i32 4
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long timestop(unsigned long start) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_usec / 1000) + (tv.tv_sec * 1000) - start;
}


x86 assembly (clang, -O0):
<timestop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,-0xc(%rbp),%ecx
add    %ecx,%eax
cltq
sub    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestop>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
movslq 0xc(%rsp),%rcx
imul   $0x3e8,%rcx,%rcx
cltq
add    %rcx,%rax
sub    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @timestop(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timeval
store i64 %0, i64* %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = add nsw i32 %7, %10
%12 = sext i32 %11 to i64
%13 = load i64, i64* %2
%14 = sub i64 %12, %13
ret i64 %14
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @timestop(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = add nsw i32 %10, %7
%12 = sext i32 %11 to i64
%13 = sub i64 %12, %0
ret i64 %13
}
int judge10(int *toInt, int a, int b, int c) {
  return (toInt[a] + toInt[b] + toInt[c]) % 10 == 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<judge10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<judge10>:
movslq %esi,%rax
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%edx
add    (%rdi,%rax,4),%edx
movslq %ecx,%rax
add    (%rdi,%rax,4),%edx
imul   $0xcccccccd,%edx,%ecx
add    $0x19999998,%ecx
ror    %ecx
xor    %eax,%eax
cmp    $0x19999999,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @judge10(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %7
%12 = sext i32 %3 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = add nsw i32 %11, %14
%16 = srem i32 %15, 10
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
ret i32 %18
}