xunge/DecIR huggingface dataset:
void ftol(float f, long *a) { *a = f; }


x86 assembly (clang, -O0):
<ftol>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cvttss2si -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftol>:
cvttss2si %xmm0,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @ftol(float %0, i64* %1) {
%3 = alloca float
%4 = alloca i64*
store float %0, float* %3
store i64* %1, i64** %4
%5 = load float, float* %3
%6 = fptosi float %5 to i64
%7 = load i64*, i64** %4
store i64 %6, i64* %7
ret void
}

LLVM IR (-O2):
define void @ftol(float %0, i64* nocapture writeonly %1) {
%3 = fptosi float %0 to i64
store i64 %3, i64* %1
ret void
}
__attribute__((always_)) int __flsll(long long value) {
  long long msb_minus_one;
  if (value) {
    __asm__("bsrq %1, %0" : "=r"(msb_minus_one) : "rm"(value));
    return (msb_minus_one + 1);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<__flsll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <__flsll+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
bsr    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %eax,-0x4(%rbp)
jmp    113b <__flsll+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__flsll>:
test   %rdi,%rdi
je     1114 <__flsll+0x14>
mov    %rdi,-0x8(%rsp)
bsr    -0x8(%rsp),%rax
add    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__flsll(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i64 asm "bsrq $1, $0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %8)
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = add nsw i64 %10, 1
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @__flsll(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 asm "bsrq $1, $0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %0)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
double dmax(double a, double b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<dmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <dmax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <dmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmax>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @dmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int pathconN_nm10_f0(const double **arg, double **res, int *iw, double *w,
                     int mem) {
  return 0;
}


x86 assembly (clang, -O0):
<pathconN_nm10_f0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pathconN_nm10_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @pathconN_nm10_f0(double** nocapture readnone %0, double** nocapture readnone %1, i32* nocapture readnone %2, double* nocapture readnone %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_curs();
int /*<<< orphan*/ init_term();
void init_scrn(void) {
  init_curs();
  init_term();
}


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

x86 assembly (clang, -O2):
<init_scrn>:
push   %rax
xor    %eax,%eax
call   1040 <init_curs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_term@plt>

LLVM IR (-O0):
define void @init_scrn() {
%1 = call i32 (...) @init_curs()
%2 = call i32 (...) @init_term()
ret void
}

LLVM IR (-O2):
define void @init_scrn() {
%1 = tail call i32 (...) @init_curs()
%2 = tail call i32 (...) @init_term()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x1d() {
  Assert_real((isalpha(29) == 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_isalpha.c",
              150, ("isalpha should be 0 for 0x1d"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x1d>:
push   %rax
mov    $0x1d,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x96,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x1d\00"
define void @t_isalpha_0x1d() {
%1 = call i64 @isalpha(i32 29)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x1d\00"
define void @t_isalpha_0x1d() {
%1 = tail call i64 @isalpha(i32 29)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char getchar();
int readchar() {
  for (;;) {
    char ch = getchar();
    if (ch != '\r' && ch != '\n')
      return ch;
  }
}


x86 assembly (clang, -O0):
<readchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
je     1146 <readchar+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1146 <readchar+0x36>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1118 <readchar+0x8>

x86 assembly (clang, -O2):
<readchar>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1132 <readchar+0x22>
cmp    $0xd,%al
je     1132 <readchar+0x22>
movsbl %al,%ebx
cmp    $0xa,%al
je     1120 <readchar+0x10>
cmp    $0xd,%al
je     1120 <readchar+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @readchar() {
br label %1
1: ; preds = %8, %0
%2 = phi i32 [ undef, %0 ], [ %7, %8 ]
%3 = tail call signext i8 (...) @getchar()
switch i8 %3, label %4 [
i8 13, label %6
i8 10, label %6
]
4: ; preds = %1
%5 = sext i8 %3 to i32
br label %6
6: ; preds = %1, %1, %4
%7 = phi i32 [ %5, %4 ], [ %2, %1 ], [ %2, %1 ]
switch i8 %3, label %9 [
i8 13, label %8
i8 10, label %8
]
8: ; preds = %6, %6
br label %1
9: ; preds = %6
ret i32 %7
}
void gdk_window_scroll() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_scroll() {
ret void
}
char NegativeRotN(char c, int min, int max, int mod, int N) {
  char temp = c - N;
  if ((int)c - N < min) {
    temp = (char)(max - ((int)c - N + 1 - min));
  }
  return temp;
}


x86 assembly (clang, -O0):
<NegativeRotN>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
movsbl -0x1(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
movsbl -0x1(%rbp),%eax
sub    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1146 <NegativeRotN+0x46>
mov    -0xc(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    -0x14(%rbp),%ecx
add    $0x1,%ecx
sub    -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NegativeRotN>:
sub    %r8d,%edi
mov    %edi,%eax
not    %eax
add    %edx,%eax
add    %esi,%eax
cmp    %esi,%edi
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @NegativeRotN(i8 signext %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i8 %0 to i32
%7 = sub nsw i32 %6, %4
%8 = icmp slt i32 %7, %1
%9 = xor i32 %7, -1
%10 = add i32 %2, %1
%11 = add i32 %10, %9
%12 = select i1 %8, i32 %11, i32 %7
%13 = trunc i32 %12 to i8
ret i8 %13
}
void set_io_schedule(struct res_schedule *sched) {}


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

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

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

LLVM IR (-O2):
%struct.res_schedule = type opaque
define void @set_io_schedule(%struct.res_schedule* nocapture %0) {
ret void
}
/* Variables and functions */
float truncl(float);
float truncf(float x) { return truncl(x); }


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

x86 assembly (clang, -O2):
<truncf>:
jmp    1030 <truncl@plt>

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

LLVM IR (-O2):
define float @truncf(float %0) {
%2 = tail call float @truncl(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, int /*<<< orphan*/ *);
void check_usage(int argc) {
  if (argc != 3) {
    error("Invalid usage. Please run like: "
          "./asm <input_filename> <output_filename>",
          NULL);
  }
}


x86 assembly (clang, -O0):
<check_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     1135 <check_usage+0x25>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_usage>:
cmp    $0x3,%edi
jne    1116 <check_usage+0x6>
ret
lea    0xee3(%rip),%rdi
xor    %esi,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"Invalid usage. Please run like: ./asm <input_filename> <output_filename>\00"
define void @check_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @error(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32* null)
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c"Invalid usage. Please run like: ./asm <input_filename> <output_filename>\00"
define void @check_usage(i32 %0) {
%2 = icmp eq i32 %0, 3
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @error(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32* null)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ v;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
__attribute__((__unused__)) __attribute__((__nonnull__)) uint16_t
gdnsd_get_una16(const uint8_t *p) {
  uint16_t v;
  memcpy(&v, p, sizeof(v));
  return v;
}


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

x86 assembly (clang, -O2):
<gdnsd_get_una16>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gdnsd_get_una16(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
int main() {
  int s1 = 0, s2 = 0, i;
  for (i = 1; i < 101; i++) {
    s1 += i * i;
    s2 += i;
  }
  int result = s2 * s2 - s1;
  if (result != 25164150)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x65,-0x10(%rbp)
jge    114e <main+0x4e>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <main+0x20>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x17ff976,-0x14(%rbp)
je     1174 <main+0x74>
movl   $0x1,-0x4(%rbp)
jmp    117b <main+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
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 0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 101
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %2
%14 = add nsw i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
br label %18
18: ; preds = %9
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %6
21: ; preds = %6
%22 = load i32, i32* %3
%23 = load i32, i32* %3
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %2
%26 = sub nsw i32 %24, %25
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = icmp ne i32 %27, 25164150
br i1 %28, label %29, label %30
29: ; preds = %21
store i32 1, i32* %1
br label %31
30: ; preds = %21
store i32 0, i32* %1
br label %31
31: ; preds = %30, %29
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void do_bullet_indent(int indent) {
  int i;
  int n;
  n = indent - 2;
  for (i = 0; i < indent; i++)
    putchar((i == n) ? '-' : ' ');
}


x86 assembly (clang, -O0):
<do_bullet_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1162 <do_bullet_indent+0x52>
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%esi
mov    $0x20,%eax
mov    $0x2d,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <do_bullet_indent+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_bullet_indent>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1135 <do_bullet_indent+0x25>
mov    %edi,%ebx
mov    $0x2d,%ebp
xchg   %ax,%ax
cmp    $0x2,%ebx
mov    $0x20,%edi
cmove  %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <do_bullet_indent+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @do_bullet_indent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 2
store i32 %6, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %19, %1
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = icmp eq i32 %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 45, i32 32
%17 = trunc i32 %16 to i8
%18 = call i32 @putchar(i8 signext %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @do_bullet_indent(i32 %0) {
%2 = add nsw i32 %0, -2
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ 0, %1 ]
%6 = icmp eq i32 %5, %2
%7 = select i1 %6, i8 45, i8 32
%8 = tail call i32 @putchar(i8 signext %7)
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void overflow() {
  register int i = 0;
  char foo[30];
  for (i = 0; i < 50; i++)
    foo[i] = 42;
}


x86 assembly (clang, -O0):
<overflow>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1133 <overflow+0x33>
movslq -0x4(%rbp),%rax
movb   $0x2a,-0x30(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <overflow+0x12>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @overflow() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 50
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 %8
store i8 42, i8* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @overflow() {
ret void
}
int cmp_int(void *v1, void *v2) {
  int a = *((int *)v1);
  int b = *((int *)v2);
  return (a == b) ? 0 : ((a > b) ? 1 : -1);
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1134 <cmp_int+0x34>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <cmp_int+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setg   %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp sgt i32 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 -1
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ 0, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = select i1 %8, i32 1, i32 -1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int service_postgres_init(char *ip, int sp, unsigned char options,
                          char *miscptr, FILE *fp, int port) {
  return 0;
}


x86 assembly (clang, -O0):
<service_postgres_init>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @service_postgres_init(i8* %0, i32 %1, i8 zeroext %2, i8* %3, i32* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8 %2, i8* %9
store i8* %3, i8** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @service_postgres_init(i8* nocapture readnone %0, i32 %1, i8 zeroext %2, i8* nocapture readnone %3, i32* nocapture readnone %4, i32 %5) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ maxNumber(int *, int, int *, int, int, int *);
int main() {
  int returnSize = 0;
  int nums1[] = {3, 4, 6, 5};
  int nums2[] = {9, 1, 2, 5, 8, 3};
  maxNumber(nums1, 4, nums2, 6, 5, &returnSize);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rdx
mov    $0x4,%esi
mov    $0x6,%ecx
mov    $0x5,%r8d
lea    -0x4(%rbp),%r9
call   1030 <maxNumber@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movl   $0x0,0xc(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xef1(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x30(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r9
mov    $0x4,%esi
mov    $0x6,%ecx
mov    $0x5,%r8d
call   1030 <maxNumber@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.nums1 = [4 x i32] [i32 3, i32 4, i32 6, i32 5]
@__const.main.nums2 = [6 x i32] [i32 9, i32 1, i32 2, i32 5, i32 8, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [6 x i32]
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = bitcast [6 x i32]* %3 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%8 = call i32 @maxNumber(i32* %6, i32 4, i32* %7, i32 6, i32 5, i32* %1)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums1 = [4 x i32] [i32 3, i32 4, i32 6, i32 5]
@__const.main.nums2 = [6 x i32] [i32 9, i32 1, i32 2, i32 5, i32 8, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [6 x i32]
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast [4 x i32]* %2 to i8*
%6 = bitcast [6 x i32]* %3 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%9 = call i32 @maxNumber(i32* %7, i32 4, i32* %8, i32 6, i32 5, i32* %1)
ret i32 0
}
int isbyte(int n) { return n >= 0 && n <= 255; }


x86 assembly (clang, -O0):
<isbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1123 <isbyte+0x23>
cmpl   $0xff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbyte>:
xor    %eax,%eax
cmp    $0x100,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isbyte(i32 %0) {
%2 = icmp ult i32 %0, 256
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
void *getdladdr(const char *s) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @getdladdr(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void post_shmget(int syscallret) {
  if (syscallret == -1)
    return;
  shmctl(syscallret, IPC_RMID, 0);
}


x86 assembly (clang, -O0):
<post_shmget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    112a <post_shmget+0x1a>
jmp    113d <post_shmget+0x2d>
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <shmctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<post_shmget>:
cmp    $0xffffffff,%edi
je     1125 <post_shmget+0x15>
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <shmctl@plt>
ret

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

LLVM IR (-O2):
@IPC_RMID = global i32 0
define void @post_shmget(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @IPC_RMID
%5 = tail call i32 @shmctl(i32 %0, i32 %4, i32 0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yyparse();
int main() {
  printf("Enter a regular expression : \n");
  yyparse();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Enter a regular expression : \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @yyparse()
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"Enter a regular expression : \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @yyparse()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lflush();
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int getcharacter() {
  char byt;
  lflush();
  read(0, &byt, 1);
  return (byt);
}


x86 assembly (clang, -O0):
<getcharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <lflush@plt>
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcharacter>:
push   %rax
xor    %eax,%eax
call   1040 <lflush@plt>
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getcharacter() {
%1 = alloca i8
%2 = call i32 (...) @lflush()
%3 = call i32 @read(i32 0, i8* %1, i32 1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @getcharacter() {
%1 = alloca i8
%2 = tail call i32 (...) @lflush()
%3 = call i32 @read(i32 0, i8* %1, i32 1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ c_hecmw2fstr_connect_conv(int, int *, int *, int *);
void hecmw2fstr_connect_conv(int *n_elem, int elem_type[],
                             int elem_node_index[], int elem_node_item[]) {
  c_hecmw2fstr_connect_conv(*n_elem, elem_type, elem_node_index,
                            elem_node_item);
}


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

x86 assembly (clang, -O2):
<hecmw2fstr_connect_conv>:
mov    (%rdi),%edi
jmp    1030 <c_hecmw2fstr_connect_conv@plt>

LLVM IR (-O0):
define void @hecmw2fstr_connect_conv(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = call i32 @c_hecmw2fstr_connect_conv(i32 %10, i32* %11, i32* %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @hecmw2fstr_connect_conv(i32* nocapture %0, i32* %1, i32* %2, i32* %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @c_hecmw2fstr_connect_conv(i32 %5, i32* %1, i32* %2, i32* %3)
ret void
}
void TimerTickPeriodSet(unsigned int ulTime) {}


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

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

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

LLVM IR (-O2):
define void @TimerTickPeriodSet(i32 %0) {
ret void
}
int F2() { return 1.2; }


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

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

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

LLVM IR (-O2):
define i32 @F2() {
ret i32 1
}
/* Type definitions */
struct lexer_state {
  int dummy;
};

/* Variables and functions */
int next_char(struct lexer_state *);
int ucpp_grap_char(struct lexer_state *ls) { return next_char(ls); }


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

x86 assembly (clang, -O2):
<ucpp_grap_char>:
jmp    1030 <next_char@plt>

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

LLVM IR (-O2):
%struct.lexer_state = type { i32 }
define i32 @ucpp_grap_char(%struct.lexer_state* %0) {
%2 = tail call i32 @next_char(%struct.lexer_state* %0)
ret i32 %2
}
char __ocl_convert_char_short(short src) { return (char)src; }


x86 assembly (clang, -O0):
<__ocl_convert_char_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @__ocl_convert_char_short(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = trunc i16 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @__ocl_convert_char_short(i16 signext %0) {
%2 = trunc i16 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ sink(int /*<<< orphan*/, char);
__attribute__((noipa)) void fca1(char a[1]) {
  sink(0, a[0]);
  sink(0, a[1]);
}


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

x86 assembly (clang, -O2):
<fca1>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%esi
xor    %edi,%edi
call   1030 <sink@plt>
movsbl 0x1(%rbx),%esi
xor    %edi,%edi
pop    %rbx
jmp    1030 <sink@plt>

LLVM IR (-O0):
define void @fca1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @sink(i32 0, i8 signext %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = call i32 @sink(i32 0, i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @fca1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @sink(i32 0, i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @sink(i32 0, i8 signext %5)
ret void
}
/* Variables and functions */
int conv2d(char const *);
int CompilerYear(const char *date) { return conv2d(date + 9); }


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

x86 assembly (clang, -O2):
<CompilerYear>:
add    $0x9,%rdi
jmp    1030 <conv2d@plt>

LLVM IR (-O0):
define i32 @CompilerYear(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 9
%5 = call i32 @conv2d(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CompilerYear(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 9
%3 = tail call i32 @conv2d(i8* %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ pow(double, int);
double sqrt(scalar_t__);
double distance(double x1, double x2, double y1, double y2) {
  return sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,(%rsp)
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @distance(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* %5
%11 = fsub double %9, %10
%12 = call i64 @pow(double %11, i32 2)
%13 = load double, double* %8
%14 = load double, double* %7
%15 = fsub double %13, %14
%16 = call i64 @pow(double %15, i32 2)
%17 = add nsw i64 %12, %16
%18 = call double @sqrt(i64 %17)
ret double %18
}

LLVM IR (-O2):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = fsub double %1, %0
%6 = tail call i64 @pow(double %5, i32 2)
%7 = fsub double %3, %2
%8 = tail call i64 @pow(double %7, i32 2)
%9 = add nsw i64 %8, %6
%10 = tail call double @sqrt(i64 %9)
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct cbor_buf {
  int dummy;
};

/* Variables and functions */
int cbor_buf_append_5byte(struct cbor_buf *, int, int /*<<< orphan*/);
bool cbor_add_float(struct cbor_buf *buf, float x) {
  union {
    uint32_t n;
    float x;
  } tmp = {.x = x};
  return cbor_buf_append_5byte(buf, 0xfa, tmp.n);
}


x86 assembly (clang, -O0):
<cbor_add_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    $0xfa,%esi
call   1030 <cbor_buf_append_5byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbor_add_float>:
movd   %xmm0,%edx
mov    $0xfa,%esi
jmp    1030 <cbor_buf_append_5byte@plt>

LLVM IR (-O0):
%struct.cbor_buf = type { i32 }
%union.anon = type { i32 }
define i32 @cbor_add_float(%struct.cbor_buf* %0, float %1) {
%3 = alloca %struct.cbor_buf*
%4 = alloca float
%5 = alloca %union.anon
store %struct.cbor_buf* %0, %struct.cbor_buf** %3
store float %1, float* %4
%6 = bitcast %union.anon* %5 to float*
%7 = load float, float* %4
store float %7, float* %6
%8 = load %struct.cbor_buf*, %struct.cbor_buf** %3
%9 = bitcast %union.anon* %5 to i32*
%10 = load i32, i32* %9
%11 = call i32 @cbor_buf_append_5byte(%struct.cbor_buf* %8, i32 250, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.cbor_buf = type { i32 }
define i32 @cbor_add_float(%struct.cbor_buf* %0, float %1) {
%3 = bitcast float %1 to i32
%4 = tail call i32 @cbor_buf_append_5byte(%struct.cbor_buf* %0, i32 250, i32 %3)
ret i32 %4
}
float erfcf(float x) { return 0.0; }


x86 assembly (clang, -O0):
<erfcf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @erfcf(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @erfcf(float %0) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void commit_adisk() {
  char cmd[256];
  memset(cmd, 0, 256);
  sprintf(cmd, "echo -e \"  </service>\n</service-group>\" >> %s",
          "/etc/avahi/services/adisk.service");
  system(cmd);
}


x86 assembly (clang, -O0):
<commit_adisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x100(%rbp),%rdi
lea    0xea4(%rip),%rsi
lea    0xecb(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commit_adisk>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    0xeaf(%rip),%rsi
lea    0xed6(%rip),%rdx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"echo -e \22 </service>\0A</service-group>\22 >> %s\00"
@.str.1 = [34 x i8] c"/etc/avahi/services/adisk.service\00"
define void @commit_adisk() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 256)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = call i32 @system(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"echo -e \22 </service>\0A</service-group>\22 >> %s\00"
@.str.1 = [34 x i8] c"/etc/avahi/services/adisk.service\00"
define void @commit_adisk() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 256)
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @system(i8* %2)
ret void
}
double add_kernel(double v1, double v2) { return v1 + v2; }


x86 assembly (clang, -O0):
<add_kernel>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @add_kernel(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Type definitions */
typedef long time_t;

/* Variables and functions */
long time(int /*<<< orphan*/ *);
long authme_days_since_1970(void) {
  time_t t;
  long int seconds_per_day;
  seconds_per_day = 60 * 60 * 24;
  t = time(NULL);
  return (long)(t / seconds_per_day);
}


x86 assembly (clang, -O0):
<authme_days_since_1970>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x15180,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<authme_days_since_1970>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
movabs $0x1845c8a0ce512957,%rcx
c8 45 18
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xd,%rdx
add    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @authme_days_since_1970() {
%1 = alloca i64
%2 = alloca i64
store i64 86400, i64* %2
%3 = call i64 @time(i32* null)
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = load i64, i64* %2
%6 = sdiv i64 %4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @authme_days_since_1970() {
%1 = tail call i64 @time(i32* null)
%2 = sdiv i64 %1, 86400
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
int action(const char *path, int level, void *user __attribute__((unused))) {
  printf("%d: %s\n", level, path);
  if (level >= 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0x14(%rbp)
jl     114c <action+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <action+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<action>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
cmp    $0x2,%ebx
setge  %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %s\0A\00"
define i32 @action(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%5 = icmp sgt i32 %1, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
void gtk_icon_view_get_margin() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_margin() {
ret void
}