xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strsave(const char *str) {
  char *neww;
  if (!str)
    return 0;
  neww = malloc(strlen(str) + 1);
  strcpy(neww, str);
  return neww;
}


x86 assembly (clang, -O0):
<strsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strsave+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strsave+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsave>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <strsave+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <strsave+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strsave(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
double atanh(double x) { return 4; }


x86 assembly (clang, -O0):
<atanh>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanh>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @atanh(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @atanh(double %0) {
ret double 4.000000e+00
}
int register_process(const char *name) {
  asm volatile("movl %0, %%ebx" ::"m"(name) : "%ebx");
  return syscall(4);
}


x86 assembly (clang, -O0):
<register_process>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%ebx
mov    $0x4,%edi
mov    $0x0,%al
call   1030 <syscall@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_process>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
mov    0x8(%rsp),%ebx
mov    $0x4,%edi
xor    %eax,%eax
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @register_process(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, ...)*)(i32 4)
ret i32 %3
}

LLVM IR (-O2):
define i32 @register_process(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @syscall to i32 (i32, ...)*)(i32 4)
ret i32 %3
}
int test_imm_6Dint16_reg(short val) {
  return ((val) & (-0x6D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Dint16_reg>:
test   $0xff93,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Dint16_reg(i16 signext %0) {
%2 = and i16 %0, -109
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vc4();
int /*<<< orphan*/ take_struct_vc4(int /*<<< orphan*/);
void test_struct_vc4() { take_struct_vc4(return_struct_vc4()); }


x86 assembly (clang, -O0):
<test_struct_vc4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_vc4@plt>
mov    %eax,%edi
call   1030 <take_struct_vc4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_vc4>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_vc4@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_vc4@plt>

LLVM IR (-O0):
define void @test_struct_vc4() {
%1 = call i32 (...) @return_struct_vc4()
%2 = call i32 @take_struct_vc4(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vc4() {
%1 = tail call i32 (...) @return_struct_vc4()
%2 = tail call i32 @take_struct_vc4(i32 %1)
ret void
}
void HWBISTSelfTestRestart(void) {
  unsigned long ulAllowSave;
  ulAllowSave = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  (*((volatile unsigned long *)(0x400FBB00 + 0x00000014))) = 0x0000000a;
  (*((volatile unsigned long *)(0x400FB980))) = ulAllowSave;
}


x86 assembly (clang, -O0):
<HWBISTSelfTestRestart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb980,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    $0x400fb980,%eax
mov    $0xa5a5a5a5,%ecx
mov    %rcx,(%rax)
mov    $0x400fbb14,%eax
movq   $0xa,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0x400fb980,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HWBISTSelfTestRestart>:
mov    0x400fb980,%rax
40
mov    $0xa5a5a5a5,%ecx
mov    %rcx,0x400fb980
40
movq   $0xa,0x400fbb14
mov    %rax,0x400fb980
40
ret

LLVM IR (-O0):
define void @HWBISTSelfTestRestart() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store i64 %2, i64* %1
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 10, i64* inttoptr (i64 1074772756 to i64*)
%3 = load i64, i64* %1
store volatile i64 %3, i64* inttoptr (i64 1074772352 to i64*)
ret void
}

LLVM IR (-O2):
define void @HWBISTSelfTestRestart() {
%1 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 10, i64* inttoptr (i64 1074772756 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1074772352 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hex2int(int /*<<< orphan*/, int);
int /*<<< orphan*/ l_askNbytes(char *, char *, int /*<<< orphan*/, int);
char *long2str(char *, int /*<<< orphan*/);
char *macfailedN(char *arg) {
  *arg = '\0';
  return long2str(arg, hex2int(l_askNbytes(arg, "5e", 0, 8), 8));
}


x86 assembly (clang, -O0):
<macfailedN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
xor    %edx,%edx
mov    $0x8,%ecx
call   1030 <l_askNbytes@plt>
mov    %eax,%edi
mov    $0x8,%esi
call   1040 <hex2int@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <long2str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macfailedN>:
push   %rbx
mov    %rdi,%rbx
movb   $0x0,(%rdi)
lea    0xec2(%rip),%rsi
xor    %edx,%edx
mov    $0x8,%ecx
call   1030 <l_askNbytes@plt>
mov    %eax,%edi
mov    $0x8,%esi
call   1040 <hex2int@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1050 <long2str@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"5e\00"
define i8* @macfailedN(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8 0, i8* %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @l_askNbytes(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 8)
%7 = call i32 @hex2int(i32 %6, i32 8)
%8 = call i8* @long2str(i8* %4, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"5e\00"
define i8* @macfailedN(i8* %0) {
store i8 0, i8* %0
%2 = tail call i32 @l_askNbytes(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 8)
%3 = tail call i32 @hex2int(i32 %2, i32 8)
%4 = tail call i8* @long2str(i8* %0, i32 %3)
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h264avcc_init(uint8_t *p) {
  p[0] = 1;
  p[4] = 0xfc;
  p[5] = 0xe0;
}


x86 assembly (clang, -O0):
<h264avcc_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xfc,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0xe0,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264avcc_init>:
movl   $0x1,(%rdi)
movabs $0xe0000000fc,%rax
mov    %rax,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @h264avcc_init(i32* nocapture writeonly %0) {
store i32 1, i32* %0
%2 = getelementptr inbounds i32, i32* %0, i64 4
store i32 252, i32* %2
%3 = getelementptr inbounds i32, i32* %0, i64 5
store i32 224, i32* %3
ret void
}
double w_bar_1(double p) {
  double q = 1 - p;
  return 1.0 - q * (0.5) * (0.1);
}


x86 assembly (clang, -O0):
<w_bar_1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeed(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb5(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_bar_1>:
movsd  0xef8(%rip),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
mulsd  0xef0(%rip),%xmm1
mulsd  0xef0(%rip),%xmm1
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @w_bar_1(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = fmul double %6, 5.000000e-01
%8 = fneg double %7
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-01, double 1.000000e+00)
ret double %9
}

LLVM IR (-O2):
define double @w_bar_1(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %2, -5.000000e-01
%4 = tail call double @llvm.fmuladd.f64(double %3, double 1.000000e-01, double 1.000000e+00)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ X509_REQ;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_X509_REQ;
scalar_t__ i2d_X509_REQ;
int PEM_write_bio_X509_REQ(BIO *bp, X509_REQ *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_X509_REQ, PEM_STRING_X509_REQ,
                            bp, x, NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_X509_REQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_X509_REQ>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb7(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_X509_REQ = global i64 0
@PEM_STRING_X509_REQ = global i32 0
define i32 @PEM_write_bio_X509_REQ(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_X509_REQ
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509_REQ
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_X509_REQ = global i64 0
@PEM_STRING_X509_REQ = global i32 0
define i32 @PEM_write_bio_X509_REQ(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_X509_REQ
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_X509_REQ
%6 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Variables and functions */
int be2me_32(int /*<<< orphan*/);
int /*<<< orphan*/ unaligned32(void const *);
int unaligned32_be(const void *v) { return be2me_32(unaligned32(v)); }


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

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

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

LLVM IR (-O2):
define i32 @unaligned32_be(i8* %0) {
%2 = tail call i32 @unaligned32(i8* %0)
%3 = tail call i32 @be2me_32(i32 %2)
ret i32 %3
}
void vc_tagmanager_remove(unsigned int tag) {}


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

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

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

LLVM IR (-O2):
define void @vc_tagmanager_remove(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ isValidIMEI(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  char testIMEI[15] = {'3', '5', '1', '4', '5', '1', '2', '0',
                       '8', '4', '0', '1', '2', '1', '6'};
  if (isValidIMEI(testIMEI)) {
    printf("Valid IMEI\n");
  } else {
    printf("Invalid IMEI\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x1f(%rbp),%rdi
call   1030 <isValidIMEI@plt>
cmp    $0x0,%rax
je     1182 <main+0x62>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
jmp    118e <main+0x6e>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x3631323130343830,%rax
32 31 36
mov    %rax,0xf(%rsp)
movabs $0x3032313534313533,%rax
31 32 30
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <isValidIMEI@plt>
test   %rax,%rax
lea    0xeb9(%rip),%rax
lea    0xebf(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.testIMEI = [15 x i8] c"351451208401216"
@.str = [12 x i8] c"Valid IMEI\0A\00"
@.str.1 = [14 x i8] c"Invalid IMEI\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [15 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [15 x i8]* %6 to i8*
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%9 = call i64 @isValidIMEI(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret i32 0
}

LLVM IR (-O2):
@__const.main.testIMEI = [15 x i8] c"351451208401216"
@str = [13 x i8] c"Invalid IMEI\00"
@str.2 = [11 x i8] c"Valid IMEI\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [15 x i8]
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%5 = call i64 @isValidIMEI(i8* %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int ft_islower(int);
int ft_isupper(int);
int ft_isalpha(int c) { return (ft_isupper(c) + ft_islower(c)); }


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ft_isupper@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_islower@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <ft_isupper@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <ft_islower@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ft_isupper(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @ft_islower(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = tail call i32 @ft_isupper(i32 %0)
%3 = tail call i32 @ft_islower(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DebugTerms(char);
void IFD_DebugTOn(void) { DebugTerms('r'); }


x86 assembly (clang, -O0):
<IFD_DebugTOn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
call   1030 <DebugTerms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IFD_DebugTOn>:
mov    $0x72,%edi
jmp    1030 <DebugTerms@plt>

LLVM IR (-O0):
define void @IFD_DebugTOn() {
%1 = call i32 @DebugTerms(i8 signext 114)
ret void
}

LLVM IR (-O2):
define void @IFD_DebugTOn() {
%1 = tail call i32 @DebugTerms(i8 signext 114)
ret void
}
int func3(int x) {
#pragma critTer : 16 :../ test / resources / functionCommentReturn.c:
  return 0;
#pragma critTer : 17 :../ test / resources / functionCommentReturn.c:
}


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

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

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

LLVM IR (-O2):
define i32 @func3(i32 %0) {
ret i32 0
}
int do_112() { return 112; }


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

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

LLVM IR (-O0):
define i32 @do_112() {
ret i32 112
}

LLVM IR (-O2):
define i32 @do_112() {
ret i32 112
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf(
      "The Swiss Army Knife for CANopen networks\n\n"
      "nmt can-interface [start|stop|preop|reset-comm|reset-node] [node-id]\n"
      "sdo-upload can-interface node-id index subindex\n"
      "sdo-download can-interface node-id index subindex data\n"
      "heartbeat can-interface\n");
}


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

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

LLVM IR (-O0):
@.str = [240 x i8] c"The Swiss Army Knife for CANopen networks\0A\0Anmt can-interface [start|stop|preop|reset-comm|reset-node] [node-id]\0Asdo-upload can-interface node-id index subindex\0Asdo-download can-interface node-id index subindex data\0Aheartbeat can-interface\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [239 x i8] c"The Swiss Army Knife for CANopen networks\0A\0Anmt can-interface [start|stop|preop|reset-comm|reset-node] [node-id]\0Asdo-upload can-interface node-id index subindex\0Asdo-download can-interface node-id index subindex data\0Aheartbeat can-interface\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([239 x i8], [239 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_self();
int main() {
  pthread_self();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pthread_self()
ret i32 0
}
/* Variables and functions */
char *base64decode(char *, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void processKB(char *payload) {
  char *KBencoded = payload;
  int kbLen = KBencoded[0] | (KBencoded[1] << 8);
  KBencoded += 2;
  char *KB = base64decode(KBencoded, kbLen);
  printf("From IP: %s\n", KB);
  free(KB);
}


x86 assembly (clang, -O0):
<processKB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <base64decode@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processKB>:
push   %rbx
movsbl (%rdi),%eax
movsbl 0x1(%rdi),%esi
shl    $0x8,%esi
or     %eax,%esi
add    $0x2,%rdi
call   1050 <base64decode@plt>
mov    %rax,%rbx
lea    0xeb0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"From IP: %s\0A\00"
define void @processKB(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = shl i32 %14, 8
%16 = or i32 %10, %15
store i32 %16, i32* %4
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8* %18, i8** %3
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = call i8* @base64decode(i8* %19, i32 %20)
store i8* %21, i8** %5
%22 = load i8*, i8** %5
%23 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %5
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"From IP: %s\0A\00"
define void @processKB(i8* %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = tail call i8* @base64decode(i8* %9, i32 %8)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = tail call i32 @free(i8* %10)
ret void
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int bindToAddress(struct addrinfo *);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
struct addrinfo *getLocalAddressInfo(unsigned short);
int listenOnPort(unsigned short port) {
  int sock_fd;
  struct addrinfo *addrInfo;
  addrInfo = getLocalAddressInfo(port);
  if (!addrInfo)
    return 0;
  sock_fd = bindToAddress(addrInfo);
  freeaddrinfo(addrInfo);
  return sock_fd;
}


x86 assembly (clang, -O0):
<listenOnPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%edi
call   1030 <getLocalAddressInfo@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1163 <listenOnPort+0x33>
movl   $0x0,-0x4(%rbp)
jmp    117e <listenOnPort+0x4e>
mov    -0x18(%rbp),%rdi
call   1040 <bindToAddress@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <freeaddrinfo@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listenOnPort>:
push   %rbp
push   %rbx
push   %rax
call   1030 <getLocalAddressInfo@plt>
test   %rax,%rax
je     1156 <listenOnPort+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <bindToAddress@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <freeaddrinfo@plt>
mov    %ebp,%eax
jmp    1158 <listenOnPort+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define i32 @listenOnPort(i16 zeroext %0) {
%2 = alloca i32
%3 = alloca i16
%4 = alloca i32
%5 = alloca %struct.addrinfo*
store i16 %0, i16* %3
%6 = load i16, i16* %3
%7 = call %struct.addrinfo* @getLocalAddressInfo(i16 zeroext %6)
store %struct.addrinfo* %7, %struct.addrinfo** %5
%8 = load %struct.addrinfo*, %struct.addrinfo** %5
%9 = icmp ne %struct.addrinfo* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i32 0, i32* %2
br label %17
11: ; preds = %1
%12 = load %struct.addrinfo*, %struct.addrinfo** %5
%13 = call i32 @bindToAddress(%struct.addrinfo* %12)
store i32 %13, i32* %4
%14 = load %struct.addrinfo*, %struct.addrinfo** %5
%15 = call i32 @freeaddrinfo(%struct.addrinfo* %14)
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define i32 @listenOnPort(i16 zeroext %0) {
%2 = tail call %struct.addrinfo* @getLocalAddressInfo(i16 zeroext %0)
%3 = icmp eq %struct.addrinfo* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @bindToAddress(%struct.addrinfo* %2)
%6 = tail call i32 @freeaddrinfo(%struct.addrinfo* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int *malloc(int);
int main() {
  while (1) {
    int *p = malloc(1000000);
    getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf4240,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xf4240,%edi
call   1040 <malloc@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32* @malloc(i32 1000000)
store i32* %4, i32** %2
%5 = call i32 (...) @getchar()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32* @malloc(i32 1000000)
%3 = tail call i32 (...) @getchar()
br label %1
}
signed smin(signed a, signed b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<smin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <smin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <smin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @smin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ndm_endian_letoh32(int /*<<< orphan*/ const);
uint32_t ndm_endian_htole32(const uint32_t x) { return ndm_endian_letoh32(x); }


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

x86 assembly (clang, -O2):
<ndm_endian_htole32>:
jmp    1030 <ndm_endian_letoh32@plt>

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

LLVM IR (-O2):
define i32 @ndm_endian_htole32(i32 %0) {
%2 = tail call i32 @ndm_endian_letoh32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __NR_exit;
int /*<<< orphan*/ x86_syscall3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void linux_exit(int code) { x86_syscall3(__NR_exit, code, 0, 0); }


x86 assembly (clang, -O0):
<linux_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <x86_syscall3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linux_exit>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <x86_syscall3@plt>

LLVM IR (-O0):
@__NR_exit = global i32 0
define void @linux_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @__NR_exit
%4 = load i32, i32* %2
%5 = call i32 @x86_syscall3(i32 %3, i32 %4, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@__NR_exit = global i32 0
define void @linux_exit(i32 %0) {
%2 = load i32, i32* @__NR_exit
%3 = tail call i32 @x86_syscall3(i32 %2, i32 %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ avcodec_free_frame(void *);
void wrapped_frame_free(void *param) { avcodec_free_frame(param); }


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

x86 assembly (clang, -O2):
<wrapped_frame_free>:
jmp    1030 <avcodec_free_frame@plt>

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

LLVM IR (-O2):
define void @wrapped_frame_free(i8* %0) {
%2 = tail call i32 @avcodec_free_frame(i8* %0)
ret void
}
int main(int argc, const char *argv[]) {
  struct s1 {
    int a;
  } c;
  struct s2 {
    struct s1 b[2];
  } d;
  d.b[0] = c;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.s1 = type { i32 }
%struct.s2 = type { [2 x %struct.s1] }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.s1
%7 = alloca %struct.s2
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds %struct.s2, %struct.s2* %7, i32 0, i32 0
%9 = getelementptr inbounds [2 x %struct.s1], [2 x %struct.s1]* %8, i64 0, i64 0
%10 = bitcast %struct.s1* %9 to i8*
%11 = bitcast %struct.s1* %6 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int fibonacci(int n) {
  int f;
  if (n == -1)
    f = 0;
  if (n == 1 || n == 0)
    f = 1;
  else
    f = fibonacci(n - 1) + fibonacci(n - 2);
  return f;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    112c <fibonacci+0x1c>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1140 <fibonacci+0x30>
cmpl   $0x0,-0x4(%rbp)
jne    114c <fibonacci+0x3c>
movl   $0x1,-0x8(%rbp)
jmp    116f <fibonacci+0x5f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jb     1145 <fibonacci+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <fibonacci+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
int main() {
  int i;
  static int temp;
#pragma acc parallel reduction(+ : temp)
  { temp++; }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2f13(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0a(%rip)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
addl   $0x1,0x2f1d(%rip)
xor    %eax,%eax
ret

LLVM IR (-O0):
@main.temp = internal global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @main.temp
%4 = add nsw i32 %3, 1
store i32 %4, i32* @main.temp
ret i32 0
}

LLVM IR (-O2):
@main.temp = internal unnamed_addr global i32 0
define i32 @main() {
%1 = load i32, i32* @main.temp
%2 = add nsw i32 %1, 1
store i32 %2, i32* @main.temp
ret i32 0
}
float chop_ident(float x) { return (x); }


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

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

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

LLVM IR (-O2):
define float @chop_ident(float returned %0) {
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ msg(int, char *, char *, size_t);
void *msg_malloc(size_t size, char *msgstr) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL) {
    msg(0x100, "Malloc failed %s size %u\n", msgstr, size);
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<msg_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <msg_malloc+0x4b>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x100,%edi
lea    0xe94(%rip),%rsi
call   1050 <msg@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     114c <msg_malloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xead(%rip),%rsi
mov    $0x100,%edi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1050 <msg@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Malloc failed %s size %u\0A\00"
define i8* @msg_malloc(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i64, i64* %3
%13 = call i32 @msg(i32 256, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %11, i64 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [26 x i8] c"Malloc failed %s size %u\0A\00"
define noalias i8* @msg_malloc(i64 %0, i8* %1) {
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @msg(i32 256, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
int if_in_loop(int t) {
  int p = 0;
  int j = t + 1;
  for (int i = 0; i < 5; i++) {
    if (j < 2) {
      p++;
    } else {
      p = 3;
      for (int k = 0; k < 10; k++) {
        int m = 0;
      }
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<if_in_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1185 <if_in_loop+0x85>
cmpl   $0x2,-0xc(%rbp)
jge    1140 <if_in_loop+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <if_in_loop+0x72>
movl   $0x3,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    116d <if_in_loop+0x6d>
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <if_in_loop+0x4e>
jmp    1172 <if_in_loop+0x72>
jmp    1177 <if_in_loop+0x77>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111e <if_in_loop+0x1e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_in_loop>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
add    %eax,%eax
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @if_in_loop(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = select i1 %2, i32 5, i32 3
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
uint32_t ntohu32(const unsigned char *buf) { return be32toh(*(uint32_t *)buf); }


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

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

LLVM IR (-O0):
define i32 @ntohu32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @be32toh(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @ntohu32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @be32toh(i32 %3)
ret i32 %4
}
void glVertexAttribI4i(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttribI4i() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(int, char *);
void ipmi_delloem_getled_usage(void) {
  lprintf(5, "");
  lprintf(5, "   getled ");
  lprintf(5, "      Get Chassis ID LED state");
  lprintf(5, "");
}


x86 assembly (clang, -O0):
<ipmi_delloem_getled_usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
lea    0xeea(%rip),%rsi
call   1030 <lprintf@plt>
mov    $0x5,%edi
lea    0xecf(%rip),%rsi
call   1030 <lprintf@plt>
mov    $0x5,%edi
lea    0xec9(%rip),%rsi
call   1030 <lprintf@plt>
mov    $0x5,%edi
lea    0xeb7(%rip),%rsi
call   1030 <lprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipmi_delloem_getled_usage>:
push   %rbx
lea    0xef2(%rip),%rbx
mov    $0x5,%edi
mov    %rbx,%rsi
call   1030 <lprintf@plt>
lea    0xed4(%rip),%rsi
mov    $0x5,%edi
call   1030 <lprintf@plt>
lea    0xece(%rip),%rsi
mov    $0x5,%edi
call   1030 <lprintf@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <lprintf@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [11 x i8] c" getled \00"
@.str.2 = [31 x i8] c" Get Chassis ID LED state\00"
define void @ipmi_delloem_getled_usage() {
%1 = call i32 @lprintf(i32 5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @lprintf(i32 5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @lprintf(i32 5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @lprintf(i32 5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [11 x i8] c" getled \00"
@.str.2 = [31 x i8] c" Get Chassis ID LED state\00"
define void @ipmi_delloem_getled_usage() {
%1 = tail call i32 @lprintf(i32 5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @lprintf(i32 5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @lprintf(i32 5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @lprintf(i32 5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
int *func() {
  static int a = 5;
  return &a;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
lea    0x2f19(%rip),%rax
ret

LLVM IR (-O0):
@func.a = internal global i32 5
define i32* @func() {
ret i32* @func.a
}

LLVM IR (-O2):
@func.a = internal global i32 5
define i32* @func() {
ret i32* @func.a
}
int get2(char *s) {
  if (s[0] < '0' || s[0] > '9' || s[1] < '0' || s[1] > '9')
    return -1;
  return (s[0] - '0') * 10 + (s[1] - '0');
}


x86 assembly (clang, -O0):
<get2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     114a <get2+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     114a <get2+0x4a>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
jl     114a <get2+0x4a>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x39,%eax
jle    1156 <get2+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <get2+0x73>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get2>:
movsbl (%rdi),%ecx
lea    -0x3a(%rcx),%edx
mov    $0xffffffff,%eax
cmp    $0xf6,%dl
jb     1128 <get2+0x28>
movzbl 0x1(%rdi),%edx
lea    -0x3a(%rdx),%esi
cmp    $0xf6,%sil
jb     1128 <get2+0x28>
lea    (%rcx,%rcx,4),%eax
lea    (%rdx,%rax,2),%eax
add    $0xfffffdf0,%eax
ret

LLVM IR (-O0):
define i32 @get2(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 48
br i1 %8, label %27, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sgt i32 %13, 57
br i1 %14, label %27, label %15
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp slt i32 %19, 48
br i1 %20, label %27, label %21
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sgt i32 %25, 57
br i1 %26, label %27, label %28
27: ; preds = %21, %15, %9, %1
store i32 -1, i32* %2
br label %41
28: ; preds = %21
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 0
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %32, 48
%34 = mul nsw i32 %33, 10
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i64 1
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = sub nsw i32 %38, 48
%40 = add nsw i32 %34, %39
store i32 %40, i32* %2
br label %41
41: ; preds = %28, %27
%42 = load i32, i32* %2
ret i32 %42
}

LLVM IR (-O2):
define i32 @get2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add i8 %2, -58
%5 = icmp ult i8 %4, -10
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = add i8 %8, -58
%10 = icmp ult i8 %9, -10
br i1 %10, label %16, label %11
11: ; preds = %6
%12 = zext i8 %8 to i32
%13 = mul nsw i32 %3, 10
%14 = add nsw i32 %13, -528
%15 = add nsw i32 %14, %12
br label %16
16: ; preds = %1, %6, %11
%17 = phi i32 [ %15, %11 ], [ -1, %6 ], [ -1, %1 ]
ret i32 %17
}