xunge/DecIR huggingface dataset:
int qux() {
  static int n = 3;
  return n;
}


x86 assembly (clang, -O0):
<qux>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@qux.n = internal global i32 3
define i32 @qux() {
%1 = load i32, i32* @qux.n
ret i32 %1
}

LLVM IR (-O2):
define i32 @qux() {
ret i32 3
}
/* Variables and functions */
void *MAP_FAILED;
int _dl_mmap_check_error(void *x) { return x == MAP_FAILED; }


x86 assembly (clang, -O0):
<_dl_mmap_check_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dl_mmap_check_error>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
cmp    %rdi,(%rcx)
sete   %al
ret

LLVM IR (-O0):
@MAP_FAILED = global i8* null
define i32 @_dl_mmap_check_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** @MAP_FAILED
%5 = icmp eq i8* %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@MAP_FAILED = global i8* null
define i32 @_dl_mmap_check_error(i8* nocapture readnone %0) {
%2 = load i8*, i8** @MAP_FAILED
%3 = icmp eq i8* %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int itoa_length(int n) {
  int result = 1;
  if (n < 0) {
    n = -n;
    result++;
  }
  while (n >= 10) {
    result++;
    n /= 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<itoa_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1129 <itoa_length+0x29>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <itoa_length+0x2e>
cmpl   $0xa,-0x4(%rbp)
jl     1154 <itoa_length+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    112e <itoa_length+0x2e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa_length>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x1f,%eax
add    $0x1,%eax
cmp    $0xa,%ecx
jb     1134 <itoa_length+0x34>
mov    $0xcccccccd,%edx
nopl   0x0(%rax)
add    $0x1,%eax
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1120 <itoa_length+0x20>
ret

LLVM IR (-O0):
define i32 @itoa_length(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %11
11: ; preds = %6, %1
br label %12
12: ; preds = %15, %11
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 10
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
%18 = load i32, i32* %2
%19 = sdiv i32 %18, 10
store i32 %19, i32* %2
br label %12
20: ; preds = %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @itoa_length(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = sub nsw i32 0, %0
%4 = select i1 %2, i32 %3, i32 %0
%5 = select i1 %2, i32 2, i32 1
%6 = icmp ugt i32 %4, 9
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ %5, %1 ]
%9 = phi i32 [ %11, %7 ], [ %4, %1 ]
%10 = add nuw nsw i32 %8, 1
%11 = udiv i32 %9, 10
%12 = icmp ugt i32 %9, 99
br i1 %12, label %7, label %13
13: ; preds = %7, %1
%14 = phi i32 [ %5, %1 ], [ %10, %7 ]
ret i32 %14
}
/* Variables and functions */
char const *quote_bytes(char const *, int);
int strlen(char const *);
extern const char *quote_str(const char *str) {
  int len = strlen(str);
  return quote_bytes(str, len);
}


x86 assembly (clang, -O0):
<quote_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <quote_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quote_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <quote_bytes@plt>

LLVM IR (-O0):
define i8* @quote_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i8* @quote_bytes(i8* %6, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @quote_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @quote_bytes(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ logGC();
void vmemDumpHeap() { logGC(); }


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

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

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

LLVM IR (-O2):
define void @vmemDumpHeap() {
%1 = tail call i32 (...) @logGC()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s[4];
  itoa(-10010, s);
  printf("%s", s);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    $0xffffd8e6,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 -10010, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xdf() {
  Assert_real((isxdigit(223) == 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_isxdigit.c",
              1120, ("isxdigit should be 0 for 0xdf"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xdf>:
push   %rax
mov    $0xdf,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x460,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xdf\00"
define void @t_isxdigit_0xdf() {
%1 = call i64 @isxdigit(i32 223)
%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 1120, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xdf\00"
define void @t_isxdigit_0xdf() {
%1 = tail call i64 @isxdigit(i32 223)
%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 1120, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct context {
  int dummy;
};

/* Variables and functions */
int send_vendor_pkt(struct context *, int /*<<< orphan*/ *, int,
                    int /*<<< orphan*/ *, int /*<<< orphan*/);
int send_reset(struct context *ctx, uint8_t *mac) {
  return send_vendor_pkt(ctx, mac, 0xA01C, NULL, 0);
}


x86 assembly (clang, -O0):
<send_reset>:
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    $0xa01c,%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <send_vendor_pkt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_reset>:
mov    $0xa01c,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <send_vendor_pkt@plt>

LLVM IR (-O0):
%struct.context = type { i32 }
define i32 @send_reset(%struct.context* %0, i32* %1) {
%3 = alloca %struct.context*
%4 = alloca i32*
store %struct.context* %0, %struct.context** %3
store i32* %1, i32** %4
%5 = load %struct.context*, %struct.context** %3
%6 = load i32*, i32** %4
%7 = call i32 @send_vendor_pkt(%struct.context* %5, i32* %6, i32 40988, i32* null, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.context = type { i32 }
define i32 @send_reset(%struct.context* %0, i32* %1) {
%3 = tail call i32 @send_vendor_pkt(%struct.context* %0, i32* %1, i32 40988, i32* null, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ getch(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double miles, kms;
  printf("Enter the distance in miles\n");
  scanf("%lf", &miles);
  kms = 1.609 * miles;
  printf("That equel to %lf kilometers\n", kms);
  getch(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xea2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xe97(%rip),%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter the distance in miles\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [30 x i8] c"That equel to %lf kilometers\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double 1.609000e+00, %5
store double %6, double* %2
%7 = load double, double* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = call i32 @getch(i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [30 x i8] c"That equel to %lf kilometers\0A\00"
@str = [28 x i8] c"Enter the distance in miles\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 1.609000e+00
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = call i32 @getch(i32 0)
ret i32 0
}
/* Variables and functions */
float *xmalloc(size_t);
float *fmalloc(size_t n) {
  float *d = xmalloc(n * sizeof(float));
  size_t i;
  for (i = 0; i < n; i++) {
    d[i] = 0.0;
  }
  return d;
}


x86 assembly (clang, -O0):
<fmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x2,%rdi
call   1030 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1164 <fmalloc+0x54>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <fmalloc+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0x0(,%rdi,4),%r14
mov    %r14,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%r15
test   %rbx,%rbx
je     114d <fmalloc+0x2d>
mov    %r15,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float* @fmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca float*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = mul i64 %5, 4
%7 = call float* @xmalloc(i64 %6)
store float* %7, float** %3
store i64 0, i64* %4
br label %8
8: ; preds = %16, %1
%9 = load i64, i64* %4
%10 = load i64, i64* %2
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load float*, float** %3
%14 = load i64, i64* %4
%15 = getelementptr inbounds float, float* %13, i64 %14
store float 0.000000e+00, float* %15
br label %16
16: ; preds = %12
%17 = load i64, i64* %4
%18 = add i64 %17, 1
store i64 %18, i64* %4
br label %8
19: ; preds = %8
%20 = load float*, float** %3
ret float* %20
}

LLVM IR (-O2):
define float* @fmalloc(i64 %0) {
%2 = shl i64 %0, 2
%3 = tail call float* @xmalloc(i64 %2)
%4 = icmp eq i64 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = bitcast float* %3 to i8*
br label %7
7: ; preds = %5, %1
ret float* %3
}
/* Variables and functions */
char SmallArgs2(char, char, char, char, char);
int /*<<< orphan*/ SomeFunc();
char SmallArgs(char w, char x, char y, char z) {
  SomeFunc();
  return SmallArgs2(w - 1, x + 1, y, z, w);
}


x86 assembly (clang, -O0):
<SmallArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    $0x0,%al
call   1030 <SomeFunc@plt>
movsbl -0x1(%rbp),%eax
sub    $0x1,%eax
mov    %al,%sil
movsbl -0x2(%rbp),%eax
add    $0x1,%eax
mov    %al,%dl
mov    -0x3(%rbp),%cl
mov    -0x4(%rbp),%al
movsbl %sil,%edi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x1(%rbp),%r8d
call   1040 <SmallArgs2@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SmallArgs>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <SomeFunc@plt>
lea    -0x1(%rbp),%eax
add    $0x1,%bl
movsbl %al,%edi
movsbl %bl,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    %ebp,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <SmallArgs2@plt>

LLVM IR (-O0):
define signext i8 @SmallArgs(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = call i32 (...) @SomeFunc()
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 1
%13 = trunc i32 %12 to i8
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = add nsw i32 %15, 1
%17 = trunc i32 %16 to i8
%18 = load i8, i8* %7
%19 = load i8, i8* %8
%20 = load i8, i8* %5
%21 = call signext i8 @SmallArgs2(i8 signext %13, i8 signext %17, i8 signext %18, i8 signext %19, i8 signext %20)
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @SmallArgs(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = tail call i32 (...) @SomeFunc()
%6 = add i8 %0, -1
%7 = add i8 %1, 1
%8 = tail call signext i8 @SmallArgs2(i8 signext %6, i8 signext %7, i8 signext %2, i8 signext %3, i8 signext %0)
ret i8 %8
}
void foo(int *n) { *n = 2; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x2,(%rdi)
ret

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

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
store i32 2, i32* %0
ret void
}
double env_csv_maxpayoff(const struct XCSF *xcsf) {
  (void)xcsf;
  return 0;
}


x86 assembly (clang, -O0):
<env_csv_maxpayoff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_csv_maxpayoff>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
%struct.XCSF = type opaque
define double @env_csv_maxpayoff(%struct.XCSF* %0) {
%2 = alloca %struct.XCSF*
store %struct.XCSF* %0, %struct.XCSF** %2
%3 = load %struct.XCSF*, %struct.XCSF** %2
ret double 0.000000e+00
}

LLVM IR (-O2):
%struct.XCSF = type opaque
define double @env_csv_maxpayoff(%struct.XCSF* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void jne_near_rj(unsigned long saut) {
  put8(0x0F);
  put8(0x85);
  put32(saut);
}


x86 assembly (clang, -O0):
<jne_near_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x85,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jne_near_rj>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x85,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @jne_near_rj(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 15)
%4 = call i32 @put8(i32 133)
%5 = load i64, i64* %2
%6 = call i32 @put32(i64 %5)
ret void
}

LLVM IR (-O2):
define void @jne_near_rj(i64 %0) {
%2 = tail call i32 @put8(i32 15)
%3 = tail call i32 @put8(i32 133)
%4 = tail call i32 @put32(i64 %0)
ret void
}
/* Variables and functions */
scalar_t__ euclid_pythagorean_triple(int, int, long *, long *, long *);
long euclid_pythagorean_triple_perim(int m, int n) {
  long a = 0;
  long b = 0;
  long c = 0;
  if (euclid_pythagorean_triple(m, n, &a, &b, &c))
    return a + b + c;
  else
    return 0;
}


x86 assembly (clang, -O0):
<euclid_pythagorean_triple_perim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1030 <euclid_pythagorean_triple@plt>
cmp    $0x0,%rax
je     116c <euclid_pythagorean_triple_perim+0x5c>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <euclid_pythagorean_triple_perim+0x64>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_pythagorean_triple_perim>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
call   1030 <euclid_pythagorean_triple@plt>
test   %rax,%rax
je     1158 <euclid_pythagorean_triple_perim+0x48>
mov    0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    (%rsp),%rax
add    $0x18,%rsp
ret
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i64 @euclid_pythagorean_triple_perim(i32 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%7 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%8 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%9 = call i64 @euclid_pythagorean_triple(i32 %0, i32 %1, i64* %3, i64* %4, i64* %5)
%10 = icmp eq i64 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = add nsw i64 %13, %12
%15 = load i64, i64* %5
%16 = add nsw i64 %14, %15
br label %17
17: ; preds = %2, %11
%18 = phi i64 [ %16, %11 ], [ 0, %2 ]
ret i64 %18
}
int test6_apply_fn2(const void *k, const void *v, const void *u) {
  (void)(k);
  (void)(v);
  *(int *)u *= 2;
  return 0;
}


x86 assembly (clang, -O0):
<test6_apply_fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6_apply_fn2>:
shll   (%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test6_apply_fn2(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = mul nsw i32 %11, 2
store i32 %12, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @test6_apply_fn2(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = shl nsw i32 %5, 1
store i32 %6, i32* %4
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
double log(double);
double foo_opt(double y) {
  double yy = 0;
  errno = 0;
  yy = log(y);
  return 0;
}


x86 assembly (clang, -O0):
<foo_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2eb4(%rip),%rax
movq   $0x0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_opt>:
push   %rax
mov    0x2ec8(%rip),%rax
movq   $0x0,(%rax)
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    112f <foo_opt+0x1f>
xorpd  %xmm0,%xmm0
pop    %rax
ret
call   1030 <log@plt>
jmp    1129 <foo_opt+0x19>

LLVM IR (-O0):
@errno = global i64 0
define double @foo_opt(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
store i64 0, i64* @errno
%4 = load double, double* %2
%5 = call double @log(double %4)
store double %5, double* %3
ret double 0.000000e+00
}

LLVM IR (-O2):
@errno = global i64 0
define double @foo_opt(double %0) {
store i64 0, i64* @errno
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @log(double %0)
br label %5
5: ; preds = %1, %3
ret double 0.000000e+00
}
/* Variables and functions */
long strtol(char const *, char **, int /*<<< orphan*/);
int parse_int(const char *s, int *i) {
  char *ep;
  long l;
  l = strtol(s, &ep, 0);
  if (*ep != 0)
    return 0;
  *i = (int)l;
  return 1;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114f <parse_int+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1162 <parse_int+0x52>
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rsp,%rsi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    1132 <parse_int+0x22>
mov    %eax,(%rbx)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_int(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtol(i8* %0, i8** %3, i32 0)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = trunc i64 %5 to i32
store i32 %10, i32* %1
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t multimap_read(int fd, void *buffer, size_t size) {
  return read(fd, buffer, size);
}


x86 assembly (clang, -O0):
<multimap_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multimap_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @multimap_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double msecond() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return ((double)tv.tv_sec * 1.0e3 + (double)tv.tv_usec * 1.0e-3);
}


x86 assembly (clang, -O0):
<msecond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xed1(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msecond>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
cvtsi2sdq 0x8(%rsp),%xmm1
mulsd  0xeca(%rip),%xmm1
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @msecond() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fmul double %8, 1.000000e-03
%10 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %9)
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @msecond() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fmul double %9, 1.000000e-03
%11 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+03, double %10)
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ report_errno(char const *);
bool close_file(FILE *f, const char *file_name) {
  bool successful = true;
  if (fclose(f) == EOF) {
    report_errno(file_name);
    successful = false;
  }
  return successful;
}


x86 assembly (clang, -O0):
<close_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%rax
jne    1160 <close_file+0x40>
mov    -0x10(%rbp),%rdi
call   1040 <report_errno@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_file>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fclose@plt>
mov    %rax,%rcx
mov    0x2eb5(%rip),%rdx
mov    $0x1,%eax
cmp    (%rdx),%rcx
jne    1147 <close_file+0x27>
mov    %rbx,%rdi
call   1040 <report_errno@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @close_file(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
store i32 1, i32* %5
%6 = load i32*, i32** %3
%7 = call i64 @fclose(i32* %6)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @report_errno(i8* %11)
store i32 0, i32* %5
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @close_file(i32* nocapture %0, i8* %1) {
%3 = tail call i64 @fclose(i32* %0)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @report_errno(i8* %1)
br label %8
8: ; preds = %6, %2
%9 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i, a = 2, b = 1, c;
  for (i = 1; i <= 100; i++) {
    printf("№%d - %d\n", i, a);
    c = a + b;
    a = b;
    b = c;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1173 <main+0x63>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebp
mov    $0x1,%ebx
lea    0xed8(%rip),%r14
mov    $0x1,%eax
nopl   (%rax)
mov    %eax,%r15d
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
add    %r15d,%ebp
add    $0x1,%ebx
mov    %ebp,%eax
mov    %r15d,%ebp
cmp    $0x65,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"\E2\84\96%d - %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %3
store i32 1, i32* %4
store i32 1, i32* %2
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 100
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %4
store i32 %16, i32* %3
%17 = load i32, i32* %5
store i32 %17, i32* %4
br label %18
18: ; preds = %9
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"\E2\84\96%d - %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %7, %1 ]
%3 = phi i32 [ 1, %0 ], [ %6, %1 ]
%4 = phi i32 [ 2, %0 ], [ %3, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
%6 = add nsw i32 %3, %4
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 101
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
struct pcg_state_128 {
  int dummy;
};

/* Variables and functions */
int pcg_mcg_128_xsh_rs_64_random_r(struct pcg_state_128 *);
uint64_t pcg_mcg_128_xsh_rs_64_boundedrand_r(struct pcg_state_128 *rng,
                                             uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_mcg_128_xsh_rs_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_mcg_128_xsh_rs_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_mcg_128_xsh_rs_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_mcg_128_xsh_rs_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_mcg_128_xsh_rs_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_mcg_128_xsh_rs_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_mcg_128_xsh_rs_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_mcg_128_xsh_rs_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_128 = type { i32 }
define i32 @pcg_mcg_128_xsh_rs_64_boundedrand_r(%struct.pcg_state_128* %0, i32 %1) {
%3 = alloca %struct.pcg_state_128*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_128* %0, %struct.pcg_state_128** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_128*, %struct.pcg_state_128** %3
%13 = call i32 @pcg_mcg_128_xsh_rs_64_random_r(%struct.pcg_state_128* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_128 = type { i32 }
define i32 @pcg_mcg_128_xsh_rs_64_boundedrand_r(%struct.pcg_state_128* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_mcg_128_xsh_rs_64_random_r(%struct.pcg_state_128* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Type definitions */
typedef char *u_int16_t;

/* Variables and functions */
u_int16_t ByteSwap16(u_int16_t x) {
  __asm("xchgb %b0,%h0" : "=Q"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<ByteSwap16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xchg   %ah,%al
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ByteSwap16>:
mov    %rdi,%rax
xchg   %ah,%al
ret

LLVM IR (-O0):
define i8* @ByteSwap16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "xchgb ${0:b},${0:h}", "=Q,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ByteSwap16(i8* readnone %0) {
%2 = tail call i8* asm "xchgb ${0:b},${0:h}", "=Q,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
void gtk_widget_pop_colormap() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_pop_colormap() {
ret void
}
/* Variables and functions */
int syscall(int, void *, int);
int swapon(const char *a, int i) { return syscall(87, (void *)a, i); }


x86 assembly (clang, -O0):
<swapon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x57,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapon>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x57,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @swapon(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 87, i8* %0, i32 %1)
ret i32 %3
}
float convert_to_c(float f) {
  float celsius = (5.0 / 9.0) * (f - 32.0);
  return celsius;
}


x86 assembly (clang, -O0):
<convert_to_c>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_c>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @convert_to_c(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fsub double %5, 3.200000e+01
%7 = fmul double 0x3FE1C71C71C71C72, %6
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @convert_to_c(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
typedef scalar_t__ ssize_t;
typedef int /*<<< orphan*/ payload;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htonl(unsigned int);
int /*<<< orphan*/ perror(char *);
scalar_t__ writen(int, int *, int);
void writeData4(int socketfd, const void *data) {
  int payload = htonl(*(unsigned int *)data);
  int *payload_pointer = &payload;
  ssize_t result = writen(socketfd, payload_pointer, sizeof(payload));
  if (result < 0) {
    perror("Error writing on the stream");
    exit(2);
  }
}


x86 assembly (clang, -O0):
<writeData4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <htonl@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x4,%edx
call   1050 <writen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jge    119b <writeData4+0x5b>
lea    0xe74(%rip),%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1060 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeData4>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    (%rsi),%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1050 <writen@plt>
test   %rax,%rax
js     116e <writeData4+0x2e>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe8b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Error writing on the stream\00"
define void @writeData4(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 @htonl(i32 %10)
store i32 %11, i32* %5
store i32* %5, i32** %6
%12 = load i32, i32* %3
%13 = load i32*, i32** %6
%14 = call i64 @writen(i32 %12, i32* %13, i32 4)
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 2)
unreachable
20: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Error writing on the stream\00"
define void @writeData4(i32 %0, i8* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @htonl(i32 %6)
store i32 %7, i32* %3
%8 = call i64 @writen(i32 %0, i32* %3, i32 4)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 2)
unreachable
13: ; preds = %2
ret void
}
int coniogetch() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @coniogetch() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  unsigned long long xx;
  unsigned long long *x = (unsigned long long *)&xx;
  *x = -3;
  *x = *x * *x;
  if (*x != 9)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0xfffffffffffffffd,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
imul   (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x9,(%rax)
je     116d <main+0x4d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64*
store i32 0, i32* %1
store i64* %2, i64** %3
%4 = load i64*, i64** %3
store i64 -3, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
%9 = mul i64 %6, %8
%10 = load i64*, i64** %3
store i64 %9, i64* %10
%11 = load i64*, i64** %3
%12 = load i64, i64* %11
%13 = icmp ne i64 %12, 9
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %0
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deallocate(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<deallocate>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deallocate(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void __int_handler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @__int_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int gca_search_ptr(const void *aa, void *bb) {
  const void *const a = *(const void *const *)aa;
  const void *const b = *(void *const *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_search_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
cmp    -0x18(%rbp),%rcx
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_search_ptr>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @gca_search_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = icmp ugt i8* %13, %14
%16 = zext i1 %15 to i32
%17 = load i8*, i8** %6
%18 = load i8*, i8** %5
%19 = icmp ugt i8* %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_search_ptr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = icmp ugt i8* %4, %6
%8 = zext i1 %7 to i32
%9 = icmp ugt i8* %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ f();
main() { 1, f(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}