xunge/DecIR huggingface dataset:
/* Variables and functions */
int sethostname(const char *name, size_t namelen) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sethostname(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
float ss2qess();
float ss2qess_() { return ss2qess(); }


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

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

LLVM IR (-O0):
define float @ss2qess_() {
%1 = call float (...) @ss2qess()
ret float %1
}

LLVM IR (-O2):
define float @ss2qess_() {
%1 = tail call float (...) @ss2qess()
ret float %1
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *p = s;
  while (*s != (char)0) {
    ++s;
  }
  return (size_t)(s - p);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <strlen+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_CLEAR_BIT(int, int);
void xburst_cgm_ungate_tssi1() { MIPS_CLEAR_BIT((0xB0000000 + 0x28), 1); }


x86 assembly (clang, -O0):
<xburst_cgm_ungate_tssi1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x1,%esi
call   1030 <MIPS_CLEAR_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_ungate_tssi1>:
mov    $0xb0000028,%edi
mov    $0x1,%esi
jmp    1030 <MIPS_CLEAR_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_ungate_tssi1() {
%1 = call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 1)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_ungate_tssi1() {
%1 = tail call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 1)
ret void
}
/* Variables and functions */
double LefGetXYViaWidth(int, int, int, int /*<<< orphan*/);
double LefGetViaWidth(int base, int layer, int dir) {
  return LefGetXYViaWidth(base, layer, dir, 0);
}


x86 assembly (clang, -O0):
<LefGetViaWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
call   1030 <LefGetXYViaWidth@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LefGetViaWidth>:
xor    %ecx,%ecx
jmp    1030 <LefGetXYViaWidth@plt>

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

LLVM IR (-O2):
define double @LefGetViaWidth(i32 %0, i32 %1, i32 %2) {
%4 = tail call double @LefGetXYViaWidth(i32 %0, i32 %1, i32 %2, i32 0)
ret double %4
}
/* Type definitions */
struct mfx_option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char **, char const *, struct mfx_option const *,
                     int *, int /*<<< orphan*/);
int mfx_getopt_long(int argc, char **argv, const char *options,
                    const struct mfx_option *long_options, int *opt_index) {
  return _getopt_internal(argc, argv, options, long_options, opt_index, 0);
}


