xunge/DecIR huggingface dataset:
/* Type definitions */
struct t_weechat_plugin {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fifo_remove();
int weechat_plugin_end(struct t_weechat_plugin *plugin) {
  (void)plugin;
  fifo_remove();
  return 0;
}


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

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

LLVM IR (-O0):
%struct.t_weechat_plugin = type { i32 }
define i32 @weechat_plugin_end(%struct.t_weechat_plugin* %0) {
%2 = alloca %struct.t_weechat_plugin*
store %struct.t_weechat_plugin* %0, %struct.t_weechat_plugin** %2
%3 = load %struct.t_weechat_plugin*, %struct.t_weechat_plugin** %2
%4 = call i32 (...) @fifo_remove()
ret i32 0
}

LLVM IR (-O2):
%struct.t_weechat_plugin = type { i32 }
define i32 @weechat_plugin_end(%struct.t_weechat_plugin* nocapture readnone %0) {
%2 = tail call i32 (...) @fifo_remove()
ret i32 0
}
unsigned long djbhash(const char *s) {
  unsigned long hash = 5381;
  int c;
  while ((c = (const unsigned char)*s++) != '\0')
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<djbhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <djbhash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <djbhash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djbhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <djbhash+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djbhash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @djbhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
void TwoMb(Mby) {
  int i;
  for (i = 1; i <= Mby; i++) {
    Stuff(1);
    printf("%dMb out of %dMb\n", i, Mby);
  }
}


x86 assembly (clang, -O0):
<TwoMb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     116c <TwoMb+0x4c>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <Stuff@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <TwoMb+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TwoMb>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    116d <TwoMb+0x4d>
mov    %edi,%r15d
mov    %edi,%ebp
neg    %ebp
mov    $0x1,%ebx
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <Stuff@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <TwoMb+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%dMb out of %dMb\0A\00"
define void @TwoMb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = call i32 (i32, ...) bitcast (i32 (...)* @Stuff to i32 (i32, ...)*)(i32 1)
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%dMb out of %dMb\0A\00"
define void @TwoMb(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @Stuff to i32 (i32, ...)*)(i32 1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %0)
%7 = add nuw i32 %4, 1
%8 = icmp eq i32 %4, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *corta_string(char *);
int longitud_string(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char *s = "Campos verdes";
  if (longitud_string(s) > 1) {
    s = (corta_string(s + 6));
    printf("%s\n", s);
  } else
    printf("error\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <longitud_string@plt>
cmp    $0x1,%eax
jle    1184 <main+0x54>
mov    -0x10(%rbp),%rdi
add    $0x6,%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1192 <main+0x62>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <longitud_string@plt>
cmp    $0x2,%eax
jl     1153 <main+0x23>
lea    0xebd(%rip),%rdi
call   1040 <corta_string@plt>
mov    %rax,%rdi
jmp    115a <main+0x2a>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@str = [6 x i8] c"error\00"
define i32 @main() {
%1 = tail call i32 @longitud_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* @corta_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 6))
br label %5
5: ; preds = %0, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %0 ]
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x1b() {
  Assert_real((isbdigit(27) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              140, ("isbdigit should be 0 for 0x1b"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1b\00"
define void @t_isbdigit_0x1b() {
%1 = tail call i64 @isbdigit(i32 27)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float tan(float);
float fovToZoom(float fov) { return 1.0f / tan(fov * .5f); }


x86 assembly (clang, -O0):
<fovToZoom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <tan@plt>
movaps %xmm0,%xmm1
movss  0xec6(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fovToZoom>:
push   %rax
mulss  0xee7(%rip),%xmm0
call   1030 <tan@plt>
movss  0xede(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fovToZoom(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 5.000000e-01
%5 = call float @tan(float %4)
%6 = fdiv float 1.000000e+00, %5
ret float %6
}

LLVM IR (-O2):
define float @fovToZoom(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = tail call float @tan(float %2)
%4 = fdiv float 1.000000e+00, %3
ret float %4
}
void foo() {
  do {
    __label__ go;
    {
      __label__ foo, bar;
    foo:
    bar:;
    }
  go:;
  foo:;
  } while (0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <foo+0x9>
jmp    110e <foo+0xe>
jmp    1113 <foo+0x13>
jmp    1118 <foo+0x18>
jmp    111d <foo+0x1d>
jmp    1122 <foo+0x22>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
br label %3
3: ; preds = %2
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, ...);
int foo(int n) {
  printf("Hello World!\n");
  printf("fib(%d) = %d\n", n, fib(n));
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <fib@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <fib@plt>
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [14 x i8] c"fib(%d) = %d\0A\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @fib(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"fib(%d) = %d\0A\00"
@str = [13 x i8] c"Hello World!\00"
define i32 @foo(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @fib(i32 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: pfe int int\nThe first integer must at least 2 and not be "
         "greater than the second integer.\nPlease enter only two "
         "arguments.\nPrints out all FAT entries.\n");
}


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

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

LLVM IR (-O0):
@.str = [159 x i8] c"Usage: pfe int int\0AThe first integer must at least 2 and not be greater than the second integer.\0APlease enter only two arguments.\0APrints out all FAT entries.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [158 x i8] c"Usage: pfe int int\0AThe first integer must at least 2 and not be greater than the second integer.\0APlease enter only two arguments.\0APrints out all FAT entries.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([158 x i8], [158 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ print_field_unicode(char *, int /*<<< orphan*/ const *, int);
int decode_manufacturer(uint8_t idx, const uint8_t *buf, int len) {
  (void)idx;
  print_field_unicode("Manufacturer", buf, len);
  return 0;
}


x86 assembly (clang, -O0):
<decode_manufacturer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xed0(%rip),%rdi
call   1030 <print_field_unicode@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Manufacturer\00"
define i32 @decode_manufacturer(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 = load i32, i32* %6
%10 = call i32 @print_field_unicode(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Manufacturer\00"
define i32 @decode_manufacturer(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @print_field_unicode(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ green_initialize(int);
int /*<<< orphan*/ green_issat(char *);
int /*<<< orphan*/ green_shutdown();
int main() {
  green_initialize(9408);
  green_issat("QUIT\n");
  green_shutdown();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x24c0,%edi
call   1030 <green_initialize@plt>
lea    0xeb0(%rip),%rdi
call   1050 <green_issat@plt>
mov    $0x0,%al
call   1040 <green_shutdown@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x24c0,%edi
call   1030 <green_initialize@plt>
lea    0xebe(%rip),%rdi
call   1050 <green_issat@plt>
xor    %eax,%eax
call   1040 <green_shutdown@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"QUIT\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @green_initialize(i32 9408)
%3 = call i32 @green_issat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @green_shutdown()
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"QUIT\0A\00"
define i32 @main() {
%1 = tail call i32 @green_initialize(i32 9408)
%2 = tail call i32 @green_issat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @green_shutdown()
ret i32 0
}
int base2idx(char base) {
  if (base == 'A') {
    return 0;
  } else if (base == 'C') {
    return 1;
  } else if (base == 'G') {
    return 2;
  } else if (base == 'T') {
    return 3;
  } else {
    return 4;
  }
}


x86 assembly (clang, -O0):
<base2idx>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jne    1123 <base2idx+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1175 <base2idx+0x75>
movsbl -0x5(%rbp),%eax
cmp    $0x43,%eax
jne    113c <base2idx+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1175 <base2idx+0x75>
movsbl -0x5(%rbp),%eax
cmp    $0x47,%eax
jne    1155 <base2idx+0x55>
movl   $0x2,-0x4(%rbp)
jmp    1175 <base2idx+0x75>
movsbl -0x5(%rbp),%eax
cmp    $0x54,%eax
jne    116e <base2idx+0x6e>
movl   $0x3,-0x4(%rbp)
jmp    1175 <base2idx+0x75>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base2idx>:
add    $0xbf,%dil
cmp    $0x13,%dil
ja     1126 <base2idx+0x26>
xor    %eax,%eax
movzbl %dil,%ecx
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1,%eax
ret
mov    $0x4,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @base2idx(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 65
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %24
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 67
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %24
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 71
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 2, i32* %2
br label %24
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 84
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 3, i32* %2
br label %24
23: ; preds = %18
store i32 4, i32* %2
br label %24
24: ; preds = %23, %22, %17, %12, %7
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @base2idx(i8 signext %0) {
switch i8 %0, label %5 [
i8 65, label %6
i8 67, label %2
i8 71, label %3
i8 84, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i32 [ 1, %2 ], [ 2, %3 ], [ 3, %4 ], [ 4, %5 ], [ 0, %1 ]
ret i32 %7
}
float revers(num)
unsigned int num;
{
  double f = 0.5, sum = 0.0;
  while (num) {
    if (num & 1)
      sum += f;
    f *= 0.5;
    num >>= 1;
  }
  return (sum);
}


x86 assembly (clang, -O0):
<revers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1164 <revers+0x64>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1144 <revers+0x44>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111c <revers+0x1c>
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<revers>:
test   %edi,%edi
je     1148 <revers+0x48>
movsd  0xef4(%rip),%xmm1
xorpd  %xmm0,%xmm0
movsd  0xef0(%rip),%xmm2
movapd %xmm1,%xmm3
jmp    1133 <revers+0x33>
xchg   %ax,%ax
addsd  %xmm4,%xmm0
mulsd  %xmm1,%xmm3
mov    %edi,%eax
shr    %eax
cmp    $0x1,%edi
mov    %eax,%edi
jbe    1143 <revers+0x43>
movapd %xmm2,%xmm4
test   $0x1,%dil
je     1120 <revers+0x20>
movapd %xmm3,%xmm4
jmp    1120 <revers+0x20>
cvtsd2ss %xmm0,%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @revers(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 %0, i32* %2
store double 5.000000e-01, double* %3
store double 0.000000e+00, double* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fadd double %14, %13
store double %15, double* %4
br label %16
16: ; preds = %12, %8
%17 = load double, double* %3
%18 = fmul double %17, 5.000000e-01
store double %18, double* %3
%19 = load i32, i32* %2
%20 = lshr i32 %19, 1
store i32 %20, i32* %2
br label %5
21: ; preds = %5
%22 = load double, double* %4
%23 = fptrunc double %22 to float
ret float %23
}

LLVM IR (-O2):
define float @revers(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %16, label %3
3: ; preds = %1, %3
%4 = phi double [ %10, %3 ], [ 0.000000e+00, %1 ]
%5 = phi double [ %11, %3 ], [ 5.000000e-01, %1 ]
%6 = phi i32 [ %12, %3 ], [ %0, %1 ]
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, double -0.000000e+00, double %5
%10 = fadd double %4, %9
%11 = fmul double %5, 5.000000e-01
%12 = lshr i32 %6, 1
%13 = icmp ult i32 %6, 2
br i1 %13, label %14, label %3
14: ; preds = %3
%15 = fptrunc double %10 to float
br label %16
16: ; preds = %14, %1
%17 = phi float [ 0.000000e+00, %1 ], [ %15, %14 ]
ret float %17
}
/* Variables and functions */
scalar_t__ acos(double);
int /*<<< orphan*/ link_failure_acos();
void test_acos(double d) {
  if (acos(d) != acos(d))
    link_failure_acos();
}


x86 assembly (clang, -O0):
<test_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <acos@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <acos@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_acos+0x3c>
mov    $0x0,%al
call   1040 <link_failure_acos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_acos>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <acos@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <acos@plt>
cmp    %rax,%rbx
jne    1149 <test_acos+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_acos@plt>

LLVM IR (-O0):
define void @test_acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @acos(double %3)
%5 = load double, double* %2
%6 = call i64 @acos(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_acos()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_acos(double %0) {
%2 = tail call i64 @acos(double %0)
%3 = tail call i64 @acos(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_acos()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(scalar_t__);
scalar_t__ getenv(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usb_os_init();
int /*<<< orphan*/ usb_set_debug(int /*<<< orphan*/);
void usb_init(void) {
  printf("usb_init\n");
  if (getenv("USB_DEBUG"))
    usb_set_debug(atoi(getenv("USB_DEBUG")));
  usb_os_init();
}


x86 assembly (clang, -O0):
<usb_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1191 <usb_init+0x41>
lea    0xe8d(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   1070 <atoi@plt>
mov    %eax,%edi
call   1060 <usb_set_debug@plt>
mov    $0x0,%al
call   1050 <usb_os_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_init>:
push   %rax
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     117d <usb_init+0x2d>
mov    %rax,%rdi
call   1070 <atoi@plt>
mov    %eax,%edi
call   1060 <usb_set_debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <usb_os_init@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"usb_init\0A\00"
@.str.1 = [10 x i8] c"USB_DEBUG\00"
define void @usb_init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i64 @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i64 @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @atoi(i64 %5)
%7 = call i32 @usb_set_debug(i32 %6)
br label %8
8: ; preds = %4, %0
%9 = call i32 (...) @usb_os_init()
ret void
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"USB_DEBUG\00"
@str = [9 x i8] c"usb_init\00"
define void @usb_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @atoi(i64 %2)
%6 = tail call i32 @usb_set_debug(i32 %5)
br label %7
7: ; preds = %4, %0
%8 = tail call i32 (...) @usb_os_init()
ret void
}
/* Variables and functions */
char *strmcpy(char *, char const *, int);
char *pathcpy(char *dst, char const *src) { return strmcpy(dst, src, 1024); }


x86 assembly (clang, -O0):
<pathcpy>:
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    $0x400,%edx
call   1030 <strmcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcpy>:
mov    $0x400,%edx
jmp    1030 <strmcpy@plt>

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

LLVM IR (-O2):
define i8* @pathcpy(i8* %0, i8* %1) {
%3 = tail call i8* @strmcpy(i8* %0, i8* %1, i32 1024)
ret i8* %3
}
__attribute__((weak)) int fcntl(int fd, int cmd, long arg) {
  (void)fd;
  (void)cmd;
  (void)arg;
  return 0;
}


x86 assembly (clang, -O0):
<fcntl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define weak i32 @fcntl(i32 %0, i32 %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int timer_sleep(scalar_t__);
scalar_t__ timer_stop(double);
int timer_wait(double timestamp, double frequency) {
  if (frequency <= 0.0)
    return 1;
  return timer_sleep(1.0 / frequency - timer_stop(timestamp));
}


x86 assembly (clang, -O0):
<timer_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     114c <timer_wait+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <timer_wait+0x63>
movsd  0xeac(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <timer_stop@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <timer_sleep@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_wait>:
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
jae    115d <timer_wait+0x3d>
push   %rax
movsd  0xecd(%rip),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
call   1040 <timer_stop@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
pop    %rax
jmp    1030 <timer_sleep@plt>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @timer_wait(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp ole double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %18
9: ; preds = %2
%10 = load double, double* %5
%11 = fdiv double 1.000000e+00, %10
%12 = load double, double* %4
%13 = call i64 @timer_stop(double %12)
%14 = sitofp i64 %13 to double
%15 = fsub double %11, %14
%16 = fptosi double %15 to i64
%17 = call i32 @timer_sleep(i64 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %9, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @timer_wait(double %0, double %1) {
%3 = fcmp ugt double %1, 0.000000e+00
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = fdiv double 1.000000e+00, %1
%6 = tail call i64 @timer_stop(double %0)
%7 = sitofp i64 %6 to double
%8 = fsub double %5, %7
%9 = fptosi double %8 to i64
%10 = tail call i32 @timer_sleep(i64 %9)
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ %10, %4 ], [ 1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ triggers_bug(int *);
void bar(int *p) {
  if (!!p)
    return;
  if (p == 0)
    triggers_bug(p);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112c <bar+0x1c>
jmp    1140 <bar+0x30>
cmpq   $0x0,-0x8(%rbp)
jne    1140 <bar+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <triggers_bug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %rdi,%rdi
je     1116 <bar+0x6>
ret
xor    %edi,%edi
jmp    1030 <triggers_bug@plt>

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

LLVM IR (-O2):
define void @bar(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @triggers_bug(i32* null)
br label %5
5: ; preds = %1, %3
ret void
}
float dwell_to_degrees(float dwell, double RPM) {
  return (dwell / 1000) * 6 * RPM;
}


x86 assembly (clang, -O0):
<dwell_to_degrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee9(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xed9(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwell_to_degrees>:
divss  0xef8(%rip),%xmm0
mulss  0xef4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @dwell_to_degrees(float %0, double %1) {
%3 = alloca float
%4 = alloca double
store float %0, float* %3
store double %1, double* %4
%5 = load float, float* %3
%6 = fdiv float %5, 1.000000e+03
%7 = fmul float %6, 6.000000e+00
%8 = fpext float %7 to double
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @dwell_to_degrees(float %0, double %1) {
%3 = fdiv float %0, 1.000000e+03
%4 = fmul float %3, 6.000000e+00
%5 = fpext float %4 to double
%6 = fmul double %5, %1
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
double EcontourNNN(double const, double const, double, double const);
double EcontourNNNAlt(const double k1, const double k3, const double k4,
                      const double eta) {
  return EcontourNNN(k3 + k4, k1 - 0.5 * (k3 + k4), 0.5 * (k3 - k4), eta);
}


x86 assembly (clang, -O0):
<EcontourNNNAlt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xebb(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
movsd  0xe99(%rip),%xmm2
mulsd  %xmm3,%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <EcontourNNN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EcontourNNNAlt>:
movapd %xmm1,%xmm4
movapd %xmm1,%xmm5
addsd  %xmm2,%xmm5
movsd  0xedc(%rip),%xmm1
mulsd  %xmm5,%xmm1
addsd  %xmm0,%xmm1
subsd  %xmm2,%xmm4
mulsd  0xed0(%rip),%xmm4
movapd %xmm5,%xmm0
movapd %xmm4,%xmm2
jmp    1030 <EcontourNNN@plt>

LLVM IR (-O0):
define double @EcontourNNNAlt(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = load double, double* %7
%11 = fadd double %9, %10
%12 = load double, double* %5
%13 = load double, double* %6
%14 = load double, double* %7
%15 = fadd double %13, %14
%16 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %15, double %12)
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fsub double %17, %18
%20 = fmul double 5.000000e-01, %19
%21 = load double, double* %8
%22 = call double @EcontourNNN(double %11, double %16, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @EcontourNNNAlt(double %0, double %1, double %2, double %3) {
%5 = fadd double %1, %2
%6 = tail call double @llvm.fmuladd.f64(double %5, double -5.000000e-01, double %0)
%7 = fsub double %1, %2
%8 = fmul double %7, 5.000000e-01
%9 = tail call double @EcontourNNN(double %5, double %6, double %8, double %3)
ret double %9
}
/* Variables and functions */
int u8isuppergreeki(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8isuppergreekc(char *c) { return u8isuppergreeki(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8isuppergreekc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8isuppergreeki@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isuppergreekc>:
push   %rax
call   1030 <u8tointc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isuppergreeki@plt>

LLVM IR (-O0):
define i32 @u8isuppergreekc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointc(i8* %3)
%5 = call i32 @u8isuppergreeki(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8isuppergreekc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8isuppergreeki(i32 %2)
ret i32 %3
}
int main() {
  int a = 10, b = 999;
  int *p = &a;
  printf("Values before:\n  a = %d\n  b = %d\n  *p = %d\n  p = %d\n", a, b, *p,
         p);
  *p = 30, p = &b;
  printf("Values after:\n  a = %d\n  b = %d\n  *p = %d\n  p = %d\n", a, b, *p,
         p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x3e7,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%r8
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movl   $0x1e,(%rax)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%r8
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,(%rsp)
movl   $0x3e7,0x4(%rsp)
lea    0xed9(%rip),%rdi
mov    %rsp,%r8
mov    $0xa,%esi
mov    $0x3e7,%edx
mov    $0xa,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x1e,(%rsp)
lea    0xee7(%rip),%rdi
lea    0x4(%rsp),%r8
mov    $0x1e,%esi
mov    $0x3e7,%edx
mov    $0x3e7,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Values before:\0A a = %d\0A b = %d\0A *p = %d\0A p = %d\0A\00"
@.str.1 = [52 x i8] c"Values after:\0A a = %d\0A b = %d\0A *p = %d\0A p = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32 999, i32* %3
store i32* %2, i32** %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %8, i32* %9)
%11 = load i32*, i32** %4
store i32 30, i32* %11
store i32* %3, i32** %4
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13, i32 %15, i32* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"Values before:\0A a = %d\0A b = %d\0A *p = %d\0A p = %d\0A\00"
@.str.1 = [52 x i8] c"Values after:\0A a = %d\0A b = %d\0A *p = %d\0A p = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 999, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 10, i32 999, i32 10, i32* %1)
store i32 30, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 30, i32 999, i32 999, i32* %2)
ret i32 0
}
void sws_setColorspaceDetails() {}


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

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

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

LLVM IR (-O2):
define void @sws_setColorspaceDetails() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_fstat;
int errno;
int syscall(int /*<<< orphan*/, int, struct stat *);
int usfs_fgetattr(uint64_t fh, struct stat *stbuf) {
  int ret = syscall(SYS_fstat, (int)fh, stbuf);
  if (-1 == ret) {
    ret = errno;
  }
  return ret;
}


x86 assembly (clang, -O0):
<usfs_fgetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
jne    1155 <usfs_fgetattr+0x45>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usfs_fgetattr>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
jne    1133 <usfs_fgetattr+0x23>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@SYS_fstat = global i32 0
@errno = global i32 0
define i32 @usfs_fgetattr(i64 %0, %struct.stat* %1) {
%3 = alloca i64
%4 = alloca %struct.stat*
%5 = alloca i32
store i64 %0, i64* %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i32, i32* @SYS_fstat
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = load %struct.stat*, %struct.stat** %4
%10 = call i32 @syscall(i32 %6, i32 %8, %struct.stat* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 -1, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* @errno
store i32 %14, i32* %5
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@SYS_fstat = global i32 0
@errno = global i32 0
define i32 @usfs_fgetattr(i64 %0, %struct.stat* %1) {
%3 = load i32, i32* @SYS_fstat
%4 = trunc i64 %0 to i32
%5 = tail call i32 @syscall(i32 %3, i32 %4, %struct.stat* %1)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* @errno
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
/* Variables and functions */
void *malloc(long);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, long);
void *my_malloc(long size) {
  void *p = malloc(size);
  memset(p, 0, size);
  return p;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @my_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
int delta(int a, int b, int c) { return (b * b - 4 * a * c); }


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
mov    %esi,%eax
imul   %esi,%eax
imul   %edx,%edi
shl    $0x2,%edi
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @delta(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* %5
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = mul nsw i32 4, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 %11, %12
%14 = sub nsw i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @delta(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %1
%5 = mul i32 %0, -4
%6 = mul i32 %5, %2
%7 = add i32 %6, %4
ret i32 %7
}
int main(void) {
  int a[100] = {0};
  int *b = (int *)malloc(100 * sizeof(*b));
  printf("%lu\n", (sizeof(a) / sizeof(((typeof(a)){})[0])));
  ({
    typeof(int[100]) X;
    typeof(a) Y;
    (void)(&X == &Y);
    1;
  });
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
mov    $0x190,%edi
call   1050 <malloc@plt>
mov    %rax,-0x1a8(%rbp)
lea    0xe93(%rip),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4d4(%rbp)
xor    %eax,%eax
add    $0x4e0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32*
%4 = alloca [100 x i32]
%5 = alloca [100 x i32]
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [100 x i32]* %2 to i8*
%8 = call i8* @malloc(i64 400)
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 100)
%11 = icmp eq [100 x i32]* %4, %5
%12 = zext i1 %11 to i32
store i32 1, i32* %6
%13 = load i32, i32* %6
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 100)
ret i32 0
}
int main() { return 4 * -1; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 -4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 -4
}
/* Variables and functions */
double cosh(double);
double c_cosh(double arg0) { return cosh(arg0); }


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

x86 assembly (clang, -O2):
<c_cosh>:
jmp    1030 <cosh@plt>

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

LLVM IR (-O2):
define double @c_cosh(double %0) {
%2 = tail call double @cosh(double %0)
ret double %2
}
void isr_disable() { asm volatile(" cli "); }


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

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

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

LLVM IR (-O2):
define void @isr_disable() {
tail call void asm sideeffect " cli ", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int test_imm_C2int16_reg(short val) {
  return ((val) & (0xC2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C2int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xc2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_C2int16_reg(i16 signext %0) {
%2 = and i16 %0, 194
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}