xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void draw_point(int fd, int x, int y) {
  char ch = '0';
  lseek(fd, y * (40 + 1) + x, SEEK_SET);
  write(fd, &ch, 1);
}


x86 assembly (clang, -O0):
<draw_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movb   $0x30,-0xd(%rbp)
mov    -0x4(%rbp),%edi
imul   $0x29,-0xc(%rbp),%esi
add    -0x8(%rbp),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
mov    -0x4(%rbp),%edi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_point>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0x30,0xf(%rsp)
lea    (%rdx,%rdx,4),%eax
lea    (%rdx,%rax,8),%eax
add    %eax,%esi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
lea    0xf(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @draw_point(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i8 48, i8* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = mul nsw i32 %9, 41
%11 = load i32, i32* %5
%12 = add nsw i32 %10, %11
%13 = load i32, i32* @SEEK_SET
%14 = call i32 @lseek(i32 %8, i32 %12, i32 %13)
%15 = load i32, i32* %4
%16 = call i32 @write(i32 %15, i8* %7, i32 1)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @draw_point(i32 %0, i32 %1, i32 %2) {
%4 = alloca i8
store i8 48, i8* %4
%5 = mul nsw i32 %2, 41
%6 = add nsw i32 %5, %1
%7 = load i32, i32* @SEEK_SET
%8 = tail call i32 @lseek(i32 %0, i32 %6, i32 %7)
%9 = call i32 @write(i32 %0, i8* %4, i32 1)
ret void
}
/* Variables and functions */
long double tanl(long double);
long double tand(long double x) {
  return tanl(x / 180.0L * 3.141592653589793238462643383279502884L);
}


x86 assembly (clang, -O0):
<tand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xed9(%rip)
fdivrp %st,%st(1)
fldt   0xee1(%rip)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <tanl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tand>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fdivs  0xee2(%rip)
fldt   0xeec(%rip)
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1030 <tanl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @tand(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fdiv x86_fp80 %3, 0xK4006B400000000000000
%5 = fmul x86_fp80 %4, 0xK4000C90FDAA22168C235
%6 = call x86_fp80 @tanl(x86_fp80 %5)
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @tand(x86_fp80 %0) {
%2 = fdiv x86_fp80 %0, 0xK4006B400000000000000
%3 = fmul x86_fp80 %2, 0xK4000C90FDAA22168C235
%4 = tail call x86_fp80 @tanl(x86_fp80 %3)
ret x86_fp80 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void *LONG_MAX;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ SEEK_SET;
int fseek(int /*<<< orphan*/ *, scalar_t__, int /*<<< orphan*/);
int u64_fseek(FILE *f, uint64_t off) {
  if (sizeof(long) >= 8) {
    int r = fseek(f, off, SEEK_SET);
    return r;
  } else {
    uint64_t m = LONG_MAX;
    long ml = LONG_MAX;
    if (off > m) {
      int r = fseek(f, ml, SEEK_SET);
      if (r)
        return r;
      uint64_t l = off - m;
      for (;;) {
        if (l > m) {
          int r = fseek(f, ml, SEEK_CUR);
          if (r)
            return r;
          l -= m;
        } else {
          int r = fseek(f, l, SEEK_CUR);
          return r;
        }
      }
    } else {
      int r = fseek(f, off, SEEK_SET);
      return r;
    }
  }
  return 0;
}


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

x86 assembly (clang, -O2):
<u64_fseek>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@LONG_MAX = global i8* null
@SEEK_CUR = global i32 0
define i32 @u64_fseek(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i64, i64* %4
%8 = load i32, i32* @SEEK_SET
%9 = call i32 @fseek(i32* %6, i64 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@LONG_MAX = global i8* null
@SEEK_CUR = global i32 0
define i32 @u64_fseek(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i32* %0, i64 %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
unsigned int exynos_dwmci_init(unsigned int, int, int);
int samsung_get_base_mmc();
unsigned int exynos_dwmmc_init(int index, int bus_width) {
  unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
  return exynos_dwmci_init(base, bus_width, index);
}


x86 assembly (clang, -O0):
<exynos_dwmmc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <samsung_get_base_mmc@plt>
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <exynos_dwmci_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exynos_dwmmc_init>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <samsung_get_base_mmc@plt>
mov    %ebp,%edi
shl    $0x10,%edi
add    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <exynos_dwmci_init@plt>

LLVM IR (-O0):
define i32 @exynos_dwmmc_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @samsung_get_base_mmc()
%7 = load i32, i32* %3
%8 = mul nsw i32 65536, %7
%9 = add nsw i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = call i32 @exynos_dwmci_init(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @exynos_dwmmc_init(i32 %0, i32 %1) {
%3 = tail call i32 (...) @samsung_get_base_mmc()
%4 = shl nsw i32 %0, 16
%5 = add nsw i32 %3, %4
%6 = tail call i32 @exynos_dwmci_init(i32 %5, i32 %1, i32 %0)
ret i32 %6
}
/* Variables and functions */
scalar_t__ __rint(double);
long double __rintl(long double x) { return ((long double)__rint((double)x)); }


x86 assembly (clang, -O0):
<__rintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <__rint@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rintl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <__rint@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @__rint(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @__rintl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @__rint(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
int is_valid_grade(int n) {
  if (0 <= n && n <= 100) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_valid_grade>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     1128 <is_valid_grade+0x28>
cmpl   $0x64,-0x8(%rbp)
jg     1128 <is_valid_grade+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <is_valid_grade+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_valid_grade(i32 %0) {
%2 = icmp ult i32 %0, 101
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int socketpair(int, int, int, int *);
int plat_socketpair(int domain, int type, int protocol, int sv[2]) {
  return (socketpair(domain, type, protocol, sv));
}


x86 assembly (clang, -O0):
<plat_socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <socketpair@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plat_socketpair>:
jmp    1030 <socketpair@plt>

LLVM IR (-O0):
define i32 @plat_socketpair(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* %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @socketpair(i32 %9, i32 %10, i32 %11, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @plat_socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3)
ret i32 %5
}
/* Variables and functions */
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
void removeBeforeComment(char *strInput, char *strResult) {
  char *tmp;
  tmp = strchr(strInput, ';');
  strcpy(strResult, tmp);
  return;
}


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

x86 assembly (clang, -O2):
<removeBeforeComment>:
push   %rbx
mov    %rsi,%rbx
mov    $0x3b,%esi
call   1040 <strchr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @removeBeforeComment(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strchr(i8* %6, i8 signext 59)
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @strcpy(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @removeBeforeComment(i8* %0, i8* %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 59)
%4 = tail call i32 @strcpy(i8* %1, i8* %3)
ret void
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int /*<<< orphan*/);
extern struct SN_env *german_ISO_8859_1_create_env(void) {
  return SN_create_env(0, 3, 0);
}


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

x86 assembly (clang, -O2):
<german_ISO_8859_1_create_env>:
xor    %edi,%edi
mov    $0x3,%esi
xor    %edx,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @german_ISO_8859_1_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 3, i32 0)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @german_ISO_8859_1_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 3, i32 0)
ret %struct.SN_env* %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float uf10_to_f32(int);
float uf11_to_f32(int);
void r11g11b10f_to_float3(uint32_t rgb, float retval[3]) {
  retval[0] = uf11_to_f32(rgb & 0x7ff);
  retval[1] = uf11_to_f32((rgb >> 11) & 0x7ff);
  retval[2] = uf10_to_f32((rgb >> 22) & 0x3ff);
}


x86 assembly (clang, -O0):
<r11g11b10f_to_float3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
and    $0x7ff,%edi
call   1030 <uf11_to_f32@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%edi
sar    $0xb,%edi
and    $0x7ff,%edi
call   1030 <uf11_to_f32@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x4(%rbp),%edi
sar    $0x16,%edi
and    $0x3ff,%edi
call   1040 <uf10_to_f32@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r11g11b10f_to_float3>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
and    $0x7ff,%edi
call   1030 <uf11_to_f32@plt>
movss  %xmm0,(%rbx)
mov    %ebp,%edi
shr    $0xb,%edi
and    $0x7ff,%edi
call   1030 <uf11_to_f32@plt>
movss  %xmm0,0x4(%rbx)
shr    $0x16,%ebp
mov    %ebp,%edi
call   1040 <uf10_to_f32@plt>
movss  %xmm0,0x8(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @r11g11b10f_to_float3(i32 %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
store i32 %0, i32* %3
store float* %1, float** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 2047
%7 = call float @uf11_to_f32(i32 %6)
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 11
%12 = and i32 %11, 2047
%13 = call float @uf11_to_f32(i32 %12)
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
store float %13, float* %15
%16 = load i32, i32* %3
%17 = ashr i32 %16, 22
%18 = and i32 %17, 1023
%19 = call float @uf10_to_f32(i32 %18)
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 2
store float %19, float* %21
ret void
}

LLVM IR (-O2):
define void @r11g11b10f_to_float3(i32 %0, float* nocapture writeonly %1) {
%3 = and i32 %0, 2047
%4 = tail call float @uf11_to_f32(i32 %3)
store float %4, float* %1
%5 = lshr i32 %0, 11
%6 = and i32 %5, 2047
%7 = tail call float @uf11_to_f32(i32 %6)
%8 = getelementptr inbounds float, float* %1, i64 1
store float %7, float* %8
%9 = lshr i32 %0, 22
%10 = tail call float @uf10_to_f32(i32 %9)
%11 = getelementptr inbounds float, float* %1, i64 2
store float %10, float* %11
ret void
}
/* Variables and functions */
int PLIT(int);
int NLIT(int v) { return 1 + (PLIT(v)); }


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

x86 assembly (clang, -O2):
<NLIT>:
push   %rax
call   1030 <PLIT@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @NLIT(i32 %0) {
%2 = tail call i32 @PLIT(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_OV7649(unsigned char uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_OV7649>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_OV7649>:
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_OV7649(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = trunc i16 %6 to i8
%8 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %5, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_OV7649(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %0, i8 zeroext %3)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void crc64_final(uint64_t *crc) { *crc ^= 0xffffffffffffffffULL; }


x86 assembly (clang, -O0):
<crc64_final>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
xor    $0xffffffffffffffff,%rcx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc64_final>:
notl   (%rdi)
ret

LLVM IR (-O0):
define void @crc64_final(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = xor i64 %5, -1
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
ret void
}

LLVM IR (-O2):
define void @crc64_final(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = xor i32 %2, -1
store i32 %3, i32* %0
ret void
}
void module1_section3_topic7() {}


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

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

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

LLVM IR (-O2):
define void @module1_section3_topic7() {
ret void
}
int security_file_set_fowner(struct file *file) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define i32 @security_file_set_fowner(%struct.file* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ sys_errmsg_die(char *);
__attribute__((unused)) void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (ptr == NULL && size != 0)
    sys_errmsg_die("out of memory");
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <xrealloc+0x43>
cmpq   $0x0,-0x10(%rbp)
je     1163 <xrealloc+0x43>
lea    0xea2(%rip),%rdi
call   1030 <sys_errmsg_die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <xrealloc+0x25>
test   %r14,%r14
jne    1145 <xrealloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <sys_errmsg_die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @sys_errmsg_die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
double sqrt(int);
double f_d(double e2) { return 1 - sqrt(1 - e2); }


x86 assembly (clang, -O0):
<f_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_d>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
movsd  0xed2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f_d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @sqrt(i32 %5)
%7 = fsub double 1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @f_d(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call double @sqrt(i32 %3)
%5 = fsub double 1.000000e+00, %4
ret double %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y_root;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
void set_XLeaveWindowEvent_y_root(void *_p, int _v) {
  ((XLeaveWindowEvent *)_p)->y_root = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XLeaveWindowEvent_y_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void handle_PIPE(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_PIPE(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ isPrime(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int noPrimes = 0, limit = 2000000, n;
  for (n = 0; n <= limit; n++) {
    if (isPrime(n))
      noPrimes++;
  }
  printf("pi(%d) = %d\n", limit, noPrimes);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1e8480,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     117e <main+0x5e>
mov    -0x10(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     116b <main+0x4b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1170 <main+0x50>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <main+0x24>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <isPrime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
add    $0x1,%ebp
cmp    $0x1e8481,%ebp
jne    1130 <main+0x10>
lea    0xeb0(%rip),%rdi
mov    $0x1e8480,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"pi(%d) = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 @isPrime(i32 %2)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
%7 = add nuw nsw i32 %3, %6
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 2000001
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 2000000, i32 %7)
ret i32 0
}
/* Variables and functions */
bool Util_caseInsensitiveCompare(char a, char b) {
  if (a >= 'a' && a <= 'z')
    a -= 'a' - 'A';
  if (b >= 'a' && b <= 'z')
    b -= 'a' - 'A';
  return a == b;
}


x86 assembly (clang, -O0):
<Util_caseInsensitiveCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1134 <Util_caseInsensitiveCompare+0x34>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1134 <Util_caseInsensitiveCompare+0x34>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1158 <Util_caseInsensitiveCompare+0x58>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1158 <Util_caseInsensitiveCompare+0x58>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_caseInsensitiveCompare>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%ecx
cmovae %edi,%ecx
lea    -0x61(%rsi),%eax
lea    -0x20(%rsi),%edx
cmp    $0x1a,%al
movzbl %dl,%edx
cmovae %esi,%edx
xor    %eax,%eax
cmp    %dl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @Util_caseInsensitiveCompare(i8 signext %0, i8 signext %1) {
%3 = add i8 %0, -97
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -32
%6 = select i1 %4, i8 %5, i8 %0
%7 = add i8 %1, -97
%8 = icmp ult i8 %7, 26
%9 = add i8 %1, -32
%10 = select i1 %8, i8 %9, i8 %1
%11 = icmp eq i8 %6, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void client_free(int *sock_fds) {
  close(sock_fds[0]);
  close(sock_fds[1]);
}


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

x86 assembly (clang, -O2):
<client_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <close@plt>
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @client_free(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @close(i32 %5)
ret void
}
int strcmp(const char *s1, const char *s2) {
  while ((*s1) && (*s1 == *s2)) {
    ++s1;
    ++s2;
  }
  return (*s1 - *s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movsbl %al,%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
void setup() { mkdir("folder-readonly", 0555); }


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x16d,%esi
call   1030 <mkdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
lea    0xee9(%rip),%rdi
mov    $0x16d,%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"folder-readonly\00"
define void @setup() {
%1 = call i32 @mkdir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 365)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"folder-readonly\00"
define void @setup() {
%1 = tail call i32 @mkdir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 365)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ASIC_SetMemPointers(unsigned char **, unsigned char **);
void ASIC_GateArray_RethinkMemory(unsigned char **pReadRamPtr,
                                  unsigned char **pWriteRamPtr) {
  ASIC_SetMemPointers(pReadRamPtr, pWriteRamPtr);
}


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

x86 assembly (clang, -O2):
<ASIC_GateArray_RethinkMemory>:
jmp    1030 <ASIC_SetMemPointers@plt>

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

LLVM IR (-O2):
define void @ASIC_GateArray_RethinkMemory(i8** %0, i8** %1) {
%3 = tail call i32 @ASIC_SetMemPointers(i8** %0, i8** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void handle(int s) {
  printf("!!!OOKK!!!\n");
  sleep(2);
  printf("!!!KK0000000!!!\n");
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"!!!OOKK!!!\0A\00"
@.str.1 = [17 x i8] c"!!!KK0000000!!!\0A\00"
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"!!!OOKK!!!\00"
@str.2 = [16 x i8] c"!!!KK0000000!!!\00"
define void @handle(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret void
}
void voice_chat_stop_recording(void) {}


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

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

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

LLVM IR (-O2):
define void @voice_chat_stop_recording() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mill_msleep(scalar_t__, char *);
scalar_t__ now();
__attribute__((no)) void dummy(void) {
  mill_msleep(
      (now() + 50),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/dailypips/libmill/refs/heads/master/tests/go.c"
      ":"
      "41");
}


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <now@plt>
mov    %rax,%rdi
add    $0x32,%rdi
lea    0xec7(%rip),%rsi
call   1030 <mill_msleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy>:
push   %rax
xor    %eax,%eax
call   1040 <now@plt>
lea    0x32(%rax),%rdi
lea    0xecd(%rip),%rsi
pop    %rax
jmp    1030 <mill_msleep@plt>

LLVM IR (-O0):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dailypips/libmill/refs/heads/master/tests/go.c:41\00"
define void @dummy() {
%1 = call i64 (...) @now()
%2 = add nsw i64 %1, 50
%3 = call i32 @mill_msleep(i64 %2, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dailypips/libmill/refs/heads/master/tests/go.c:41\00"
define void @dummy() {
%1 = tail call i64 (...) @now()
%2 = add nsw i64 %1, 50
%3 = tail call i32 @mill_msleep(i64 %2, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
void ActualizaNoSpeciesVsT(FILE *archivo, int Species, int T) {
  fprintf(archivo, "%d   %d\n", T, Species);
  return;
}


x86 assembly (clang, -O0):
<ActualizaNoSpeciesVsT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActualizaNoSpeciesVsT>:
mov    %esi,%ecx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d\0A\00"
define void @ActualizaNoSpeciesVsT(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d\0A\00"
define void @ActualizaNoSpeciesVsT(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %1)
ret void
}
int test_imm_4Euint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x4E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Euint64_highword_reg(i64 %0) {
%2 = and i64 %0, 335007449088
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Init_CoreAPI_Extension();
int /*<<< orphan*/ Init_Mediacapture_extension();
int /*<<< orphan*/ Init_Rhoconnectclient_extension();
void Init_Extensions(void) {
  Init_CoreAPI_Extension();
  Init_Rhoconnectclient_extension();
  Init_Mediacapture_extension();
}


x86 assembly (clang, -O0):
<Init_Extensions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Init_CoreAPI_Extension@plt>
mov    $0x0,%al
call   1050 <Init_Rhoconnectclient_extension@plt>
mov    $0x0,%al
call   1040 <Init_Mediacapture_extension@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init_Extensions>:
push   %rax
xor    %eax,%eax
call   1030 <Init_CoreAPI_Extension@plt>
xor    %eax,%eax
call   1050 <Init_Rhoconnectclient_extension@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Init_Mediacapture_extension@plt>

LLVM IR (-O0):
define void @Init_Extensions() {
%1 = call i32 (...) @Init_CoreAPI_Extension()
%2 = call i32 (...) @Init_Rhoconnectclient_extension()
%3 = call i32 (...) @Init_Mediacapture_extension()
ret void
}

LLVM IR (-O2):
define void @Init_Extensions() {
%1 = tail call i32 (...) @Init_CoreAPI_Extension()
%2 = tail call i32 (...) @Init_Rhoconnectclient_extension()
%3 = tail call i32 (...) @Init_Mediacapture_extension()
ret void
}
void Delay() {
  unsigned int i = 0x400000;
  while (i-- > 0) {
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x400000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jbe    1124 <Delay+0x24>
jmp    110b <Delay+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Delay() {
%1 = alloca i32
store i32 4194304, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = add i32 %3, -1
store i32 %4, i32* %1
%5 = icmp ugt i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @Delay() {
ret void
}
unsigned long le32_to_cpu(unsigned long x) {
  return (((x & 0x000000ffU) << 24) | ((x & 0x0000ff00U) << 8) |
          ((x & 0x00ff0000U) >> 8) | ((x & 0xff000000U) >> 24));
}


x86 assembly (clang, -O0):
<le32_to_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff0000,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
movabs $0xff000000,%rcx
and    -0x8(%rbp),%rcx
shr    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le32_to_cpu>:
mov    %rdi,%rax
bswap  %eax
ret

LLVM IR (-O0):
define i64 @le32_to_cpu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 255
%5 = shl i64 %4, 24
%6 = load i64, i64* %2
%7 = and i64 %6, 65280
%8 = shl i64 %7, 8
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = and i64 %10, 16711680
%12 = lshr i64 %11, 8
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = and i64 %14, 4278190080
%16 = lshr i64 %15, 24
%17 = or i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @le32_to_cpu(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
scalar_t__ byte_swap_u32(unsigned int);
int byte_swap_32(int x) { return (int)byte_swap_u32((unsigned int)x); }


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

x86 assembly (clang, -O2):
<byte_swap_32>:
jmp    1030 <byte_swap_u32@plt>

LLVM IR (-O0):
define i32 @byte_swap_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @byte_swap_u32(i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @byte_swap_32(i32 %0) {
%2 = tail call i64 @byte_swap_u32(i32 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void INT_Excep_SECURITY_RD(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SECURITY_RD() {
ret void
}
int fun325() { return 325; }


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

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

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

LLVM IR (-O2):
define i32 @fun325() {
ret i32 325
}
int get_memcfg_from_srat(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_memcfg_from_srat() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCGPGRP;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
pid_t tcgetpgrp(int fd) {
  int p;
  if (ioctl(fd, TIOCGPGRP, &p) < 0)
    return (pid_t)-1;
  return (pid_t)p;
}


x86 assembly (clang, -O0):
<tcgetpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1146 <tcgetpgrp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <tcgetpgrp+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetpgrp>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1135 <tcgetpgrp+0x25>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@TIOCGPGRP = global i32 0
define i32 @tcgetpgrp(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @TIOCGPGRP
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
void gtk_window_get_focus_on_map() {}


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

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

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

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