xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void *, int);
void wMemMoveSafe(void *dst, void *src, int bytes, char *where) {
  memmove(dst, src, bytes);
}


x86 assembly (clang, -O0):
<wMemMoveSafe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wMemMoveSafe>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @wMemMoveSafe(i8* %0, i8* %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @memmove(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
void *OPLLCreate(int, int, int);
void *ym2413_init(int clock, int rate, int type) {
  return OPLLCreate(clock, rate, type);
}


x86 assembly (clang, -O0):
<ym2413_init>:
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
call   1030 <OPLLCreate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ym2413_init>:
jmp    1030 <OPLLCreate@plt>

LLVM IR (-O0):
define i8* @ym2413_init(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 i8* @OPLLCreate(i32 %7, i32 %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @ym2413_init(i32 %0, i32 %1, i32 %2) {
%4 = tail call i8* @OPLLCreate(i32 %0, i32 %1, i32 %2)
ret i8* %4
}
void *nop(void *p) { return p; }


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

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

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

LLVM IR (-O2):
define i8* @nop(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int lchown(const char *path, uid_t owner, gid_t group) { return 0; }


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

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

LLVM IR (-O0):
define i32 @lchown(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @lchown(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
size_t read_uint16(FILE *fp, uint16_t *i) {
  return fread(i, sizeof(*i), 1, fp);
}


x86 assembly (clang, -O0):
<read_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint16>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @read_uint16(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fread(i32* %1, i32 4, i32 1, i32* %0)
ret i64 %3
}
int trasposeVerify() {}


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

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

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

LLVM IR (-O2):
define i32 @trasposeVerify() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
char *my_mallocc(scalar_t__, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *my_strcpy(char *orig) {
  char *new;
  if (!orig)
    die("Copying empty string\n");
  new = my_mallocc(1 + strlen(orig), "string");
  strcpy(new, orig);
  return new;
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <my_strcpy+0x23>
lea    0xea2(%rip),%rdi
call   1060 <die@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
lea    0xe9c(%rip),%rsi
call   1050 <my_mallocc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
jne    1158 <my_strcpy+0x18>
lea    0xead(%rip),%rdi
call   1060 <die@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1050 <my_mallocc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Copying empty string\0A\00"
@.str.1 = [7 x i8] c"string\00"
define i8* @my_strcpy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @die(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i8*, i8** %2
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 1, %10
%12 = call i8* @my_mallocc(i64 %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [22 x i8] c"Copying empty string\0A\00"
@.str.1 = [7 x i8] c"string\00"
define i8* @my_strcpy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @die(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = add nsw i64 %6, 1
%8 = tail call i8* @my_mallocc(i64 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int _poweroff_error(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ sync();
int _poweroff(void) {
  sync();
  errno = ENOSYS;
  return _poweroff_error(NULL, 1);
  return 0;
}


x86 assembly (clang, -O0):
<_poweroff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sync@plt>
mov    0x2eb6(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9d(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <_poweroff_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_poweroff>:
push   %rax
xor    %eax,%eax
call   1040 <sync@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    0x2ea0(%rip),%rcx
mov    %eax,(%rcx)
xor    %edi,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <_poweroff_error@plt>

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_poweroff() {
%1 = call i32 (...) @sync()
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
%3 = call i32 @_poweroff_error(i32* null, i32 1)
ret i32 %3
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_poweroff() {
%1 = tail call i32 (...) @sync()
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
%3 = tail call i32 @_poweroff_error(i32* null, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ FatalError(char *, unsigned long);
void *calloc(unsigned long, int);
void *SnortAlloc(unsigned long size) {
  void *pv = calloc(size, sizeof(char));
  if (pv)
    return pv;
  FatalError("Unable to allocate memory!  (%lu requested)\n", size);
  return NULL;
}


x86 assembly (clang, -O0):
<SnortAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <SnortAlloc+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <SnortAlloc+0x4e>
mov    -0x10(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <FatalError@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SnortAlloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <SnortAlloc+0x28>
lea    0xec0(%rip),%rdi
mov    %r14,%rsi
call   1040 <FatalError@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Unable to allocate memory! (%lu requested)\0A\00"
define i8* @SnortAlloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @calloc(i64 %5, i32 1)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = call i32 @FatalError(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %12)
store i8* null, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [45 x i8] c"Unable to allocate memory! (%lu requested)\0A\00"
define i8* @SnortAlloc(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @FatalError(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
float toRadians(const float degrees) {
  return degrees * ((float)3.14159265359 / 180.0f);
}


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

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

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

LLVM IR (-O2):
define float @toRadians(float %0) {
%2 = fmul float %0, 0x3F91DF46A0000000
ret float %2
}
void sleepcp(int sleepMs) {}


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

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

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

LLVM IR (-O2):
define void @sleepcp(i32 %0) {
ret void
}
int TimerThreadLoop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @TimerThreadLoop() {
ret i32 0
}
long double testl(long double x, int sel1, int sel2) {
  long double input = sel1 ? -x : __builtin_fabsl(x);
  if (sel2)
    return __builtin_cosl(input);
  else
    return __builtin_sinl(input);
}


x86 assembly (clang, -O0):
<testl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     114b <testl+0x2b>
fldt   -0x20(%rbp)
fchs
fstpt  -0x4c(%rbp)
jmp    1153 <testl+0x33>
fldt   -0x20(%rbp)
fabs
fstpt  -0x4c(%rbp)
fldt   -0x4c(%rbp)
fstpt  -0x40(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1178 <testl+0x58>
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cosl@plt>
fstpt  -0x10(%rbp)
jmp    1188 <testl+0x68>
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
test   %edi,%edi
fld    %st(0)
fchs
fxch   %st(1)
fabs
fxch   %st(1)
fcmove %st(1),%st
fstp   %st(1)
test   %esi,%esi
je     1149 <testl+0x29>
fstpt  (%rsp)
call   1040 <cosl@plt>
add    $0x18,%rsp
ret
fstpt  (%rsp)
call   1030 <sinl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @testl(x86_fp80 %0, i32 %1, i32 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca i32
%7 = alloca i32
%8 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load x86_fp80, x86_fp80* %5
%13 = fneg x86_fp80 %12
br label %17
14: ; preds = %3
%15 = load x86_fp80, x86_fp80* %5
%16 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %15)
br label %17
17: ; preds = %14, %11
%18 = phi x86_fp80 [ %13, %11 ], [ %16, %14 ]
store x86_fp80 %18, x86_fp80* %8
%19 = load i32, i32* %7
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load x86_fp80, x86_fp80* %8
%23 = call x86_fp80 @cosl(x86_fp80 %22)
store x86_fp80 %23, x86_fp80* %4
br label %27
24: ; preds = %17
%25 = load x86_fp80, x86_fp80* %8
%26 = call x86_fp80 @sinl(x86_fp80 %25)
store x86_fp80 %26, x86_fp80* %4
br label %27
27: ; preds = %24, %21
%28 = load x86_fp80, x86_fp80* %4
ret x86_fp80 %28
}

LLVM IR (-O2):
define x86_fp80 @testl(x86_fp80 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = fneg x86_fp80 %0
%6 = tail call x86_fp80 @llvm.fabs.f80(x86_fp80 %0)
%7 = select i1 %4, x86_fp80 %6, x86_fp80 %5
%8 = icmp eq i32 %2, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call x86_fp80 @cosl(x86_fp80 %7)
br label %13
11: ; preds = %3
%12 = tail call x86_fp80 @sinl(x86_fp80 %7)
br label %13
13: ; preds = %11, %9
%14 = phi x86_fp80 [ %10, %9 ], [ %12, %11 ]
ret x86_fp80 %14
}
/* Variables and functions */
char getchar();
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int main() {
  char *p = NULL;
  p = (char *)malloc(sizeof(char));
  if (p == NULL) {
    printf("malloc memory failed!");
    return 0;
  }
  *p = getchar();
  putchar(*p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1188 <main+0x48>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11aa <main+0x6a>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1166 <main+0x26>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %al,(%rbx)
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1172 <main+0x32>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"malloc memory failed!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = call i64 @malloc(i32 1)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %15
9: ; preds = %0
%10 = call signext i8 (...) @getchar()
%11 = load i8*, i8** %2
store i8 %10, i8* %11
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = call i32 @putchar(i8 signext %13)
store i32 0, i32* %1
br label %15
15: ; preds = %9, %7
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [22 x i8] c"malloc memory failed!\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
%7 = tail call signext i8 (...) @getchar()
store i8 %7, i8* %6
%8 = tail call i32 @putchar(i8 signext %7)
br label %9
9: ; preds = %5, %3
ret i32 0
}
unsigned char hashlong(long val) {
  unsigned char retval = 0, *ptr;
  int i;
  for (ptr = (unsigned char *)&val, i = 0; i < sizeof(val); i++)
    retval ^= ptr[i];
  return retval;
}


x86 assembly (clang, -O0):
<hashlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x8,%rax
jae    114c <hashlong+0x4c>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
movzbl -0x9(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <hashlong+0x1b>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashlong>:
mov    %rdi,%r9
shr    $0x8,%r9
mov    %rdi,%rdx
mov    %rdi,%r8
mov    %rdi,%rsi
mov    %rdi,%rcx
mov    %rdi,%rax
xor    %edi,%r9d
shr    $0x10,%rdi
shr    $0x18,%rdx
shr    $0x20,%r8
shr    $0x28,%rsi
shr    $0x30,%rcx
shr    $0x38,%rax
xor    %edi,%edx
xor    %r9d,%edx
xor    %r8d,%esi
xor    %esi,%ecx
xor    %edx,%ecx
xor    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @hashlong(i64 %0) {
%2 = alloca i64
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i64 %0, i64* %2
store i8 0, i8* %3
%6 = bitcast i64* %2 to i8*
store i8* %6, i8** %4
store i32 0, i32* %5
br label %7
7: ; preds = %22, %1
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = icmp ult i64 %9, 8
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = xor i32 %19, %17
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
br label %22
22: ; preds = %11
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %7
25: ; preds = %7
%26 = load i8, i8* %3
ret i8 %26
}

LLVM IR (-O2):
define zeroext i8 @hashlong(i64 %0) {
%2 = lshr i64 %0, 8
%3 = lshr i64 %0, 16
%4 = lshr i64 %0, 24
%5 = lshr i64 %0, 32
%6 = lshr i64 %0, 40
%7 = lshr i64 %0, 48
%8 = lshr i64 %0, 56
%9 = xor i64 %2, %0
%10 = xor i64 %3, %9
%11 = xor i64 %4, %10
%12 = xor i64 %5, %11
%13 = xor i64 %6, %12
%14 = xor i64 %7, %13
%15 = xor i64 %8, %14
%16 = trunc i64 %15 to i8
ret i8 %16
}
/* Variables and functions */
scalar_t__ wAddObject(int, int);
int /*<<< orphan*/ wCreateNumConst(char *, int);
void wCreatePtrConst(char *name, int classIndex, int pointer) {
  int handle;
  handle = (int)wAddObject(classIndex, pointer);
  wCreateNumConst(name, handle);
}


x86 assembly (clang, -O0):
<wCreatePtrConst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <wAddObject@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <wCreateNumConst@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wCreatePtrConst>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <wAddObject@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <wCreateNumConst@plt>

LLVM IR (-O0):
define void @wCreatePtrConst(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @wAddObject(i32 %8, i32 %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %7
%14 = call i32 @wCreateNumConst(i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @wCreatePtrConst(i8* %0, i32 %1, i32 %2) {
%4 = tail call i64 @wAddObject(i32 %1, i32 %2)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @wCreateNumConst(i8* %0, i32 %5)
ret void
}
void swap(void **x, void **y) {
  void *direccion_y = *y;
  *y = *x;
  *x = direccion_y;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rsi),%rax
mov    (%rdi),%rcx
mov    %rcx,(%rsi)
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @swap(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %4
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8*, i8** %0
store i8* %4, i8** %1
store i8* %3, i8** %0
ret void
}
/* Variables and functions */
int get_hardware_revision(int);
int get_pigpio_version(int);
int /*<<< orphan*/ printf(char *, ...);
void t0(int pi) {
  printf("\nTesting pigpiod C I/F 2\n");
  printf("pigpio version %d.\n", get_pigpio_version(pi));
  printf("Hardware revision %d.\n", get_hardware_revision(pi));
}


x86 assembly (clang, -O0):
<t0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <get_pigpio_version@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <get_hardware_revision@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t0>:
push   %rbx
mov    %edi,%ebx
lea    0xee1(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1030 <get_pigpio_version@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   1060 <get_hardware_revision@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0ATesting pigpiod C I/F 2\0A\00"
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
define void @t0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @get_pigpio_version(i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @get_hardware_revision(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
@str = [25 x i8] c"\0ATesting pigpiod C I/F 2\00"
define void @t0(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @get_pigpio_version(i32 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @get_hardware_revision(i32 %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
StToSz(st, sz) char *st, *sz;
{
  bltb(st + 1, sz, st[0]);
  sz[st[0]] = '\0';
}


x86 assembly (clang, -O0):
<StToSz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    $0x0,%al
call   1030 <bltb@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbq (%rcx),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StToSz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rdi
movsbl (%rbx),%edx
xor    %eax,%eax
call   1030 <bltb@plt>
movsbq (%rbx),%rax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @StToSz(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bltb to i32 (i8*, i8*, i32, ...)*)(i8* %7, i8* %8, i32 %12)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i64
%19 = getelementptr inbounds i8, i8* %14, i64 %18
store i8 0, i8* %19
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @StToSz(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bltb to i32 (i8*, i8*, i32, ...)*)(i8* %3, i8* %1, i32 %5)
%7 = load i8, i8* %0
%8 = sext i8 %7 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 0, i8* %9
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
scalar_t__ INT_MAX;
__attribute__((always_)) int32_t
__checkint_int32_div_signed_unsigned(int32_t x, uint32_t y, int32_t *err) {
  if (y <= INT_MAX)
    return x / (int32_t)y;
  return 0;
}


x86 assembly (clang, -O0):
<__checkint_int32_div_signed_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ece(%rip),%rcx
cmp    (%rcx),%rax
jg     1135 <__checkint_int32_div_signed_unsigned+0x35>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    113c <__checkint_int32_div_signed_unsigned+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__checkint_int32_div_signed_unsigned>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %rsi,(%rcx)
jl     1113 <__checkint_int32_div_signed_unsigned+0x13>
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
@INT_MAX = global i64 0
define i32 @__checkint_int32_div_signed_unsigned(i32 %0, i64 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32*
store i32 %0, i32* %5
store i64 %1, i64* %6
store i32* %2, i32** %7
%8 = load i64, i64* %6
%9 = load i64, i64* @INT_MAX
%10 = icmp sle i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i64, i64* %6
%14 = trunc i64 %13 to i32
%15 = sdiv i32 %12, %14
store i32 %15, i32* %4
br label %17
16: ; preds = %3
store i32 0, i32* %4
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define i32 @__checkint_int32_div_signed_unsigned(i32 %0, i64 %1, i32* nocapture readnone %2) {
%4 = load i64, i64* @INT_MAX
%5 = icmp slt i64 %4, %1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = trunc i64 %1 to i32
%8 = sdiv i32 %0, %7
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %8, %6 ], [ 0, %3 ]
ret i32 %10
}
void g4() {}


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

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

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

LLVM IR (-O2):
define void @g4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ X509_REQ;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int PEM_ASN1_write(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_X509_REQ(FILE *fp, X509_REQ *x) {
  return PEM_ASN1_write((i2d_of_void *)i2d_X509_REQ, PEM_STRING_X509_REQ, fp, x,
                        NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_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@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_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@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_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(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_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(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
int is_unescaped(char *p, unsigned long *offset, char c) {
  if (*p != c)
    return 0;
  if (*offset > 0 && *(p - 1) == '\\')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_unescaped>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
je     1130 <is_unescaped+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1162 <is_unescaped+0x62>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jbe    115b <is_unescaped+0x5b>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x5c,%eax
jne    115b <is_unescaped+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1162 <is_unescaped+0x62>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unescaped>:
xor    %eax,%eax
cmp    %dl,(%rdi)
jne    1117 <is_unescaped+0x17>
cmpq   $0x0,(%rsi)
je     1112 <is_unescaped+0x12>
cmpb   $0x5c,-0x1(%rdi)
je     1117 <is_unescaped+0x17>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_unescaped(i8* %0, i64* %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i8
store i8* %0, i8** %5
store i64* %1, i64** %6
store i8 %2, i8* %7
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %10, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 0, i32* %4
br label %27
15: ; preds = %3
%16 = load i64*, i64** %6
%17 = load i64, i64* %16
%18 = icmp ugt i64 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 -1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 92
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 0, i32* %4
br label %27
26: ; preds = %19, %15
store i32 1, i32* %4
br label %27
27: ; preds = %26, %25, %14
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @is_unescaped(i8* nocapture %0, i64* nocapture %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, %2
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i64, i64* %1
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %0, i64 -1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 92
br i1 %12, label %14, label %13
13: ; preds = %9, %6
br label %14
14: ; preds = %9, %3, %13
%15 = phi i32 [ 1, %13 ], [ 0, %3 ], [ 0, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void warn(const char *message) { fprintf(stderr, "Warning: %s", message); }


x86 assembly (clang, -O0):
<warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Warning: %s\00"
define void @warn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Warning: %s\00"
define void @warn(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uses_setjmp(int);
int __attribute__((no)) main() {
  uses_setjmp(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <uses_setjmp@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @uses_setjmp(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: svmidi [-i instrument] [-o octave] [-v]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"usage: svmidi [-i instrument] [-o octave] [-v]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: svmidi [-i instrument] [-o octave] [-v]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ motor(int, int);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ off(int);
void turnLeft(int dist) {
  motor(3, -75);
  motor(1, 90);
  msleep(dist);
  off(3);
  off(1);
}


x86 assembly (clang, -O0):
<turnLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
mov    $0xffffffb5,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0x5a,%esi
call   1030 <motor@plt>
mov    -0x4(%rbp),%edi
call   1050 <msleep@plt>
mov    $0x3,%edi
call   1040 <off@plt>
mov    $0x1,%edi
call   1040 <off@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnLeft>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%edi
mov    $0xffffffb5,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0x5a,%esi
call   1030 <motor@plt>
mov    %ebx,%edi
call   1050 <msleep@plt>
mov    $0x3,%edi
call   1040 <off@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1040 <off@plt>

LLVM IR (-O0):
define void @turnLeft(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @motor(i32 3, i32 -75)
%4 = call i32 @motor(i32 1, i32 90)
%5 = load i32, i32* %2
%6 = call i32 @msleep(i32 %5)
%7 = call i32 @off(i32 3)
%8 = call i32 @off(i32 1)
ret void
}

LLVM IR (-O2):
define void @turnLeft(i32 %0) {
%2 = tail call i32 @motor(i32 3, i32 -75)
%3 = tail call i32 @motor(i32 1, i32 90)
%4 = tail call i32 @msleep(i32 %0)
%5 = tail call i32 @off(i32 3)
%6 = tail call i32 @off(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *t_fun(void *arg) {
  int x;
  assert(x == 3);
  return NULL;
}


x86 assembly (clang, -O0):
<t_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @t_fun(i8* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: dio [-o <output file>] <device name> <time interval>\n");
  printf("       dio -l\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"Usage: dio [-o <output file>] <device name> <time interval>\0A\00"
@.str.1 = [15 x i8] c" dio -l\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [60 x i8] c"Usage: dio [-o <output file>] <device name> <time interval>\00"
@str.2 = [14 x i8] c" dio -l\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void vector_free(double *pv) { free(pv); }


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

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

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

LLVM IR (-O2):
define void @vector_free(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
int mDB_first(fn, idx, rows, dst) {
  return mDBi_msg('f', fn, idx, rows, 0, 0, 0, dst);
}


x86 assembly (clang, -O0):
<mDB_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
mov    $0x66,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <mDBi_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mDB_first>:
push   %rax
mov    %ecx,%r10d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x66,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   %r10
push   $0x0
call   1030 <mDBi_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mDB_first(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 102, i32 %9, i32 %10, i32 %11, i32 0, i32 0, i32 0, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @mDB_first(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 102, i32 %0, i32 %1, i32 %2, i32 0, i32 0, i32 0, i32 %3)
ret i32 %5
}
int DPSMGet(int *level) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @DPSMGet(i32* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *afio_get_EVCR() { return mem_get_reg32(0x40010000 + 0x00); }


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

x86 assembly (clang, -O2):
<afio_get_EVCR>:
mov    $0x40010000,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @afio_get_EVCR() {
%1 = call i32* @mem_get_reg32(i32 1073807360)
ret i32* %1
}

LLVM IR (-O2):
define i32* @afio_get_EVCR() {
%1 = tail call i32* @mem_get_reg32(i32 1073807360)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ Sys_NET_AsyncResolveHostname(char const *);
void NET_AsyncResolveHostname(const char *hostname) {
  Sys_NET_AsyncResolveHostname(hostname);
}


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

x86 assembly (clang, -O2):
<NET_AsyncResolveHostname>:
jmp    1030 <Sys_NET_AsyncResolveHostname@plt>

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

LLVM IR (-O2):
define void @NET_AsyncResolveHostname(i8* %0) {
%2 = tail call i32 @Sys_NET_AsyncResolveHostname(i8* %0)
ret void
}
char *format(char *str, int start, int diff) {
  while (diff > 0) {
    str[start] = 0 + '0';
    start++;
    diff--;
  }
  return str;
}


x86 assembly (clang, -O0):
<format>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    113b <format+0x3b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <format+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<format>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
jle    112a <format+0x1a>
movslq %esi,%rdi
add    %rbx,%rdi
mov    %edx,%edx
mov    $0x30,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @format(i8* returned writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr i8, i8* %0, i64 %6
%8 = zext i32 %2 to i64
br label %9
9: ; preds = %5, %3
ret i8* %0
}