xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ write(int, char *, int);
void handle_signal(int sig) {
  write(1, "Caught signal SIGINT\n", 21);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec9(%rip),%rsi
mov    $0x15,%edx
call   1030 <write@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_signal>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x15,%edx
call   1030 <write@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Caught signal SIGINT\0A\00"
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 21)
%4 = call i32 @pthread_exit(i32* null)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Caught signal SIGINT\0A\00"
define void @handle_signal(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 21)
%3 = tail call i32 @pthread_exit(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test29_AvrPin_set__E();
void test29_Led_on__E() { test29_AvrPin_set__E(); }


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

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

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

LLVM IR (-O2):
define void @test29_Led_on__E() {
%1 = tail call i32 (...) @test29_AvrPin_set__E()
ret void
}
int append(char to[], char from[], int last) {
  for (int i = 0; (to[last] = from[i]) != '\0'; ++i, ++last)
    ;
  return last;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1154 <append+0x54>
jmp    113d <append+0x3d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <append+0x16>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
mov    %edx,%eax
mov    (%rsi),%dl
movslq %eax,%rcx
mov    %dl,(%rdi,%rcx,1)
test   %dl,%dl
je     1132 <append+0x32>
add    %rcx,%rdi
add    $0x1,%rdi
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
mov    %cl,(%rdi,%rdx,1)
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <append+0x20>
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @append(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = load i8, i8* %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %4, i8* %6
%7 = icmp eq i8 %4, 0
br i1 %7, label %10, label %12
8: ; preds = %12
%9 = trunc i64 %16 to i32
br label %10
10: ; preds = %8, %3
%11 = phi i32 [ %2, %3 ], [ %9, %8 ]
ret i32 %11
12: ; preds = %3, %12
%13 = phi i64 [ %16, %12 ], [ %5, %3 ]
%14 = phi i64 [ %15, %12 ], [ 0, %3 ]
%15 = add nuw nsw i64 %14, 1
%16 = add i64 %13, 1
%17 = getelementptr inbounds i8, i8* %1, i64 %15
%18 = load i8, i8* %17
%19 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 %18, i8* %19
%20 = icmp eq i8 %18, 0
br i1 %20, label %8, label %12
}
int main() {
  struct T {
    int x;
  };
  {
    struct T s;
    s.x = 0;
    return s.x;
  }
}


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

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

LLVM IR (-O0):
%struct.T = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.T
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.T, %struct.T* %2, i32 0, i32 0
store i32 0, i32* %3
%4 = getelementptr inbounds %struct.T, %struct.T* %2, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void main(void) {
  while (1U) {
    ;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <main+0x9>
jmp    1109 <main+0x9>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int isInteger(const char *z) {
  while (z[0] >= '0' && z[0] <= '9')
    z++;
  return z[0] == 0;
}


x86 assembly (clang, -O0):
<isInteger>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     112d <isInteger+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <isInteger+0x3d>
jmp    114e <isInteger+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <isInteger+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInteger>:
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%eax
add    $0x1,%rdi
cmp    $0xa,%al
jb     1100 <isInteger>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isInteger(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = icmp eq i8 %4, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
void XtCvtStringToBool() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtStringToBool() {
ret void
}
/* Variables and functions */
int count_arg(char const *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ simple_printf(char const *, int, int, int);
int main() {
  const char *format = "test %d %d %d\n";
  printf("%d\n", count_arg(format));
  simple_printf(format, 23, 34567809, -546);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <count_arg@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x17,%esi
mov    $0x20f7681,%edx
mov    $0xfffffdde,%ecx
call   1030 <simple_printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1050 <count_arg@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
mov    $0x20f7681,%edx
mov    $0xfffffdde,%ecx
call   1030 <simple_printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"test %d %d %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @count_arg(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %1
%6 = call i32 @simple_printf(i8* %5, i32 23, i32 34567809, i32 -546)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"test %d %d %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @count_arg(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @simple_printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 23, i32 34567809, i32 -546)
ret i32 0
}
int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.uniphier_board_data = type opaque
define i32 @uniphier_pxs2_sbc_init(%struct.uniphier_board_data* nocapture readnone %0) {
ret i32 0
}
int LIBXSMM_INTRINSICS_BITSCANFWD64_SW(unsigned long long n) {
  unsigned int i, r = 0;
  if (0 != n)
    for (i = 1; 0 == (n & i); i <<= 1) {
      ++r;
    }
  return r;
}


x86 assembly (clang, -O0):
<LIBXSMM_INTRINSICS_BITSCANFWD64_SW>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1153 <LIBXSMM_INTRINSICS_BITSCANFWD64_SW+0x53>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
and    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    114e <LIBXSMM_INTRINSICS_BITSCANFWD64_SW+0x4e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <LIBXSMM_INTRINSICS_BITSCANFWD64_SW+0x22>
jmp    1153 <LIBXSMM_INTRINSICS_BITSCANFWD64_SW+0x53>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LIBXSMM_INTRINSICS_BITSCANFWD64_SW>:
xor    %eax,%eax
test   %rdi,%rdi
je     1129 <LIBXSMM_INTRINSICS_BITSCANFWD64_SW+0x29>
mov    %edi,%ecx
and    $0x1,%ecx
test   %rcx,%rcx
jne    1129 <LIBXSMM_INTRINSICS_BITSCANFWD64_SW+0x29>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
add    %ecx,%ecx
test   %edi,%ecx
je     1120 <LIBXSMM_INTRINSICS_BITSCANFWD64_SW+0x20>
ret

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

LLVM IR (-O2):
define i32 @LIBXSMM_INTRINSICS_BITSCANFWD64_SW(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = and i64 %0, 1
%4 = icmp eq i64 %3, 0
%5 = and i1 %2, %4
br i1 %5, label %6, label %14
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = phi i32 [ %10, %6 ], [ 1, %1 ]
%9 = add i32 %7, 1
%10 = shl i32 %8, 1
%11 = zext i32 %10 to i64
%12 = and i64 %11, %0
%13 = icmp eq i64 %12, 0
br i1 %13, label %6, label %14
14: ; preds = %6, %1
%15 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %15
}
void draws_(x, y, z) short *x, *y, *z;
{ draw((float)*x, (float)*y, (float)*z); }


x86 assembly (clang, -O0):
<draws_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <draw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draws_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
movswl (%rdx),%eax
cvtsi2sd %eax,%xmm2
mov    $0x3,%al
jmp    1030 <draw@plt>

LLVM IR (-O0):
define void @draws_(i16* %0, i16* %1, i16* %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16*
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = sitofp i16 %8 to float
%10 = fpext float %9 to double
%11 = load i16*, i16** %5
%12 = load i16, i16* %11
%13 = sitofp i16 %12 to float
%14 = fpext float %13 to double
%15 = load i16*, i16** %6
%16 = load i16, i16* %15
%17 = sitofp i16 %16 to float
%18 = fpext float %17 to double
%19 = call i32 (double, double, double, ...) bitcast (i32 (...)* @draw to i32 (double, double, double, ...)*)(double %10, double %14, double %18)
ret void
}

LLVM IR (-O2):
define void @draws_(i16* nocapture %0, i16* nocapture %1, i16* nocapture %2) {
%4 = load i16, i16* %0
%5 = sitofp i16 %4 to double
%6 = load i16, i16* %1
%7 = sitofp i16 %6 to double
%8 = load i16, i16* %2
%9 = sitofp i16 %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @draw to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_resolve();
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *resolver_thread_root(void *threadid) {
  do_resolve();
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<resolver_thread_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <do_resolve@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolver_thread_root>:
push   %rax
xor    %eax,%eax
call   1040 <do_resolve@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @resolver_thread_root(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @do_resolve()
%5 = call i32 @pthread_exit(i32* null)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @resolver_thread_root(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @do_resolve()
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
double sla_airmas_(double *);
double slaAirmas(double zd) { return sla_airmas_(&zd); }


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

x86 assembly (clang, -O2):
<slaAirmas>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sla_airmas_@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @slaAirmas(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @sla_airmas_(double* %2)
ret double %3
}

LLVM IR (-O2):
define double @slaAirmas(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @sla_airmas_(double* %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, int);
int /*<<< orphan*/ use_stuff(int);
void h(int z, int a) {
  use_stuff(z);
  f(a, 9, 10);
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <use_stuff@plt>
mov    -0x8(%rbp),%edi
mov    $0x9,%esi
mov    $0xa,%edx
call   1040 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbx
mov    %esi,%ebx
call   1030 <use_stuff@plt>
mov    %ebx,%edi
mov    $0x9,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1040 <f@plt>

LLVM IR (-O0):
define void @h(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 = call i32 @use_stuff(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @f(i32 %7, i32 9, i32 10)
ret void
}

LLVM IR (-O2):
define void @h(i32 %0, i32 %1) {
%3 = tail call i32 @use_stuff(i32 %0)
%4 = tail call i32 @f(i32 %1, i32 9, i32 10)
ret void
}
/* Variables and functions */
char const *Last_errormsg_get();
const char *out_get_errormsg(void) { return Last_errormsg_get(); }


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

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

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

LLVM IR (-O2):
define i8* @out_get_errormsg() {
%1 = tail call i8* (...) @Last_errormsg_get()
ret i8* %1
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ my_free(int *);
int main() {
  int *p = malloc(sizeof(int));
  *p = 2;
  my_free(p);
  *p = 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <my_free@plt>
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movl   $0x2,(%rax)
mov    %rax,%rdi
call   1040 <my_free@plt>
movl   $0x3,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
store i32 2, i32* %1
%2 = tail call i32 @my_free(i32* %1)
store i32 3, i32* %1
ret i32 0
}
/* Variables and functions */
void *calloc(unsigned long, int);
int /*<<< orphan*/ runtime_error(char *);
void *mem_calloc(unsigned long size) {
  void *ptr = calloc(size, 1);
  if (!ptr) {
    runtime_error("out of memory");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<mem_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <mem_calloc+0x35>
lea    0xeb0(%rip),%rdi
call   1040 <runtime_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_calloc>:
push   %rbx
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <mem_calloc+0x1f>
lea    0xec6(%rip),%rdi
call   1040 <runtime_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @mem_calloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i64 %4, i32 1)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @runtime_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @mem_calloc(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @runtime_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
unsigned long int __strcspn_c1(const char *__s, signed int __reject) {
  unsigned long int __result = (unsigned long int)0;
  while (!((signed int)__s[(signed long int)__result] == 0)) {
    if ((signed int)__s[(signed long int)__result] == __reject)
      goto __CPROVER_DUMP_L2;
    __result = __result + 1ul;
    __result;
  }
__CPROVER_DUMP_L2:;
  return __result;
}


x86 assembly (clang, -O0):
<__strcspn_c1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1134 <__strcspn_c1+0x34>
jmp    115f <__strcspn_c1+0x5f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0xc(%rbp),%eax
jne    114e <__strcspn_c1+0x4e>
jmp    1164 <__strcspn_c1+0x64>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <__strcspn_c1+0x13>
jmp    1164 <__strcspn_c1+0x64>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strcspn_c1>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1121 <__strcspn_c1+0x21>
cmp    %esi,%ecx
jne    1110 <__strcspn_c1+0x10>
ret

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

LLVM IR (-O2):
define i64 @__strcspn_c1(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %11, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
%10 = or i1 %7, %9
%11 = add i64 %4, 1
br i1 %10, label %12, label %3
12: ; preds = %3
ret i64 %4
}
const char *ssdp_probe_message_create(void) {
  return "M-SEARCH * HTTP/1.1\r\n"
         "Host:239.255.255.250:1900\r\n"
         "ST:ssdp:all\r\n"
         "Man:\"ssdp:discover\"\r\n"
         "MX:5\r\n\r\n";
}


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

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

LLVM IR (-O0):
@.str = [91 x i8] c"M-SEARCH * HTTP/1.1\0D\0AHost:239.255.255.250:1900\0D\0AST:ssdp:all\0D\0AMan:\22ssdp:discover\22\0D\0AMX:5\0D\0A\0D\0A\00"
define i8* @ssdp_probe_message_create() {
ret i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [91 x i8] c"M-SEARCH * HTTP/1.1\0D\0AHost:239.255.255.250:1900\0D\0AST:ssdp:all\0D\0AMan:\22ssdp:discover\22\0D\0AMX:5\0D\0A\0D\0A\00"
define i8* @ssdp_probe_message_create() {
ret i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0)
}
long pty_init() { return (0L); }


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

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

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

LLVM IR (-O2):
define i64 @pty_init() {
ret i64 0
}
double judge(char s, double x) {
  switch (s) {
  case 'm':
    return x / 1000;
  case 'k':
    return x * 1000;
  case 'M':
    return x * 1000000;
  default:
    return x;
  }
}


x86 assembly (clang, -O0):
<judge>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x4d,%eax
je     1178 <judge+0x78>
jmp    1124 <judge+0x24>
mov    -0x1c(%rbp),%eax
sub    $0x6b,%eax
je     1161 <judge+0x61>
jmp    1135 <judge+0x35>
mov    -0x1c(%rbp),%eax
sub    $0x6d,%eax
jne    118f <judge+0x8f>
jmp    1146 <judge+0x46>
movsd  -0x18(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1199 <judge+0x99>
movsd  0xe9f(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1199 <judge+0x99>
movsd  0xe80(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1199 <judge+0x99>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<judge>:
cmp    $0x4d,%edi
je     1118 <judge+0x18>
cmp    $0x6b,%edi
je     1121 <judge+0x21>
cmp    $0x6d,%edi
jne    1120 <judge+0x20>
divsd  0xef1(%rip),%xmm0
ret
mulsd  0xee0(%rip),%xmm0
ret
mulsd  0xedf(%rip),%xmm0
ret

LLVM IR (-O0):
define double @judge(i8 signext %0, double %1) {
%3 = alloca double
%4 = alloca i8
%5 = alloca double
store i8 %0, i8* %4
store double %1, double* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
switch i32 %7, label %17 [
i32 109, label %8
i32 107, label %11
i32 77, label %14
]
8: ; preds = %2
%9 = load double, double* %5
%10 = fdiv double %9, 1.000000e+03
store double %10, double* %3
br label %19
11: ; preds = %2
%12 = load double, double* %5
%13 = fmul double %12, 1.000000e+03
store double %13, double* %3
br label %19
14: ; preds = %2
%15 = load double, double* %5
%16 = fmul double %15, 1.000000e+06
store double %16, double* %3
br label %19
17: ; preds = %2
%18 = load double, double* %5
store double %18, double* %3
br label %19
19: ; preds = %17, %14, %11, %8
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @judge(i8 signext %0, double %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %10 [
i32 109, label %4
i32 107, label %6
i32 77, label %8
]
4: ; preds = %2
%5 = fdiv double %1, 1.000000e+03
br label %10
6: ; preds = %2
%7 = fmul double %1, 1.000000e+03
br label %10
8: ; preds = %2
%9 = fmul double %1, 1.000000e+06
br label %10
10: ; preds = %2, %8, %6, %4
%11 = phi double [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ %1, %2 ]
ret double %11
}
/* Type definitions */
struct timeval {
  long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void rr_dt_now(long *sec, long *ms) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  *sec = tv.tv_sec;
  *ms = tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<rr_dt_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define void @rr_dt_now(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
store i64 %11, i64* %1
ret void
}
/* Variables and functions */
unsigned int msb(int);
int max(int a, int b) {
  unsigned int m = msb(a ^ b);
  return ((m & a) | (m & b));
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    -0x8(%rbp),%edi
call   1030 <msb@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
xor    %ebp,%edi
call   1030 <msb@plt>
or     %ebp,%ebx
and    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = call i32 @msb(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = and i32 %10, %11
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = and i32 %13, %14
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = tail call i32 @msb(i32 %3)
%5 = or i32 %1, %0
%6 = and i32 %4, %5
ret i32 %6
}
int do_325() { return 325; }


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

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

LLVM IR (-O0):
define i32 @do_325() {
ret i32 325
}

LLVM IR (-O2):
define i32 @do_325() {
ret i32 325
}
/* Variables and functions */
void *mmt_load_data_with_prefix(int, int /*<<< orphan*/, int);
void *mmt_load_initial_data() { return mmt_load_data_with_prefix(1, 0, 1); }


x86 assembly (clang, -O0):
<mmt_load_initial_data>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
xor    %esi,%esi
mov    %edx,%edi
call   1030 <mmt_load_data_with_prefix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmt_load_initial_data>:
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <mmt_load_data_with_prefix@plt>

LLVM IR (-O0):
define i8* @mmt_load_initial_data() {
%1 = call i8* @mmt_load_data_with_prefix(i32 1, i32 0, i32 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @mmt_load_initial_data() {
%1 = tail call i8* @mmt_load_data_with_prefix(i32 1, i32 0, i32 1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Programming in C is fun!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Programming in C is fun!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Programming in C is fun!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
long long zszz() { return 0x0000ffff00000000LL; }


x86 assembly (clang, -O0):
<zszz>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff00000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zszz>:
movabs $0xffff00000000,%rax
ret

LLVM IR (-O0):
define i64 @zszz() {
ret i64 281470681743360
}

LLVM IR (-O2):
define i64 @zszz() {
ret i64 281470681743360
}
/* Type definitions */
struct cpufreq_policy {
  int dummy;
};

/* Variables and functions */
int ENOSYS;
int proc_set_policy(unsigned int cpu, struct cpufreq_policy *policy) {
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<proc_set_policy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ed4(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_set_policy>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.cpufreq_policy = type { i32 }
@ENOSYS = global i32 0
define i32 @proc_set_policy(i32 %0, %struct.cpufreq_policy* %1) {
%3 = alloca i32
%4 = alloca %struct.cpufreq_policy*
store i32 %0, i32* %3
store %struct.cpufreq_policy* %1, %struct.cpufreq_policy** %4
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.cpufreq_policy = type { i32 }
@ENOSYS = global i32 0
define i32 @proc_set_policy(i32 %0, %struct.cpufreq_policy* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int stricmp(char *, char *);
int scmp(const void *e1, const void *e2) {
  char *s1 = *((char **)e1);
  char *s2 = *((char **)e2);
  return stricmp(s1, s2);
}


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

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

LLVM IR (-O0):
define i32 @scmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @stricmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @scmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @stricmp(i8* %4, i8* %6)
ret i32 %7
}
int ft_btw(int a, int b, int c) { return (a >= b && a <= c); }


x86 assembly (clang, -O0):
<ft_btw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112a <ft_btw+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_btw>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_btw(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void l1_cache_detect(void) {}


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

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

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

LLVM IR (-O2):
define void @l1_cache_detect() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
unsigned char _mm_aesdec128kl_u8(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 void const *);
unsigned char test_mm_aesdec128kl_u8(__m128i *odata, __m128i idata,
                                     const void *h) {
  return _mm_aesdec128kl_u8(odata, idata, h);
}


x86 assembly (clang, -O0):
<test_mm_aesdec128kl_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <_mm_aesdec128kl_u8@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_aesdec128kl_u8>:
jmp    1030 <_mm_aesdec128kl_u8@plt>

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

LLVM IR (-O2):
define zeroext i8 @test_mm_aesdec128kl_u8(i32* %0, i32 %1, i8* %2) {
%4 = tail call zeroext i8 @_mm_aesdec128kl_u8(i32* %0, i32 %1, i8* %2)
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_subcompositor {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_get_version(struct wl_proxy *);
uint32_t
wl_subcompositor_get_version(struct wl_subcompositor *wl_subcompositor) {
  return wl_proxy_get_version((struct wl_proxy *)wl_subcompositor);
}


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

x86 assembly (clang, -O2):
<wl_subcompositor_get_version>:
jmp    1030 <wl_proxy_get_version@plt>

LLVM IR (-O0):
%struct.wl_subcompositor = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_subcompositor_get_version(%struct.wl_subcompositor* %0) {
%2 = alloca %struct.wl_subcompositor*
store %struct.wl_subcompositor* %0, %struct.wl_subcompositor** %2
%3 = load %struct.wl_subcompositor*, %struct.wl_subcompositor** %2
%4 = bitcast %struct.wl_subcompositor* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_get_version(%struct.wl_proxy* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.wl_subcompositor = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_subcompositor_get_version(%struct.wl_subcompositor* %0) {
%2 = bitcast %struct.wl_subcompositor* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_get_version(%struct.wl_proxy* %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
__m128i test_mm_slli_epi32(__m128i A) { return _mm_slli_epi32(A, 1); }


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

x86 assembly (clang, -O2):
<test_mm_slli_epi32>:
mov    $0x1,%esi
jmp    1030 <_mm_slli_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_slli_epi32(i32 %0) {
%2 = tail call i32 @_mm_slli_epi32(i32 %0, i32 1)
ret i32 %2
}
int abs(x)
int x;
{
  if (x < 0)
    return -x;
  else
    return x;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
const char *scamper_do_tracelb_usage(void) {
  return "tracelb [-c confidence] [-d dport] [-f firsthop] [-g gaplimit]\n"
         "        [-P method] [-q attempts] [-Q maxprobec] [-s sport]\n"
         "        [-t tos] [-U userid] [-w wait-timeout] [-W wait-probe]";
}


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

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

LLVM IR (-O0):
@.str = [186 x i8] c"tracelb [-c confidence] [-d dport] [-f firsthop] [-g gaplimit]\0A [-P method] [-q attempts] [-Q maxprobec] [-s sport]\0A [-t tos] [-U userid] [-w wait-timeout] [-W wait-probe]\00"
define i8* @scamper_do_tracelb_usage() {
ret i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [186 x i8] c"tracelb [-c confidence] [-d dport] [-f firsthop] [-g gaplimit]\0A [-P method] [-q attempts] [-Q maxprobec] [-s sport]\0A [-t tos] [-U userid] [-w wait-timeout] [-W wait-probe]\00"
define i8* @scamper_do_tracelb_usage() {
ret i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str, i64 0, i64 0)
}
unsigned long ossAlignX(unsigned long i, unsigned long X) {
  return ((i + (X - 1)) & ~(unsigned long)(X - 1));
}


x86 assembly (clang, -O0):
<ossAlignX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ossAlignX>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @ossAlignX(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
%8 = add i64 %5, %7
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @ossAlignX(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void copy_shellcode(char *dest, char *src) { memcpy(dest, src, 1); }


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

x86 assembly (clang, -O2):
<copy_shellcode>:
mov    $0x1,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy_shellcode(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 i32 @memcpy(i8* %5, i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @copy_shellcode(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_u16(int /*<<< orphan*/);
int /*<<< orphan*/ plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_u2_s(void) { plcvm_push(plcvm_get_u16(plcvm_pop())); }


x86 assembly (clang, -O0):
<cb_ldm_u2_s>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <plcvm_pop@plt>
mov    %eax,%edi
call   1030 <plcvm_get_u16@plt>
mov    %eax,%edi
call   1050 <plcvm_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_u2_s>:
push   %rax
xor    %eax,%eax
call   1040 <plcvm_pop@plt>
mov    %eax,%edi
call   1030 <plcvm_get_u16@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_u2_s() {
%1 = call i32 (...) @plcvm_pop()
%2 = call i32 @plcvm_get_u16(i32 %1)
%3 = call i32 @plcvm_push(i32 %2)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_u2_s() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = tail call i32 @plcvm_get_u16(i32 %1)
%3 = tail call i32 @plcvm_push(i32 %2)
ret void
}
/* Variables and functions */
int fun();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int ret = 0;
  long nr_of_reductions;
  ret = fun();
  printf("RETURNED %d\n", ret);
  if (ret != 569) {
    return 1;
  } else {
    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)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <fun@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x239,-0x14(%rbp)
je     116f <main+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <main+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <fun@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
cmp    $0x239,%ebx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"RETURNED %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fun()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp ne i32 %3, 569
%6 = zext i1 %5 to i32
ret i32 %6
}
void _exit(int status) {
  while (1) {
    ;
  }
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}