xunge/DecIR huggingface dataset:
int fn(char s1[], char s2[], int a) {
  int x, i;
  for (i = 0; i < a; i++) {
    if (s1[i] == s2[i])
      x = 1;
    else
      x = 0;
    if (x == 0)
      break;
  }
  return x;
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1177 <fn+0x77>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114e <fn+0x4e>
movl   $0x1,-0x18(%rbp)
jmp    1155 <fn+0x55>
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1164 <fn+0x64>
jmp    1177 <fn+0x77>
jmp    1169 <fn+0x69>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1116 <fn+0x16>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
mov    $0x1,%eax
test   %edx,%edx
jle    1122 <fn+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <fn+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <fn+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fn(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %7, %9, %3
%18 = phi i32 [ 1, %3 ], [ 0, %9 ], [ 1, %7 ]
ret i32 %18
}
void serializer_write_char(char *dest, int *pointer, char value) {
  dest[(*pointer)] = value;
  (*pointer) += 1;
}


x86 assembly (clang, -O0):
<serializer_write_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<serializer_write_char>:
movslq (%rsi),%rax
mov    %dl,(%rdi,%rax,1)
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @serializer_write_char(i8* %0, i32* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 %7, i8* %12
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @serializer_write_char(i8* nocapture writeonly %0, i32* nocapture %1, i8 signext %2) {
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %2, i8* %6
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
ret void
}
/* Variables and functions */
scalar_t__ wMalloc(int);
scalar_t__ wPopNumber();
int /*<<< orphan*/ wPushString(char *);
void wBasChr() {
  char *buffer = (char *)wMalloc(sizeof(char) * 2);
  buffer[0] = (char)wPopNumber();
  buffer[1] = '\0';
  wPushString(buffer);
}


x86 assembly (clang, -O0):
<wBasChr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <wMalloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <wPopNumber@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rdi
call   1050 <wPushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasChr>:
push   %rbx
mov    $0x2,%edi
call   1040 <wMalloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <wPopNumber@plt>
mov    %al,(%rbx)
movb   $0x0,0x1(%rbx)
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <wPushString@plt>

LLVM IR (-O0):
define void @wBasChr() {
%1 = alloca i8*
%2 = call i64 @wMalloc(i32 2)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = call i64 (...) @wPopNumber()
%5 = trunc i64 %4 to i8
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 %5, i8* %7
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %9
%10 = load i8*, i8** %1
%11 = call i32 @wPushString(i8* %10)
ret void
}

LLVM IR (-O2):
define void @wBasChr() {
%1 = tail call i64 @wMalloc(i32 2)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 (...) @wPopNumber()
%4 = trunc i64 %3 to i8
store i8 %4, i8* %2
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %5
%6 = tail call i32 @wPushString(i8* %2)
ret void
}
int semi_open(char const *filename, int mode) {
  struct {
    char const *filename;
    int mode;
    int filename_length;
  } args;
  args.filename = filename;
  args.mode = mode;
  args.filename_length = strlen(filename);
  return __semi_call(1, &args);
}


x86 assembly (clang, -O0):
<semi_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <__semi_call@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semi_open>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %esi,0x10(%rsp)
call   1030 <strlen@plt>
mov    %eax,0x14(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <__semi_call@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32, i32 }
define i32 @semi_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.anon
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 0
store i8* %6, i8** %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 1
store i32 %8, i32* %9
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 2
store i32 %12, i32* %13
%14 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @__semi_call to i32 (i32, %struct.anon*, ...)*)(i32 1, %struct.anon* %5)
ret i32 %14
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32, i32 }
define i32 @semi_open(i8* %0, i32 %1) {
%3 = alloca %struct.anon
%4 = bitcast %struct.anon* %3 to i8*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 0
store i8* %0, i8** %5
%6 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 2
store i32 %8, i32* %9
%10 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @__semi_call to i32 (i32, %struct.anon*, ...)*)(i32 1, %struct.anon* %3)
ret i32 %10
}
/* Variables and functions */
int get_sign(float);
int get_s(float f) {
  if (get_sign(f) == 0x80000000)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<get_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <get_sign@plt>
cmp    $0x80000000,%eax
jne    113e <get_s+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <get_s+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_s>:
push   %rax
call   1030 <get_sign@plt>
xor    %ecx,%ecx
cmp    $0x80000000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_s(float %0) {
%2 = tail call i32 @get_sign(float %0)
%3 = icmp eq i32 %2, -2147483648
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, char *argv[]) {
  int c;
  c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
  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)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%eax
je     1169 <main+0x49>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
int test_imm_64uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x64 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_64uint64_highword_reg>:
movabs $0x6400000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_64uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 429496729600
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float min(float x, float y) {
  if (x > y)
    return y;
  else
    return x;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <min+0x2c>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <min+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %5
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %4
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ test(double, int);
int main() {
  test(7.3, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
mov    $0x2,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(double 7.300000e+00, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(double 7.300000e+00, i32 2)
ret i32 0
}
/* Variables and functions */
double fmod(int, int);
double libb_func() { return fmod(5, 2) + 39.0; }


x86 assembly (clang, -O0):
<libb_func>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <fmod@plt>
movsd  0xed5(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<libb_func>:
push   %rax
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <fmod@plt>
addsd  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @libb_func() {
%1 = call double @fmod(i32 5, i32 2)
%2 = fadd double %1, 3.900000e+01
ret double %2
}

LLVM IR (-O2):
define double @libb_func() {
%1 = tail call double @fmod(i32 5, i32 2)
%2 = fadd double %1, 3.900000e+01
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("modify obj to use 32bit OMF\n"
       "fixu32 [-u] [-c] [-padding16] [-padding32] [-v] objfile "
       "[output_objfile]\n"
       "   -u   	Update objfile\n"
       "   -c   	validate Checksum\n"
       "   -padding16	force segment length aligned by 16bytes\n"
       "   -padding32	                     aligned by 32bytes\n"
       "   -v   	Verbose mode\n");
}


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

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

LLVM IR (-O0):
@.str = [283 x i8] c"modify obj to use 32bit OMF\0Afixu32 [-u] [-c] [-padding16] [-padding32] [-v] objfile [output_objfile]\0A -u \09Update objfile\0A -c \09validate Checksum\0A -padding16\09force segment length aligned by 16bytes\0A -padding32\09 aligned by 32bytes\0A -v \09Verbose mode\0A\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([283 x i8], [283 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [283 x i8] c"modify obj to use 32bit OMF\0Afixu32 [-u] [-c] [-padding16] [-padding32] [-v] objfile [output_objfile]\0A -u \09Update objfile\0A -c \09validate Checksum\0A -padding16\09force segment length aligned by 16bytes\0A -padding32\09 aligned by 32bytes\0A -v \09Verbose mode\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([283 x i8], [283 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double __ieee754_pow(double, double);
double jpow(double x, double y) { return __ieee754_pow(x, y); }


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

x86 assembly (clang, -O2):
<jpow>:
jmp    1030 <__ieee754_pow@plt>

LLVM IR (-O0):
define double @jpow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__ieee754_pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @jpow(double %0, double %1) {
%3 = tail call double @__ieee754_pow(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ softirq_exit_process(char const *, int, double, int, void *);
void irq_softirq_exit_process(const char *modname, int pass, double clock,
                              int cpu, void *args) {
  softirq_exit_process(modname, pass, clock, cpu, args);
}


x86 assembly (clang, -O0):
<irq_softirq_exit_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <softirq_exit_process@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_softirq_exit_process>:
jmp    1030 <softirq_exit_process@plt>

LLVM IR (-O0):
define void @irq_softirq_exit_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store double %2, double* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load double, double* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @softirq_exit_process(i8* %11, i32 %12, double %13, i32 %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @irq_softirq_exit_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4) {
%6 = tail call i32 @softirq_exit_process(i8* %0, i32 %1, double %2, i32 %3, i8* %4)
ret void
}
double func2(double i) { return i * 2; }


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

x86 assembly (clang, -O2):
<func2>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @func2(double %0) {
%2 = fmul double %0, 2.000000e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ dummy(int /*<<< orphan*/, int);
int f1(int);
int main(int argc, char **argv) {
  int i;
  i = f1(4);
  i = f1(i);
  dummy(0, 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)
mov    $0x4,%edi
call   1040 <f1@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <f1@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
xor    %edi,%edi
call   1030 <dummy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @f1(i32 4)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @f1(i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @dummy(i32 0, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @f1(i32 4)
%4 = tail call i32 @f1(i32 %3)
%5 = tail call i32 @dummy(i32 0, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ftime2(unsigned char **, char *, int);
int f_ftime2(int mode, unsigned char **sec, float *data, unsigned int ndata,
             char *inv_out, void **local) {
  if (mode < 0)
    return 0;
  ftime2(sec, inv_out, mode);
  return 0;
}


x86 assembly (clang, -O0):
<f_ftime2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1144 <f_ftime2+0x34>
movl   $0x0,-0x4(%rbp)
jmp    115b <f_ftime2+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <ftime2@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ftime2>:
test   %edi,%edi
js     1126 <f_ftime2+0x16>
push   %rax
mov    %edi,%edx
mov    %rsi,%rdi
mov    %r8,%rsi
call   1030 <ftime2@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @f_ftime2(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8**
%10 = alloca float*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8**
store i32 %0, i32* %8
store i8** %1, i8*** %9
store float* %2, float** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8** %5, i8*** %13
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %6
store i32 0, i32* %7
br label %22
17: ; preds = %6
%18 = load i8**, i8*** %9
%19 = load i8*, i8** %12
%20 = load i32, i32* %8
%21 = call i32 @ftime2(i8** %18, i8* %19, i32 %20)
store i32 0, i32* %7
br label %22
22: ; preds = %17, %16
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @f_ftime2(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* %4, i8** nocapture readnone %5) {
%7 = icmp slt i32 %0, 0
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @ftime2(i8** %1, i8* %4, i32 %0)
br label %10
10: ; preds = %6, %8
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t USBHostHubAddrGet(uint32_t ui32Base, uint32_t ui32Endpoint,
                           uint32_t ui32Flags) {
  ;

  ;
  if (ui32Flags & 0x00002000) {
    return ((*((volatile unsigned char *)(ui32Base + 0x00000082 +
                                          (ui32Endpoint >> 1)))));
  } else {
    return ((*((volatile unsigned char *)(ui32Base + 0x00000082 + 4 +
                                          (ui32Endpoint >> 1)))));
  }
}


x86 assembly (clang, -O0):
<USBHostHubAddrGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     113d <USBHostHubAddrGet+0x3d>
mov    -0x8(%rbp),%eax
add    $0x82,%eax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <USBHostHubAddrGet+0x5a>
mov    -0x8(%rbp),%eax
add    $0x82,%eax
add    $0x4,%eax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostHubAddrGet>:
xor    %eax,%eax
test   $0x2000,%edx
sete   %al
lea    (%rdi,%rax,4),%eax
add    $0x82,%eax
sar    %esi
cltq
movslq %esi,%rcx
movzbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define i32 @USBHostHubAddrGet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = and i32 %8, 8192
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %3
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 130
%14 = load i32, i32* %6
%15 = ashr i32 %14, 1
%16 = add nsw i32 %13, %15
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = load volatile i8, i8* %18
%20 = zext i8 %19 to i32
store i32 %20, i32* %4
br label %32
21: ; preds = %3
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 130
%24 = add nsw i32 %23, 4
%25 = load i32, i32* %6
%26 = ashr i32 %25, 1
%27 = add nsw i32 %24, %26
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i8*
%30 = load volatile i8, i8* %29
%31 = zext i8 %30 to i32
store i32 %31, i32* %4
br label %32
32: ; preds = %21, %11
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
define i32 @USBHostHubAddrGet(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, 8192
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 134, i32 130
%7 = add nsw i32 %6, %0
%8 = ashr i32 %1, 1
%9 = add nsw i32 %7, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load volatile i8, i8* %11
%13 = zext i8 %12 to i32
ret i32 %13
}
/* Variables and functions */
int skytraq_read_ok(int);
int /*<<< orphan*/ write_buffer(int, unsigned char *, unsigned int);
int skytraq_send_agps_data_block(int fd, unsigned char *data,
                                 unsigned block_size) {
  write_buffer(fd, data, block_size);
  return skytraq_read_ok(fd);
}


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

x86 assembly (clang, -O2):
<skytraq_send_agps_data_block>:
push   %rbx
mov    %edi,%ebx
call   1030 <write_buffer@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <skytraq_read_ok@plt>

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

LLVM IR (-O2):
define i32 @skytraq_send_agps_data_block(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @write_buffer(i32 %0, i8* %1, i32 %2)
%5 = tail call i32 @skytraq_read_ok(i32 %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  swap(&a, &b);
  printf("a' = %d\nb' = %d", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [16 x i8] c"a' = %d\0Ab' = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xbutton_type(void *_p, int _v) {
  ((XEvent *)_p)->xbutton.type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xbutton_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xbutton_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xbutton_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t fmod_int32_t(int32_t a, int32_t p) { return a % p; }


x86 assembly (clang, -O0):
<fmod_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod_int32_t>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @fmod_int32_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fmod_int32_t(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
void HPLUARTM$USARTControl$setModeUART(void) {
  HPLUSART1M$USARTControl$setModeUART();
}


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

x86 assembly (clang, -O2):
<HPLUARTM$USARTControl$setModeUART>:
xor    %eax,%eax
jmp    1030 <HPLUSART1M$USARTControl$setModeUART@plt>

LLVM IR (-O0):
define void @"HPLUARTM$USARTControl$setModeUART"() {
%1 = call i32 (...) @"HPLUSART1M$USARTControl$setModeUART"()
ret void
}

LLVM IR (-O2):
define void @"HPLUARTM$USARTControl$setModeUART"() {
%1 = tail call i32 (...) @"HPLUSART1M$USARTControl$setModeUART"()
ret void
}
/* Variables and functions */
int setenv(char const *, char const *, int);
__attribute__((__weak__, __always___)) int
softboundcets_setenv(const char *name, const char *value, int overwrite) {
  return setenv(name, value, overwrite);
}


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

x86 assembly (clang, -O2):
<softboundcets_setenv>:
jmp    1030 <setenv@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_setenv(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @setenv(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void fill_with_chars(char c, int count) {
  while (count-- > 0) {
    printf("%c", c);
  }
}


x86 assembly (clang, -O0):
<fill_with_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    114a <fill_with_chars+0x3a>
lea    0xec4(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
jmp    1121 <fill_with_chars+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_with_chars>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <fill_with_chars+0x32>
mov    %esi,%ebx
add    $0x1,%ebx
movsbl %dil,%ebp
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <fill_with_chars+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @fill_with_chars(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
void foo59() {}


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

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

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

LLVM IR (-O2):
define void @foo59() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int TFD_CLOEXEC;
int TFD_NONBLOCK;
int timerfd_create(int /*<<< orphan*/, int);
int timer_create_fd(void) {
  return timerfd_create(CLOCK_REALTIME, TFD_NONBLOCK | TFD_CLOEXEC);
}


x86 assembly (clang, -O0):
<timer_create_fd>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2ebb(%rip),%rax
or     (%rax),%esi
call   1030 <timerfd_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_create_fd>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <timerfd_create@plt>

LLVM IR (-O0):
@CLOCK_REALTIME = global i32 0
@TFD_NONBLOCK = global i32 0
@TFD_CLOEXEC = global i32 0
define i32 @timer_create_fd() {
%1 = load i32, i32* @CLOCK_REALTIME
%2 = load i32, i32* @TFD_NONBLOCK
%3 = load i32, i32* @TFD_CLOEXEC
%4 = or i32 %2, %3
%5 = call i32 @timerfd_create(i32 %1, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@CLOCK_REALTIME = global i32 0
@TFD_NONBLOCK = global i32 0
@TFD_CLOEXEC = global i32 0
define i32 @timer_create_fd() {
%1 = load i32, i32* @CLOCK_REALTIME
%2 = load i32, i32* @TFD_NONBLOCK
%3 = load i32, i32* @TFD_CLOEXEC
%4 = or i32 %3, %2
%5 = tail call i32 @timerfd_create(i32 %1, i32 %4)
ret i32 %5
}
int succ(int i) { return ++i; }


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

x86 assembly (clang, -O2):
<succ>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @succ(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
float cos(double);
float S_LowpassCW(float freq, float samplerate) {
  return cos(2.0 * 3.14159265358979323846 * freq / samplerate);
}


x86 assembly (clang, -O0):
<S_LowpassCW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_LowpassCW>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
define float @S_LowpassCW(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 = fpext float %5 to double
%7 = fmul double 0x401921FB54442D18, %6
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fdiv double %7, %9
%11 = call float @cos(double %10)
ret float %11
}

LLVM IR (-O2):
define float @S_LowpassCW(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 0x401921FB54442D18
%5 = fpext float %1 to double
%6 = fdiv double %4, %5
%7 = tail call float @cos(double %6)
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *ReallocOrDie(void *space, size_t nbytes) {
  void *result;
  result = realloc(space, nbytes);
  if (result == NULL) {
    perror("Realloc Or Die");
    abort();
  }
  return result;
}


x86 assembly (clang, -O0):
<ReallocOrDie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <ReallocOrDie+0x3f>
lea    0xe9d(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReallocOrDie>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <ReallocOrDie+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Realloc Or Die\00"
define noalias i8* @ReallocOrDie(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ NOR_CTL_SaveConfig();
void NOR_CTL_Sleep(void) { NOR_CTL_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @NOR_CTL_Sleep() {
%1 = tail call i32 (...) @NOR_CTL_SaveConfig()
ret void
}
/* Variables and functions */
int __BNF_input_string(char *);
int _w(void) {
  int state;
  {
    int firstloop = 1;
    do {
      state = __BNF_input_string(" ");
      if (firstloop) {
        if (state)
          break;
        firstloop = 0;
      }
    } while (!state);
    state = firstloop;
  }
  state = 0;
  return state;
}


x86 assembly (clang, -O0):
<_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <__BNF_input_string@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <_w+0x3e>
cmpl   $0x0,-0x4(%rbp)
je     1147 <_w+0x37>
jmp    1164 <_w+0x54>
movl   $0x0,-0x8(%rbp)
jmp    1153 <_w+0x43>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111f <_w+0xf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_w>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <__BNF_input_string@plt>
test   %eax,%eax
je     1120 <_w+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @_w() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @__BNF_input_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret i32 0
}
int clone_fn(void *unused) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clone_fn(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *rindex(char *, char);
char *filename(char *url) { return rindex(url, '/') + 1; }


x86 assembly (clang, -O0):
<filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <rindex@plt>
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename>:
push   %rax
mov    $0x2f,%esi
call   1030 <rindex@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @rindex(i8* %3, i8 signext 47)
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}

LLVM IR (-O2):
define i8* @filename(i8* %0) {
%2 = tail call i8* @rindex(i8* %0, i8 signext 47)
%3 = getelementptr inbounds i8, i8* %2, i64 1
ret i8* %3
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void delay(int tenths) {
  struct timespec duration;
  duration.tv_nsec = (tenths % 10) * 100000000L;
  duration.tv_sec = (long)(tenths / 10);
  nanosleep(&duration, NULL);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
imul   $0x5f5e100,%rax,%rax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
sub    $0x18,%rsp
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%eax
imul   $0x5f5e100,%eax,%eax
mov    %eax,0x8(%rsp)
movslq %ecx,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
%6 = sext i32 %5 to i64
%7 = mul nsw i64 %6, 100000000
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @delay(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = srem i32 %0, 10
%5 = mul nsw i32 %4, 100000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = sdiv i32 %0, 10
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_alarm(int sig) { printf("Recv signal %d\n", sig); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Recv signal %d\0A\00"
define void @sig_alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Recv signal %d\0A\00"
define void @sig_alarm(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_27(uint64_t x) {
  __asm__("rolq $27, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_27>:
mov    %rdi,%rax
rol    $0x1b,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_27(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$27, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_27(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$27, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}