x86 assembly (clang, -O0):
<mfx_getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfx_getopt_long>:
xor    %r9d,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.mfx_option = type { i32 }
define i32 @mfx_getopt_long(i32 %0, i8** %1, i8* %2, %struct.mfx_option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.mfx_option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.mfx_option* %3, %struct.mfx_option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.mfx_option*, %struct.mfx_option** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.mfx_option* %14, i32* %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.mfx_option = type { i32 }
define i32 @mfx_getopt_long(i32 %0, i8** %1, i8* %2, %struct.mfx_option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.mfx_option* %3, i32* %4, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ acosf(int);
float mlRadToDeg(int /*<<< orphan*/);
int mlVectorDotProduct(float const *, float const *);
int mlVectorNorm(float const *);
float mlVectorAngle(const float *a, const float *b) {
  return mlRadToDeg(
      acosf(mlVectorDotProduct(a, b) / (mlVectorNorm(a) * mlVectorNorm(b))));
}


x86 assembly (clang, -O0):
<mlVectorAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <mlVectorDotProduct@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mlVectorNorm@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mlVectorNorm@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <acosf@plt>
mov    %eax,%edi
call   1060 <mlRadToDeg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlVectorAngle>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <mlVectorDotProduct@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <mlVectorNorm@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <mlVectorNorm@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <acosf@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <mlRadToDeg@plt>

LLVM IR (-O0):
define float @mlVectorAngle(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @mlVectorDotProduct(float* %5, float* %6)
%8 = load float*, float** %3
%9 = call i32 @mlVectorNorm(float* %8)
%10 = load float*, float** %4
%11 = call i32 @mlVectorNorm(float* %10)
%12 = mul nsw i32 %9, %11
%13 = sdiv i32 %7, %12
%14 = call i32 @acosf(i32 %13)
%15 = call float @mlRadToDeg(i32 %14)
ret float %15
}

LLVM IR (-O2):
define float @mlVectorAngle(float* %0, float* %1) {
%3 = tail call i32 @mlVectorDotProduct(float* %0, float* %1)
%4 = tail call i32 @mlVectorNorm(float* %0)
%5 = tail call i32 @mlVectorNorm(float* %1)
%6 = mul nsw i32 %5, %4
%7 = sdiv i32 %3, %6
%8 = tail call i32 @acosf(i32 %7)
%9 = tail call float @mlRadToDeg(i32 %8)
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ multitable_crc32c(int /*<<< orphan*/, unsigned char const *,
                                     unsigned int);
int /*<<< orphan*/ singletable_crc32c(int /*<<< orphan*/, char const *,
                                      unsigned int);
uint32_t crc32c(uint32_t crc32c, const char *buffer, unsigned int length) {
  if (length < 4) {
    return (singletable_crc32c(crc32c, buffer, length));
  } else {
    return (multitable_crc32c(crc32c, (const unsigned char *)buffer, length));
  }
}


x86 assembly (clang, -O0):
<crc32c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jae    1153 <crc32c+0x33>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <singletable_crc32c@plt>
mov    %eax,-0x4(%rbp)
jmp    1165 <crc32c+0x45>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <multitable_crc32c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32c>:
cmp    $0x3,%edx
ja     112a <crc32c+0xa>
jmp    1030 <singletable_crc32c@plt>
jmp    1040 <multitable_crc32c@plt>

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

LLVM IR (-O2):
define i32 @crc32c(i32 %0, i8* %1, i32 %2) {
%4 = icmp ult i32 %2, 4
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @singletable_crc32c(i32 %0, i8* %1, i32 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @multitable_crc32c(i32 %0, i8* %1, i32 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
void format_skeleton_write(void) {}


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

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

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

LLVM IR (-O2):
define void @format_skeleton_write() {
ret void
}
unsigned int BCD2Binary(unsigned char value) {
  return ((value >> 4) * 10) + (value & 0xF);
}


x86 assembly (clang, -O0):
<BCD2Binary>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%eax
movzbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BCD2Binary>:
mov    %edi,%eax
shr    $0x4,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @BCD2Binary(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = mul nsw i32 %5, 10
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 15
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @BCD2Binary(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 4
%4 = mul nuw nsw i32 %3, 10
%5 = and i32 %2, 15
%6 = add nuw nsw i32 %4, %5
ret i32 %6
}
char **XListFonts() {}


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

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

LLVM IR (-O0):
define i8** @XListFonts() {
%1 = alloca i8**
%2 = load i8**, i8*** %1
ret i8** %2
}

LLVM IR (-O2):
define noalias i8** @XListFonts() {
ret i8** undef
}
int mul_c(int a, int b, int c) {
  if (a * b + c > 9)
    return (a * b + c) / 10;
  return 0;
}


x86 assembly (clang, -O0):
<mul_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x9,%eax
jle    113a <mul_c+0x3a>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1141 <mul_c+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_c>:
imul   %esi,%edi
add    %edx,%edi
xor    %eax,%eax
cmp    $0xa,%edi
jl     1123 <mul_c+0x23>
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mul_c(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = icmp sgt i32 %5, 9
%7 = sdiv i32 %5, 10
%8 = select i1 %6, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
void *htonl(unsigned long long);
unsigned long long ILibHTONLL(unsigned long long v) {
  {
    union {
      unsigned long lv[2];
      unsigned long long llv;
    } u;
    u.lv[0] = htonl(v >> 32);
    u.lv[1] = htonl(v & 0xFFFFFFFFULL);
    return u.llv;
  }
}


x86 assembly (clang, -O0):
<ILibHTONLL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shr    $0x20,%rdi
call   1030 <htonl@plt>
mov    %rax,-0x18(%rbp)
movabs $0xffffffff,%rdi
and    -0x8(%rbp),%rdi
call   1030 <htonl@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibHTONLL>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
shr    $0x20,%rdi
call   1030 <htonl@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1030 <htonl@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.anon = type { [2 x i64] }
define i64 @ILibHTONLL(i64 %0) {
%2 = alloca i64
%3 = alloca %union.anon
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 32
%6 = call i8* @htonl(i64 %5)
%7 = ptrtoint i8* %6 to i64
%8 = bitcast %union.anon* %3 to [2 x i64]*
%9 = getelementptr inbounds [2 x i64], [2 x i64]* %8, i64 0, i64 0
store i64 %7, i64* %9
%10 = load i64, i64* %2
%11 = and i64 %10, 4294967295
%12 = call i8* @htonl(i64 %11)
%13 = ptrtoint i8* %12 to i64
%14 = bitcast %union.anon* %3 to [2 x i64]*
%15 = getelementptr inbounds [2 x i64], [2 x i64]* %14, i64 0, i64 1
store i64 %13, i64* %15
%16 = bitcast %union.anon* %3 to i64*
%17 = load i64, i64* %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @ILibHTONLL(i64 %0) {
%2 = lshr i64 %0, 32
%3 = tail call i8* @htonl(i64 %2)
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %0, 4294967295
%6 = tail call i8* @htonl(i64 %5)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_variadic(int *, int *);
void f_variadic_inp_inp(void) {
  int t = 5;
  int u = 3;
  int *vp = &u;
  int *tp = &t;
  doStuff_variadic(tp, vp);
}


x86 assembly (clang, -O0):
<f_variadic_inp_inp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <doStuff_variadic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_variadic_inp_inp>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0x3,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <doStuff_variadic@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @f_variadic_inp_inp() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 3, i32* %2
%5 = call i32 @doStuff_variadic(i32* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delaygcc(unsigned long long);
int main(void) {
  delaygcc(10000000000ULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x2540be400,%rdi
call   1030 <delaygcc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x2540be400,%rdi
call   1030 <delaygcc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @delaygcc(i64 10000000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @delaygcc(i64 10000000000)
ret i32 0
}
void ff_frame_thread_encoder_init() {}


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

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

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

LLVM IR (-O2):
define void @ff_frame_thread_encoder_init() {
ret void
}
int msm_watchdog_disable(void) {}


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

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

LLVM IR (-O0):
define i32 @msm_watchdog_disable() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @msm_watchdog_disable() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strncmp(char *, char *, int);
int isfilename(char *string) {
  if (!strncmp(string, "====>", 5))
    return 1;
  if (!strncmp(string, "===>", 4))
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<isfilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1146 <isfilename+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1177 <isfilename+0x67>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1170 <isfilename+0x60>
movl   $0x2,-0x4(%rbp)
jmp    1177 <isfilename+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfilename>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     114a <isfilename+0x3a>
lea    0xed1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"====>\00"
@.str.1 = [5 x i8] c"===>\00"
define i32 @isfilename(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 2, i32 0
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void _M2_CharClass_init(__attribute__((unused)) int argc,
                        __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_CharClass_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
void get_card_name(char *card_name) {
  puts("Enter the card_name: ");
  scanf("%2s", card_name);
}


x86 assembly (clang, -O0):
<get_card_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_card_name>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the card_name: \00"
@.str.1 = [4 x i8] c"%2s\00"
define void @get_card_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter the card_name: \00"
@.str.1 = [4 x i8] c"%2s\00"
define void @get_card_name(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct ofpbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ofpbuf *);
int /*<<< orphan*/ ofpbuf_uninit(struct ofpbuf *);
void ofpbuf_delete(struct ofpbuf *b) {
  if (b) {
    ofpbuf_uninit(b);
    free(b);
  }
}


x86 assembly (clang, -O0):
<ofpbuf_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <ofpbuf_delete+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <ofpbuf_uninit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofpbuf_delete>:
test   %rdi,%rdi
je     1137 <ofpbuf_delete+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <ofpbuf_uninit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.ofpbuf = type { i32 }
define void @ofpbuf_delete(%struct.ofpbuf* %0) {
%2 = alloca %struct.ofpbuf*
store %struct.ofpbuf* %0, %struct.ofpbuf** %2
%3 = load %struct.ofpbuf*, %struct.ofpbuf** %2
%4 = icmp ne %struct.ofpbuf* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load %struct.ofpbuf*, %struct.ofpbuf** %2
%7 = call i32 @ofpbuf_uninit(%struct.ofpbuf* %6)
%8 = load %struct.ofpbuf*, %struct.ofpbuf** %2
%9 = call i32 @free(%struct.ofpbuf* %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.ofpbuf = type { i32 }
define void @ofpbuf_delete(%struct.ofpbuf* %0) {
%2 = icmp eq %struct.ofpbuf* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ofpbuf_uninit(%struct.ofpbuf* %0)
%5 = tail call i32 @free(%struct.ofpbuf* %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cafreemem(void *ptr, u_int nbytes) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @cafreemem(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
void clear_display_screen(void) {}


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

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

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

LLVM IR (-O2):
define void @clear_display_screen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x7a() {
  Assert_real((isgraph(122)),
              "/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_isgraph.c",
              615, ("isgraph should be 1 for z"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x7a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7a,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x267,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x7a>:
push   %rax
mov    $0x7a,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x267,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for z\00"
define void @t_isgraph_0x7a() {
%1 = call i32 @isgraph(i32 122)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for z\00"
define void @t_isgraph_0x7a() {
%1 = tail call i32 @isgraph(i32 122)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long fgetc(int /*<<< orphan*/ *);
void DumpLine(FILE *fp) {
  long c;
  while ((c = fgetc(fp)) != '\n')
    ;
}


x86 assembly (clang, -O0):
<DumpLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0xa,%rax
je     1138 <DumpLine+0x28>
jmp    111c <DumpLine+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpLine>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%rax
jne    1120 <DumpLine+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @DumpLine(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @fgetc(i32* %0)
%4 = icmp eq i64 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
long double __fmal(long double x, long double y, long double z) {
  return (x * y) + z;
}


x86 assembly (clang, -O0):
<__fmal>:
push   %rbp
mov    %rsp,%rbp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fmal>:
fldt   0x28(%rsp)
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fmulp  %st,%st(1)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @__fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load x86_fp80, x86_fp80* %4
%8 = load x86_fp80, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %6
%10 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %7, x86_fp80 %8, x86_fp80 %9)
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @__fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2)
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ getdata();
int /*<<< orphan*/ inputoptions();
int /*<<< orphan*/ makevalues();
int /*<<< orphan*/ makeweights();
void getinput() {
  inputoptions();
  getdata();
  makeweights();
  makevalues();
}


x86 assembly (clang, -O0):
<getinput>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <inputoptions@plt>
mov    $0x0,%al
call   1040 <getdata@plt>
mov    $0x0,%al
call   1030 <makeweights@plt>
mov    $0x0,%al
call   1050 <makevalues@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getinput>:
push   %rax
xor    %eax,%eax
call   1060 <inputoptions@plt>
xor    %eax,%eax
call   1040 <getdata@plt>
xor    %eax,%eax
call   1030 <makeweights@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <makevalues@plt>

LLVM IR (-O0):
define void @getinput() {
%1 = call i32 (...) @inputoptions()
%2 = call i32 (...) @getdata()
%3 = call i32 (...) @makeweights()
%4 = call i32 (...) @makevalues()
ret void
}

LLVM IR (-O2):
define void @getinput() {
%1 = tail call i32 (...) @inputoptions()
%2 = tail call i32 (...) @getdata()
%3 = tail call i32 (...) @makeweights()
%4 = tail call i32 (...) @makevalues()
ret void
}
/* Variables and functions */
int counter();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", counter());
  printf("%d\n", counter());
  printf("%d\n", counter());
  printf("%d\n", counter());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <counter@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <counter@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <counter@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <counter@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <counter@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <counter@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <counter@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <counter@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 (...) @counter()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @counter()
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @counter()
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @counter()
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @counter()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @counter()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @counter()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @counter()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_cases();
int main(int argc, char **argv) {
  test_cases();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_cases@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_cases()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_cases()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ help();
void usage(void) {
  help();
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <help@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1030 <help@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @usage() {
%1 = call i32 (...) @help()
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @usage() {
%1 = tail call i32 (...) @help()
%2 = tail call i32 @exit(i32 1)
unreachable
}
void getSumDifAndProduct(int a, int b, int *buff) {
  *buff++ = a + b;
  *buff++ = a - b;
  *buff = a * b;
}


x86 assembly (clang, -O0):
<getSumDifAndProduct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSumDifAndProduct>:
lea    (%rsi,%rdi,1),%eax
mov    %eax,(%rdx)
mov    %edi,%eax
sub    %esi,%eax
mov    %eax,0x4(%rdx)
imul   %edi,%esi
mov    %esi,0x8(%rdx)
ret

LLVM IR (-O0):
define void @getSumDifAndProduct(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %6
store i32 %9, i32* %10
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %6
store i32 %14, i32* %15
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = mul nsw i32 %17, %18
%20 = load i32*, i32** %6
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @getSumDifAndProduct(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add nsw i32 %1, %0
%5 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %4, i32* %2
%6 = sub nsw i32 %0, %1
%7 = getelementptr inbounds i32, i32* %2, i64 2
store i32 %6, i32* %5
%8 = mul nsw i32 %1, %0
store i32 %8, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testIf();
int /*<<< orphan*/ testIndirection();
int /*<<< orphan*/ testInit();
int /*<<< orphan*/ testLateAssignment();
int /*<<< orphan*/ testPA();
void main() {
  testIndirection();
  testLateAssignment();
  testIf();
  testInit();
  testPA();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <testIndirection@plt>
mov    $0x0,%al
call   1030 <testLateAssignment@plt>
mov    $0x0,%al
call   1050 <testIf@plt>
mov    $0x0,%al
call   1070 <testInit@plt>
mov    $0x0,%al
call   1040 <testPA@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <testIndirection@plt>
xor    %eax,%eax
call   1030 <testLateAssignment@plt>
xor    %eax,%eax
call   1050 <testIf@plt>
xor    %eax,%eax
call   1070 <testInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <testPA@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @testIndirection()
%2 = call i32 (...) @testLateAssignment()
%3 = call i32 (...) @testIf()
%4 = call i32 (...) @testInit()
%5 = call i32 (...) @testPA()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @testIndirection()
%2 = tail call i32 (...) @testLateAssignment()
%3 = tail call i32 (...) @testIf()
%4 = tail call i32 (...) @testInit()
%5 = tail call i32 (...) @testPA()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_min;
  int tm_sec;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int timer_hour_judge(time_t time) {
  int ret;
  struct tm *p;
  p = gmtime(&time);
  ret = p->tm_min;
  if (0 != ret)
    return 1;
  ret = p->tm_sec;
  if (0 != ret)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<timer_hour_judge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <gmtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
je     1148 <timer_hour_judge+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1170 <timer_hour_judge+0x60>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
je     1169 <timer_hour_judge+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1170 <timer_hour_judge+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_hour_judge>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <gmtime@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmpl   $0x0,(%rcx)
je     112e <timer_hour_judge+0x1e>
pop    %rcx
ret
xor    %eax,%eax
cmpl   $0x0,0x4(%rcx)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
define i32 @timer_hour_judge(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.tm*
store i32 %0, i32* %3
%6 = call %struct.tm* @gmtime(i32* %3)
store %struct.tm* %6, %struct.tm** %5
%7 = load %struct.tm*, %struct.tm** %5
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp ne i32 0, %10
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 1, i32* %2
br label %21
13: ; preds = %1
%14 = load %struct.tm*, %struct.tm** %5
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 1
%16 = load i32, i32* %15
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp ne i32 0, %17
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 1, i32* %2
br label %21
20: ; preds = %13
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19, %12
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
define i32 @timer_hour_judge(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @gmtime(i32* %2)
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %1
%13 = phi i32 [ 1, %1 ], [ %11, %7 ]
ret i32 %13
}
int sign(int val) {
  if (val < 0)
    return (-1);
  else
    return (1);
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <sign+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1124 <sign+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%eax
sar    $0x1f,%eax
or     $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
void *child(void *buf) {
  unsigned long childID = (unsigned long)buf;
  unsigned long idSquared = childID * childID;
  printf("Child #%lu computed %lu\n", childID, idSquared);
  return (void *)idSquared;
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rbx
mov    %rdi,%rsi
mov    %rdi,%rbx
imul   %rdi,%rbx
lea    0xede(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Child #%lu computed %lu\0A\00"
define i8* @child(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %3
%9 = mul i64 %7, %8
store i64 %9, i64* %4
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %10, i64 %11)
%13 = load i64, i64* %4
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"Child #%lu computed %lu\0A\00"
define i8* @child(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = mul i64 %2, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %2, i64 %3)
%5 = inttoptr i64 %3 to i8*
ret i8* %5
}
int test_imm_7Euint16_mem(unsigned short *val) {
  return ((*val) & (-0x7E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Euint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff82,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Euint16_mem>:
movzwl (%rdi),%eax
test   $0xff82,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -126
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void __attribute__((deprecated))
reconos_mmu_stats(int *tlb_hits, int *tlb_misses, int *page_faults) {
  *tlb_hits = 0;
  *tlb_misses = 0;
  *page_faults = 0;
}


x86 assembly (clang, -O0):
<reconos_mmu_stats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reconos_mmu_stats>:
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define void @reconos_mmu_stats(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
store i32 0, i32* %7
%8 = load i32*, i32** %5
store i32 0, i32* %8
%9 = load i32*, i32** %6
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
define void @reconos_mmu_stats(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %0
store i32 0, i32* %1
store i32 0, i32* %2
ret void
}
/* Variables and functions */
int strlen(char *);
void ungets(char s[]) {
  int len = strlen(s);
  void ungetch(int c);
  while (len > 0) {
    ungetch(s[--len]);
  }
}


x86 assembly (clang, -O0):
<ungets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1160 <ungets+0x40>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <ungetch@plt>
jmp    1138 <ungets+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <ungets+0x37>
mov    %eax,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsbl (%r14,%rax,1),%edi
call   1040 <ungetch@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1140 <ungets+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ungets(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, -1
store i32 %12, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ungets(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
tail call void @ungetch(i32 %12)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %1
ret void
}