xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
int /*<<< orphan*/ errno;
int gethostname(char *, size_t);
char *strchr(char *, char);
char *get_hostname(char *buf, size_t bufsize) {
  char *p;
  if (gethostname(buf, bufsize) == -1)
    err(errno, "gethostname");
  if (p = strchr(buf, '.'))
    *p = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<get_hostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <gethostname@plt>
cmp    $0xffffffff,%eax
jne    116b <get_hostname+0x3b>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1040 <err@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     118e <get_hostname+0x5e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hostname>:
push   %rbx
mov    %rdi,%rbx
call   1050 <gethostname@plt>
cmp    $0xffffffff,%eax
jne    1153 <get_hostname+0x23>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1040 <err@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1168 <get_hostname+0x38>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [12 x i8] c"gethostname\00"
define i8* @get_hostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @gethostname(i8* %6, i64 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @errno
%12 = call i32 @err(i32 %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %2
%14 = load i8*, i8** %3
%15 = call i8* @strchr(i8* %14, i8 signext 46)
store i8* %15, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i8*, i8** %5
store i8 0, i8* %18
br label %19
19: ; preds = %17, %13
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [12 x i8] c"gethostname\00"
define i8* @get_hostname(i8* returned %0, i64 %1) {
%3 = tail call i32 @gethostname(i8* %0, i64 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @err(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
%9 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%10 = icmp eq i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8
store i8 0, i8* %9
br label %12
12: ; preds = %11, %8
ret i8* %0
}
/* Variables and functions */
int I2C_Write(int, int, unsigned char *);
int STC3115_WriteBytes(unsigned char *data, int RegAddress, int nbr) {
  int res;
  res = I2C_Write(nbr, RegAddress, data);
  return (res);
}


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

x86 assembly (clang, -O2):
<STC3115_WriteBytes>:
mov    %rdi,%rax
mov    %edx,%edi
mov    %rax,%rdx
jmp    1030 <I2C_Write@plt>

LLVM IR (-O0):
define i32 @STC3115_WriteBytes(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* %6
%9 = load i32, i32* %5
%10 = load i8*, i8** %4
%11 = call i32 @I2C_Write(i32 %8, i32 %9, i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @STC3115_WriteBytes(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @I2C_Write(i32 %2, i32 %1, i8* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  if (a > b) {
    printf("%d", 4 - a);
  } else {
    printf("%d", 4 - b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1168 <main+0x48>
mov    $0x4,%esi
sub    -0x8(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
mov    $0x4,%esi
sub    -0xc(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
cmp    %ecx,%eax
cmovg  %eax,%ecx
mov    $0x4,%esi
sub    %ecx,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %6, %7
%9 = select i1 %8, i32 %6, i32 %7
%10 = sub nsw i32 4, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(int);
void *emalloc(int size) {
  void *m = malloc(size);
  if (!m)
    die("malloc");
  return m;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <emalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <emalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @emalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char *base64_decode(char *, size_t, size_t *);
size_t strlen(char *);
char *b64d(char *str) {
  size_t encoded_size = strlen(str);
  size_t output_length = 0;
  return base64_decode(str, encoded_size, &output_length);
}


x86 assembly (clang, -O0):
<b64d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <base64_decode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64d>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <base64_decode@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @b64d(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
store i64 0, i64* %4
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = call i8* @base64_decode(i8* %7, i64 %8, i64* %4)
ret i8* %9
}

LLVM IR (-O2):
define i8* @b64d(i8* %0) {
%2 = alloca i64
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i8* @base64_decode(i8* %0, i64 %3, i64* %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void PrintChars(unsigned long spacing, char symbol) {
  while (spacing > 0) {
    printf("%c", symbol);
    spacing--;
  }
}


x86 assembly (clang, -O0):
<PrintChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    114e <PrintChars+0x3e>
lea    0xecc(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1122 <PrintChars+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintChars>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1140 <PrintChars+0x30>
mov    %rdi,%rbx
movsbl %sil,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <PrintChars+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @PrintChars(i64 %0, i8 signext %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%7 = add i64 %5, -1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(void const *, void *, size_t);
void *memmove(void *dst, const void *src, size_t ulen) {
  bcopy(src, dst, ulen);
  return dst;
}


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

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

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

LLVM IR (-O2):
define i8* @memmove(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ __set_errno(int);
int /*<<< orphan*/ close(int);
int errno;
void do_close(int s) {
  int save;
  save = errno;
  close(s);
  __set_errno(save);
}


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

x86 assembly (clang, -O2):
<do_close>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
call   1040 <close@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <__set_errno@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @do_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @__set_errno(i32 %7)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @do_close(i32 %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @close(i32 %0)
%4 = tail call i32 @__set_errno(i32 %2)
ret void
}
int save_which(int from, int to) { return 3 - from - to; }


x86 assembly (clang, -O0):
<save_which>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x3,%eax
sub    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_which>:
add    %esi,%edi
mov    $0x3,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @save_which(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 = sub nsw i32 3, %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @save_which(i32 %0, i32 %1) {
%3 = add i32 %0, %1
%4 = sub i32 3, %3
ret i32 %4
}
void g_arith_hypot_u64(void *s, void *d, void *o) {}


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

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

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

LLVM IR (-O2):
define void @g_arith_hypot_u64(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char *);
int dn_expand(unsigned char *msg, unsigned char *eomorig,
              unsigned char *comp_dn, char *exp_dn, int length) {
  printf(">>> dn_expand(%s)\n", comp_dn);
  return -1;
}


x86 assembly (clang, -O0):
<dn_expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dn_expand>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c">>> dn_expand(%s)\0A\00"
define i32 @dn_expand(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %8
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 -1
}

LLVM IR (-O2):
@.str = [19 x i8] c">>> dn_expand(%s)\0A\00"
define i32 @dn_expand(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2, i8* nocapture readnone %3, i32 %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 -1
}
int _sys_tolower(int c) {
  if (c >= 'A' && c <= 'Z') {
    return (c + 'a' - 'A');
  } else {
    return (c);
  }
}


x86 assembly (clang, -O0):
<_sys_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <_sys_tolower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <_sys_tolower+0x2c>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <_sys_tolower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sys_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @_sys_tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 97
%12 = sub nsw i32 %11, 65
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @_sys_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t);
int main() {
  int a[100];
  size_t s = sizeof(a);
  printf("%zu bytes\n", s);
  size_t num = s / sizeof(int);
  printf("space for storing %zu elements\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x190,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1a8(%rbp),%rax
shr    $0x2,%rax
mov    %rax,-0x1b0(%rbp)
mov    -0x1b0(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x190,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%zu bytes\0A\00"
@.str.1 = [32 x i8] c"space for storing %zu elements\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i64 400, i64* %3
%5 = load i64, i64* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %3
%8 = udiv i64 %7, 4
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i64 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%zu bytes\0A\00"
@.str.1 = [32 x i8] c"space for storing %zu elements\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 400)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i64 100)
ret i32 0
}
/* Variables and functions */
int pair(unsigned int);
int impair(unsigned int i) {
  if (i == 0)
    return 0;
  else
    return pair(i - 1);
}


x86 assembly (clang, -O0):
<impair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <impair+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113f <impair+0x2f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <pair@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<impair>:
test   %edi,%edi
je     111c <impair+0xc>
add    $0xffffffff,%edi
jmp    1030 <pair@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @impair(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = tail call i32 @pair(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int float_to_int(float);
int quick_floor(float x) { return float_to_int(x) - ((x < 0) ? 1 : 0); }


x86 assembly (clang, -O0):
<quick_floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <float_to_int@plt>
movss  -0x4(%rbp),%xmm1
xorps  %xmm0,%xmm0
xor    %ecx,%ecx
mov    $0x1,%edx
ucomiss %xmm1,%xmm0
cmova  %edx,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_floor>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <float_to_int@plt>
xorps  %xmm0,%xmm0
xor    %ecx,%ecx
ucomiss 0x4(%rsp),%xmm0
seta   %cl
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @quick_floor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @float_to_int(float %3)
%5 = load float, float* %2
%6 = fcmp olt float %5, 0.000000e+00
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
%9 = sub nsw i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @quick_floor(float %0) {
%2 = tail call i32 @float_to_int(float %0)
%3 = fcmp olt float %0, 0.000000e+00
%4 = sext i1 %3 to i32
%5 = add i32 %2, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int no;
  while (scanf("%d", &no) == 1) {
    if (no == 0)
      break;
    else
      printf("%d\n", no);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    116b <main+0x4b>
cmpl   $0x0,-0x8(%rbp)
jne    1157 <main+0x37>
jmp    116b <main+0x4b>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1180 <main+0x60>
mov    0xc(%rsp),%esi
test   %esi,%esi
je     1180 <main+0x60>
lea    0xeb5(%rip),%r14
lea    0xeab(%rip),%r15
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1180 <main+0x60>
mov    0xc(%rsp),%esi
test   %esi,%esi
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp ne i32 %3, 1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %16, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %13, %8 ], [ %5, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = icmp ne i32 %11, 1
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 0
%15 = select i1 %12, i1 true, i1 %14
br i1 %15, label %16, label %8
16: ; preds = %8, %0
ret i32 0
}
int nofunc(struct dinfo *dip) { return (0); }


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

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

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

LLVM IR (-O2):
%struct.dinfo = type opaque
define i32 @nofunc(%struct.dinfo* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, unsigned short);
unsigned short validate_port(unsigned short port) {
  if (port <= 0 || port > 0xffff) {
    printf("Invalid port %d\n", port);
    exit(-1);
  }
  return port;
}


x86 assembly (clang, -O0):
<validate_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
jle    114b <validate_port+0x2b>
movzwl -0x2(%rbp),%eax
cmp    $0xffff,%eax
jle    1165 <validate_port+0x45>
lea    0xeae(%rip),%rdi
movzwl -0x2(%rbp),%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_port>:
test   %edi,%edi
je     1127 <validate_port+0x7>
mov    %edi,%eax
ret
push   %rax
lea    0xed1(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Invalid port %d\0A\00"
define zeroext i16 @validate_port(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sle i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp sgt i32 %8, 65535
br i1 %9, label %10, label %14
10: ; preds = %6, %1
%11 = load i16, i16* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16 zeroext %11)
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %6
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
@.str = [17 x i8] c"Invalid port %d\0A\00"
define zeroext i16 @validate_port(i16 returned zeroext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16 zeroext 0)
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %1
ret i16 %0
}
/* Variables and functions */
int yas_adxl345_read_reg(unsigned char, unsigned char *, int);
int yas_adxl345_read_reg_byte(unsigned char adr) {
  unsigned char buf;
  int err;
  err = yas_adxl345_read_reg(adr, &buf, 1);
  if (err == 0) {
    return buf;
  }
  return 0;
}


x86 assembly (clang, -O0):
<yas_adxl345_read_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <yas_adxl345_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <yas_adxl345_read_reg_byte+0x39>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <yas_adxl345_read_reg_byte+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_adxl345_read_reg_byte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_adxl345_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_adxl345_read_reg_byte(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
%6 = load i8, i8* %3
%7 = call i32 @yas_adxl345_read_reg(i8 zeroext %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @yas_adxl345_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @yas_adxl345_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
long std_eqn(long num, long denom, long quot, long rem) {
  return quot * (-0x7fffffffL - 1L) + rem == num;
}


x86 assembly (clang, -O0):
<std_eqn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
imul   $0xffffffff80000000,-0x18(%rbp),%rax
80
add    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_eqn>:
shl    $0x1f,%rdx
sub    %rdx,%rcx
xor    %eax,%eax
cmp    %rdi,%rcx
sete   %al
ret

LLVM IR (-O0):
define i64 @std_eqn(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = mul nsw i64 %9, -2147483648
%11 = load i64, i64* %8
%12 = add nsw i64 %10, %11
%13 = load i64, i64* %5
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
%16 = sext i32 %15 to i64
ret i64 %16
}

LLVM IR (-O2):
define i64 @std_eqn(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = mul nsw i64 %2, -2147483648
%6 = add nsw i64 %5, %3
%7 = icmp eq i64 %6, %0
%8 = zext i1 %7 to i64
ret i64 %8
}
void XcmsQueryRed() {}


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

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

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

LLVM IR (-O2):
define void @XcmsQueryRed() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
int /*<<< orphan*/ pmu_set_active_clk(int, int, int, int);
int /*<<< orphan*/ pmu_set_adc_period(int);
int /*<<< orphan*/ pmu_set_sar_override(int);
int /*<<< orphan*/ pmu_set_sleep_low();
void pmu_set_clk_init() {
  pmu_set_active_clk(0xF, 0x1, 0x10, 0x2);
  pmu_set_sleep_low();
  pmu_reg_write(0x05, ((0 << 13) | (0 << 12) | (1 << 11) | (0 << 10) |
                       (0 << 9) | (0 << 8) | (0 << 7) | (0x45)));
  pmu_set_sar_override(0x3C);
  pmu_set_adc_period(1);
}


x86 assembly (clang, -O0):
<pmu_set_clk_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
mov    $0x1,%esi
mov    $0x10,%edx
mov    $0x2,%ecx
call   1030 <pmu_set_active_clk@plt>
mov    $0x0,%al
call   1050 <pmu_set_sleep_low@plt>
mov    $0x5,%edi
mov    $0x845,%esi
call   1040 <pmu_reg_write@plt>
mov    $0x3c,%edi
call   1060 <pmu_set_sar_override@plt>
mov    $0x1,%edi
call   1070 <pmu_set_adc_period@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_clk_init>:
push   %rax
mov    $0xf,%edi
mov    $0x1,%esi
mov    $0x10,%edx
mov    $0x2,%ecx
call   1030 <pmu_set_active_clk@plt>
xor    %eax,%eax
call   1050 <pmu_set_sleep_low@plt>
mov    $0x5,%edi
mov    $0x845,%esi
call   1040 <pmu_reg_write@plt>
mov    $0x3c,%edi
call   1060 <pmu_set_sar_override@plt>
mov    $0x1,%edi
pop    %rax
jmp    1070 <pmu_set_adc_period@plt>

LLVM IR (-O0):
define void @pmu_set_clk_init() {
%1 = call i32 @pmu_set_active_clk(i32 15, i32 1, i32 16, i32 2)
%2 = call i32 (...) @pmu_set_sleep_low()
%3 = call i32 @pmu_reg_write(i32 5, i32 2117)
%4 = call i32 @pmu_set_sar_override(i32 60)
%5 = call i32 @pmu_set_adc_period(i32 1)
ret void
}

LLVM IR (-O2):
define void @pmu_set_clk_init() {
%1 = tail call i32 @pmu_set_active_clk(i32 15, i32 1, i32 16, i32 2)
%2 = tail call i32 (...) @pmu_set_sleep_low()
%3 = tail call i32 @pmu_reg_write(i32 5, i32 2117)
%4 = tail call i32 @pmu_set_sar_override(i32 60)
%5 = tail call i32 @pmu_set_adc_period(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *duplicate_string(const char *source) {
  char *target = (char *)malloc(strlen(source) + 1);
  strcpy(target, source);
  return target;
}


x86 assembly (clang, -O0):
<duplicate_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@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):
<duplicate_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@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):
define i8* @duplicate_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @duplicate_string(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hola mundo!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hola mundo!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hola mundo!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void gmx_parallel_3dfft_dummy() {}


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

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

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

LLVM IR (-O2):
define void @gmx_parallel_3dfft_dummy() {
ret void
}
int is_rfc2396_alnum(char ch) {
  return ('0' <= ch && ch <= '9') || ('A' <= ch && ch <= 'Z') ||
         ('a' <= ch && ch <= 'z');
}


x86 assembly (clang, -O0):
<is_rfc2396_alnum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     112d <is_rfc2396_alnum+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1179 <is_rfc2396_alnum+0x79>
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1150 <is_rfc2396_alnum+0x50>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1179 <is_rfc2396_alnum+0x79>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1173 <is_rfc2396_alnum+0x73>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rfc2396_alnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x1a,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_rfc2396_alnum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 65, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 97, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 122
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_rfc2396_alnum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int rho_ruby_is_started() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rho_ruby_is_started() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Send_MPlayer_Command(int, int /*<<< orphan*/);
void MPlayer_Stop() { Send_MPlayer_Command(0x0F, 0); }


x86 assembly (clang, -O0):
<MPlayer_Stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <Send_MPlayer_Command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPlayer_Stop>:
mov    $0xf,%edi
xor    %esi,%esi
jmp    1030 <Send_MPlayer_Command@plt>

LLVM IR (-O0):
define void @MPlayer_Stop() {
%1 = call i32 @Send_MPlayer_Command(i32 15, i32 0)
ret void
}

LLVM IR (-O2):
define void @MPlayer_Stop() {
%1 = tail call i32 @Send_MPlayer_Command(i32 15, i32 0)
ret void
}
signed char vp8_signed_char_clamp(int t) {
  t = (t < -128 ? -128 : t);
  t = (t > 127 ? 127 : t);
  return (signed char)t;
}


x86 assembly (clang, -O0):
<vp8_signed_char_clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffff80,-0x4(%rbp)
jge    111e <vp8_signed_char_clamp+0x1e>
mov    $0xffffff80,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <vp8_signed_char_clamp+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x7f,-0x4(%rbp)
jle    1141 <vp8_signed_char_clamp+0x41>
mov    $0x7f,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <vp8_signed_char_clamp+0x47>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_signed_char_clamp>:
cmp    $0xffffff81,%edi
mov    $0xffffff80,%ecx
cmovge %edi,%ecx
cmp    $0x7f,%ecx
mov    $0x7f,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @vp8_signed_char_clamp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, -128
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ -128, %5 ], [ %7, %6 ]
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 127
br i1 %11, label %12, label %13
12: ; preds = %8
br label %15
13: ; preds = %8
%14 = load i32, i32* %2
br label %15
15: ; preds = %13, %12
%16 = phi i32 [ 127, %12 ], [ %14, %13 ]
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @vp8_signed_char_clamp(i32 %0) {
%2 = icmp sgt i32 %0, -128
%3 = select i1 %2, i32 %0, i32 -128
%4 = icmp slt i32 %3, 127
%5 = select i1 %4, i32 %3, i32 127
%6 = trunc i32 %5 to i8
ret i8 %6
}
int iclip(const int v, const int min, const int max) {
  return v < min ? min : v > max ? max : v;
}


x86 assembly (clang, -O0):
<iclip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <iclip+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <iclip+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <iclip+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <iclip+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iclip(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 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @iclip(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
void gtk_font_button_get_use_size() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_button_get_use_size() {
ret void
}
/* Variables and functions */
unsigned char tolower(unsigned char);
char *strlwr(char *str) {
  unsigned char *p = (unsigned char *)str;
  while (*p) {
    *p = tolower((unsigned char)*p);
    p++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strlwr+0x46>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlwr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlwr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call zeroext i8 @tolower(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
int do_128() { return 128; }


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

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

LLVM IR (-O0):
define i32 @do_128() {
ret i32 128
}

LLVM IR (-O2):
define i32 @do_128() {
ret i32 128
}
int SecKeychainItemCopyContent() { return -4; }


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

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

LLVM IR (-O0):
define i32 @SecKeychainItemCopyContent() {
ret i32 -4
}

LLVM IR (-O2):
define i32 @SecKeychainItemCopyContent() {
ret i32 -4
}
void s3c_onenand_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_onenand_setname(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *local_getProperPath(char const *);
int /*<<< orphan*/ xfree(char *);
char *xstrdup(char *);
char *xstrmerge(char *, char const *);
char *local_getFileStem(const char *path, const char *fileNameStart) {
  char *properPath;
  char *fileStem;
  if (path == NULL)
    properPath = xstrdup("./");
  else
    properPath = local_getProperPath(path);
  fileStem = xstrmerge(properPath, fileNameStart);
  xfree(properPath);
  return fileStem;
}


x86 assembly (clang, -O0):
<local_getFileStem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1170 <local_getFileStem+0x30>
lea    0xe9e(%rip),%rdi
call   1050 <xstrdup@plt>
mov    %rax,-0x18(%rbp)
jmp    117d <local_getFileStem+0x3d>
mov    -0x8(%rbp),%rdi
call   1060 <local_getProperPath@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <xstrmerge@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <xfree@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_getFileStem>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %rdi,%rdi
je     1153 <local_getFileStem+0x13>
call   1060 <local_getProperPath@plt>
jmp    115f <local_getFileStem+0x1f>
lea    0xea6(%rip),%rdi
call   1050 <xstrdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <xstrmerge@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <xfree@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"./\00"
define i8* @local_getFileStem(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i8* @xstrdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %5
br label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i8* @local_getProperPath(i8* %12)
store i8* %13, i8** %5
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = call i8* @xstrmerge(i8* %15, i8* %16)
store i8* %17, i8** %6
%18 = load i8*, i8** %5
%19 = call i32 @xfree(i8* %18)
%20 = load i8*, i8** %6
ret i8* %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"./\00"
define i8* @local_getFileStem(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @xstrdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i8* @local_getProperPath(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
%10 = tail call i8* @xstrmerge(i8* %9, i8* %1)
%11 = tail call i32 @xfree(i8* %9)
ret i8* %10
}