xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ checking_free(char *);
char *checking_strdup(char const *);
unsigned char cmd_string(const char *com, const char *val, void *place) {
  char **pstring = (char **)place;
  if (!(*pstring))
    ;
  else
    checking_free(*pstring);
  *pstring = checking_strdup(val);
  return 1;
}


x86 assembly (clang, -O0):
<cmd_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114f <cmd_string+0x2f>
jmp    115b <cmd_string+0x3b>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1030 <checking_free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <checking_strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    (%rdx),%rdi
test   %rdi,%rdi
je     1137 <cmd_string+0x17>
call   1030 <checking_free@plt>
mov    %r14,%rdi
call   1040 <checking_strdup@plt>
mov    %rax,(%rbx)
mov    $0x1,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define zeroext i8 @cmd_string(i8* nocapture readnone %0, i8* %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i8**
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @checking_free(i8* %5)
br label %9
9: ; preds = %3, %7
%10 = tail call i8* @checking_strdup(i8* %1)
store i8* %10, i8** %4
ret i8 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void print(int *p) {
  int i;
  for (i = 0; i < 5; i++) {
    printf("%3d", *p++);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1158 <print+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee0(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x10(%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%3d\00"
define void @print(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds i32, i32* %0, i64 3
%9 = load i32, i32* %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds i32, i32* %0, i64 4
%12 = load i32, i32* %8
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %11
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ snprintf(char *, size_t, char *, int, char *);
char *strerror(int);
char *os_last_err_desc(char *s, size_t s_bufsize) {
  snprintf(s, s_bufsize, "code=%i (%s)", errno, strerror(errno));
  return s;
}


x86 assembly (clang, -O0):
<os_last_err_desc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    %rax,%r8
lea    0xe91(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_last_err_desc>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1040 <strerror@plt>
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%ecx
mov    %rax,%r8
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"code=%i (%s)\00"
@errno = global i32 0
define i8* @os_last_err_desc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @errno
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @snprintf(i8* %5, i64 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"code=%i (%s)\00"
@errno = global i32 0
define i8* @os_last_err_desc(i8* returned %0, i64 %1) {
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int choicer() {
  int choice;
  printf("\nWhat do you want to do?\n"
         "1: Insert a value at beginning\n"
         "2: Insert a value at end\n"
         "3: Delete a value at beginning\n"
         "4: Delete a value at end\n"
         "5: Insert a value in some middle position\n"
         "6: Delete a value in some middle position\n"
         "7: Search for a value\n"
         "8: Print your list\n"
         "9: Insert a value in order\n"
         "10: Sequential sort\n"
         "0: Quit\n"
         "Type the number corresponding your choice: ");
  scanf("%d", &choice);
  return choice;
}


x86 assembly (clang, -O0):
<choicer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0x102e(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choicer>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0x1035(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [361 x i8] c"\0AWhat do you want to do?\0A1: Insert a value at beginning\0A2: Insert a value at end\0A3: Delete a value at beginning\0A4: Delete a value at end\0A5: Insert a value in some middle position\0A6: Delete a value in some middle position\0A7: Search for a value\0A8: Print your list\0A9: Insert a value in order\0A10: Sequential sort\0A0: Quit\0AType the number corresponding your choice: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @choicer() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [361 x i8] c"\0AWhat do you want to do?\0A1: Insert a value at beginning\0A2: Insert a value at end\0A3: Delete a value at beginning\0A4: Delete a value at end\0A5: Insert a value in some middle position\0A6: Delete a value in some middle position\0A7: Search for a value\0A8: Print your list\0A9: Insert a value in order\0A10: Sequential sort\0A0: Quit\0AType the number corresponding your choice: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @choicer() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
char *__strptime_l(buf, format, tm, locale)
int buf;
int format;
int tm;
int locale;
{}


x86 assembly (clang, -O0):
<__strptime_l>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @__strptime_l(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i8* undef
}
/* Variables and functions */
double atanh(double);
double c_atanh(double arg0) { return atanh(arg0); }


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

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

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

LLVM IR (-O2):
define double @c_atanh(double %0) {
%2 = tail call double @atanh(double %0)
ret double %2
}
__attribute__((__naked__)) void SGVObjcMsgSendSuperStretTrampolineObjc(void) {
  asm volatile("addq $"
               "8"
               ", "
               "%%rsi"
               "\n\t"
               "jmp "
               "_objc_msgSendSuper_stret"
               "\n\t"
               :
               :
               : "rsi", "rdi");
}


x86 assembly (clang, -O0):
<SGVObjcMsgSendSuperStretTrampolineObjc>:
add    $0x8,%rsi
jmp    1030 <_objc_msgSendSuper_stret@plt>

x86 assembly (clang, -O2):
<SGVObjcMsgSendSuperStretTrampolineObjc>:
add    $0x8,%rsi
jmp    1030 <_objc_msgSendSuper_stret@plt>

LLVM IR (-O0):
define void @SGVObjcMsgSendSuperStretTrampolineObjc() {
unreachable
}

LLVM IR (-O2):
define void @SGVObjcMsgSendSuperStretTrampolineObjc() {
tail call void asm sideeffect "addq $$8, %rsi\0A\09jmp _objc_msgSendSuper_stret\0A\09", "~{rsi},~{rdi},~{dirflag},~{fpsr},~{flags}"()
unreachable
}
void SPIEnble(unsigned long ulBase) {

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00000040;
}


x86 assembly (clang, -O0):
<SPIEnble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x40,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIEnble>:
orq    $0x40,(%rdi)
ret

LLVM IR (-O0):
define void @SPIEnble(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 64
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @SPIEnble(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = or i64 %3, 64
store volatile i64 %4, i64* %2
ret void
}
/* Variables and functions */
float HUGE_VALF;
float scalanative_libc_huge_valf() { return HUGE_VALF; }


x86 assembly (clang, -O0):
<scalanative_libc_huge_valf>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ee5(%rip),%rax
movss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalanative_libc_huge_valf>:
mov    0x2ee9(%rip),%rax
movss  (%rax),%xmm0
ret

LLVM IR (-O0):
@HUGE_VALF = global float 0.000000e+00
define float @scalanative_libc_huge_valf() {
%1 = load float, float* @HUGE_VALF
ret float %1
}

LLVM IR (-O2):
@HUGE_VALF = global float 0.000000e+00
define float @scalanative_libc_huge_valf() {
%1 = load float, float* @HUGE_VALF
ret float %1
}
int *f3() { return 0; }


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

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

LLVM IR (-O0):
define i32* @f3() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @f3() {
ret i32* null
}
/* Variables and functions */
size_t bdivide_up(size_t a, size_t b) {
  size_t r = a % b;
  return (r > 0 ? a / b + 1 : a / b);
}


x86 assembly (clang, -O0):
<bdivide_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1140 <bdivide_up+0x40>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1150 <bdivide_up+0x50>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdivide_up>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <bdivide_up+0x16>
xor    %edx,%edx
div    %rsi
jmp    111a <bdivide_up+0x1a>
xor    %edx,%edx
div    %esi
cmp    $0x1,%rdx
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @bdivide_up(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp ugt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = udiv i64 %12, %13
%15 = add i64 %14, 1
br label %20
16: ; preds = %2
%17 = load i64, i64* %3
%18 = load i64, i64* %4
%19 = udiv i64 %17, %18
br label %20
20: ; preds = %16, %11
%21 = phi i64 [ %15, %11 ], [ %19, %16 ]
ret i64 %21
}

LLVM IR (-O2):
define i64 @bdivide_up(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = icmp ne i64 %3, 0
%5 = udiv i64 %0, %1
%6 = zext i1 %4 to i64
%7 = add i64 %5, %6
ret i64 %7
}
int linear_index(int r, int c, int k, int rows, int cols) {
  return r + c * rows + k * rows * cols;
}


x86 assembly (clang, -O0):
<linear_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_index>:
imul   %r8d,%edx
lea    (%rdx,%rsi,1),%eax
imul   %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @linear_index(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul i32 %4, %2
%7 = add i32 %6, %1
%8 = mul i32 %7, %3
%9 = add i32 %8, %0
ret i32 %9
}
char *memccpy(t, f, c, n)
register char *t, *f;
register c, n;
{
  while (--n >= 0)
    if ((*t++ = *f++) == c)
      return (t);
  return (0);
}


x86 assembly (clang, -O0):
<memccpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jl     1164 <memccpy+0x64>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    -0x1c(%rbp),%eax
jne    115f <memccpy+0x5f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <memccpy+0x6c>
jmp    1112 <memccpy+0x12>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memccpy>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %ecx,%ecx
jle    112a <memccpy+0x2a>
add    $0xffffffff,%ecx
movsbl (%rsi),%edi
add    $0x1,%rsi
mov    %dil,(%rax)
add    $0x1,%rax
cmp    %edx,%edi
jne    1110 <memccpy+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memccpy(i8* writeonly %0, i8* nocapture %1, i32 %2, i32 %3) {
br label %5
5: ; preds = %10, %4
%6 = phi i8* [ %0, %4 ], [ %14, %10 ]
%7 = phi i8* [ %1, %4 ], [ %12, %10 ]
%8 = phi i32 [ %3, %4 ], [ %11, %10 ]
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = add nsw i32 %8, -1
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %7
%14 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %13, i8* %6
%15 = sext i8 %13 to i32
%16 = icmp eq i32 %15, %2
br i1 %16, label %17, label %5
17: ; preds = %5, %10
%18 = phi i8* [ %14, %10 ], [ null, %5 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ convierteAMayusculas(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char cadena[] = "caracteres y $32.98";
  printf("La cadena antes de la conversion es : %s", cadena);
  convierteAMayusculas(cadena);
  printf("\nLa cadena despues de la conversion es: %s\n", cadena);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <convierteAMayusculas@plt>
lea    -0x20(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x38392e,0x10(%rsp)
lea    0xed5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <convierteAMayusculas@plt>
lea    0xee4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.cadena = [20 x i8] c"caracteres y $32.98\00"
@.str = [41 x i8] c"La cadena antes de la conversion es : %s\00"
@.str.1 = [44 x i8] c"\0ALa cadena despues de la conversion es: %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = bitcast [20 x i8]* %1 to i8*
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = call i32 @convierteAMayusculas(i8* %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.cadena = [20 x i8] c"caracteres y $32.98\00"
@.str = [41 x i8] c"La cadena antes de la conversion es : %s\00"
@.str.1 = [44 x i8] c"\0ALa cadena despues de la conversion es: %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @convierteAMayusculas(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int merge2ByteCodes(void *, unsigned int, unsigned int, unsigned int *,
                    unsigned int **);
int merge2(void *ail, unsigned int id1, unsigned int id2, unsigned int *noccs,
           unsigned int **occs) {
  return merge2ByteCodes(ail, id1, id2, noccs, occs);
}


x86 assembly (clang, -O0):
<merge2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <merge2ByteCodes@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @merge2(i8* %0, i32 %1, i32 %2, i32* %3, i32** %4) {
%6 = tail call i32 @merge2ByteCodes(i8* %0, i32 %1, i32 %2, i32* %3, i32** %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 1;
  printf("a=1\t%d\na==1\t%d\n", a = 1, a == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edx
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"a=1\09%d\0Aa==1\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"a=1\09%d\0Aa==1\09%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ft_strlen(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
void die(const char *msg, int exit_code) {
  write(STDERR_FILENO, msg, ft_strlen(msg));
  exit(exit_code);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    0x2e9f(%rip),%rax
mov    (%rax),%ebp
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %r14d,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
define void @die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @STDERR_FILENO
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @ft_strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
define void @die(i8* %0, i32 %1) {
%3 = load i32, i32* @STDERR_FILENO
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @write(i32 %3, i8* %0, i32 %4)
%6 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ PIN_CLEAR(int /*<<< orphan*/);
void stop_trigger() { PIN_CLEAR(0); }


x86 assembly (clang, -O0):
<stop_trigger>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <PIN_CLEAR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_trigger>:
xor    %edi,%edi
jmp    1030 <PIN_CLEAR@plt>

LLVM IR (-O0):
define void @stop_trigger() {
%1 = call i32 @PIN_CLEAR(i32 0)
ret void
}

LLVM IR (-O2):
define void @stop_trigger() {
%1 = tail call i32 @PIN_CLEAR(i32 0)
ret void
}
void PEM_read_bio_X509_AUX(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_read_bio_X509_AUX() {
ret void
}
int isspace(int c) { return c == ' ' || c == '\t' || c == '\n'; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <isspace+0x2f>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <isspace+0x2f>
cmpl   $0xa,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
cmp    $0x9,%edi
je     110f <isspace+0xf>
cmp    $0x20,%edi
jne    1110 <isspace+0x10>
ret
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int ls_cost_nm7_f0(double const **, double **, int *, double *, int);
int ls_cost_nm7(const double **arg, double **res, int *iw, double *w, int mem) {
  return ls_cost_nm7_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<ls_cost_nm7>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <ls_cost_nm7_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ls_cost_nm7(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @ls_cost_nm7_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ls_cost_nm7(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @ls_cost_nm7_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
size_t znload_int(void *, size_t, int /*<<< orphan*/ *, int);
size_t znload_i16(void *__restrict dst, size_t sz, int16_t x) {
  return znload_int(dst, sz, &x, sizeof(x));
}


x86 assembly (clang, -O0):
<znload_i16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <znload_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<znload_i16>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <znload_int@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @znload_i16(i8* noalias %0, i64 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i64 @znload_int(i8* %0, i64 %1, i32* %4, i32 4)
ret i64 %5
}
int sys_setsid(tcp)
struct tcb *tcp;
{
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_setsid(%struct.tcb* nocapture readnone %0) {
ret i32 0
}
char *start_of_data() {
  extern int data_start;
  return ((char *)&data_start);
}


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

x86 assembly (clang, -O2):
<start_of_data>:
mov    0x2ed9(%rip),%rax
ret

LLVM IR (-O0):
@data_start = external global i32
define i8* @start_of_data() {
ret i8* bitcast (i32* @data_start to i8*)
}

LLVM IR (-O2):
@data_start = external global i32
define i8* @start_of_data() {
ret i8* bitcast (i32* @data_start to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char const);
int is_dec(const char *n) {
  int i;
  for (i = 0; n[i]; i++)
    if (!isdigit(n[i]))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116e <is_dec+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    115b <is_dec+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1175 <is_dec+0x65>
jmp    1160 <is_dec+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <is_dec+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dec>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_dec+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <is_dec+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_dec+0x20>
jmp    114b <is_dec+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_dec(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = tail call i32 @isdigit(i8 signext %10)
%12 = icmp eq i32 %11, 0
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
int tls_read(char *buffer, int length) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @tls_read(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ __emit_string_literal_range(char *, int, int, int);
void test_ucn4(void) {
  __emit_string_literal_range("01234\u2174\u2175789", 5, 4, 11);
}


x86 assembly (clang, -O0):
<test_ucn4>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0xb,%ecx
call   1030 <__emit_string_literal_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ucn4>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
mov    $0x4,%edx
mov    $0xb,%ecx
jmp    1030 <__emit_string_literal_range@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"01234\E2\85\B4\E2\85\B5789\00"
define void @test_ucn4() {
%1 = call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 5, i32 4, i32 11)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"01234\E2\85\B4\E2\85\B5789\00"
define void @test_ucn4() {
%1 = tail call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 5, i32 4, i32 11)
ret void
}
int f(int a) {
  if (a != 2) {
    a = -a;
    if (a == 2)
      return 0;
    return 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     113b <f+0x3b>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    112f <f+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1142 <f+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1142 <f+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0xfffffffe,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp ne i32 %0, -2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_pawns_able_to_capture_any(int, int);
void b_pawns_able_to_capture_any_test(void **state) {
  assert_int_equal(
      0x0000001400000000ul,
      b_pawns_able_to_capture_any(0x0000001C00000000ul, 0x0000000008000000ul));
}


x86 assembly (clang, -O0):
<b_pawns_able_to_capture_any_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x8000000,%esi
call   1040 <b_pawns_able_to_capture_any@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_pawns_able_to_capture_any_test>:
push   %rax
xor    %edi,%edi
mov    $0x8000000,%esi
call   1040 <b_pawns_able_to_capture_any@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_pawns_able_to_capture_any_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_pawns_able_to_capture_any(i32 0, i32 134217728)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_pawns_able_to_capture_any_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_pawns_able_to_capture_any(i32 0, i32 134217728)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int bitmap32_test(int32_t *bitmap, int n) {
  return ((*bitmap & ((int32_t)1 << n)) > (int32_t)0);
}


x86 assembly (clang, -O0):
<bitmap32_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap32_test>:
mov    %esi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
test   %edx,(%rdi)
setg   %al
ret

LLVM IR (-O0):
define i32 @bitmap32_test(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @bitmap32_test(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl nuw i32 1, %1
%5 = and i32 %3, %4
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int __pipe2(int *, int /*<<< orphan*/);
int __pipe(int fds[2]) { return __pipe2(fds, 0); }


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

x86 assembly (clang, -O2):
<__pipe>:
xor    %esi,%esi
jmp    1030 <__pipe2@plt>

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

LLVM IR (-O2):
define i32 @__pipe(i32* %0) {
%2 = tail call i32 @__pipe2(i32* %0, i32 0)
ret i32 %2
}
unsigned xrop3_57_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_57_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_57_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
lea    -0x100(%rsi),%ecx
not    %eax
and    %ecx,%eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_57_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_57_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %5, -256
%8 = or i32 %6, %4
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = or i8 %1, %0
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
ret i32 %13
}
/* Variables and functions */
int getchar();
char brainfuck_get() {
  int c = getchar();
  return c >= 0 ? c : 0;
}


x86 assembly (clang, -O0):
<brainfuck_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1137 <brainfuck_get+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <brainfuck_get+0x31>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <brainfuck_get+0x31>
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brainfuck_get>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
test   %eax,%eax
cmovle %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @brainfuck_get() {
%1 = alloca i32
%2 = call i32 (...) @getchar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* %1
br label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %5
%9 = phi i32 [ %6, %5 ], [ 0, %7 ]
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @brainfuck_get() {
%1 = tail call i32 (...) @getchar()
%2 = icmp sgt i32 %1, 0
%3 = select i1 %2, i32 %1, i32 0
%4 = trunc i32 %3 to i8
ret i8 %4
}
unsigned int TestAndSet(volatile unsigned int *addr) {
  unsigned int result;
  unsigned int new = 1;
  asm volatile("lock; xchgl %0, %1"
               : "+m"(*addr), "=a"(result)
               : "1"(new)
               : "cc");
  return result;
}


x86 assembly (clang, -O0):
<TestAndSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%eax
lock xchg %eax,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestAndSet>:
mov    $0x1,%eax
lock xchg %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @TestAndSet(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %4
%5 = load i32*, i32** %2
%6 = load i32, i32* %4
%7 = call i32 asm sideeffect "lock; xchgl $0, $1", "=*m,={ax},1,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %5, i32 %6, i32* elementtype(i32) %5)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @TestAndSet(i32* %0) {
%2 = tail call i32 asm sideeffect "lock; xchgl $0, $1", "=*m,={ax},1,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 1, i32* elementtype(i32) %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gfx_select_alpha_region(int);
int /*<<< orphan*/ gfx_set_alpha_enable(int /*<<< orphan*/);
int /*<<< orphan*/ gfx_set_video_enable(int /*<<< orphan*/);
void redcloud_reset_video(void) {
  gfx_set_video_enable(0);
  gfx_select_alpha_region(1);
  gfx_set_alpha_enable(0);
  gfx_select_alpha_region(2);
  gfx_set_alpha_enable(0);
  gfx_select_alpha_region(0);
  gfx_set_alpha_enable(0);
}


x86 assembly (clang, -O0):
<redcloud_reset_video>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <gfx_set_video_enable@plt>
mov    $0x1,%edi
call   1040 <gfx_select_alpha_region@plt>
xor    %edi,%edi
call   1050 <gfx_set_alpha_enable@plt>
mov    $0x2,%edi
call   1040 <gfx_select_alpha_region@plt>
xor    %edi,%edi
call   1050 <gfx_set_alpha_enable@plt>
xor    %edi,%edi
call   1040 <gfx_select_alpha_region@plt>
xor    %edi,%edi
call   1050 <gfx_set_alpha_enable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<redcloud_reset_video>:
push   %rax
xor    %edi,%edi
call   1030 <gfx_set_video_enable@plt>
mov    $0x1,%edi
call   1040 <gfx_select_alpha_region@plt>
xor    %edi,%edi
call   1050 <gfx_set_alpha_enable@plt>
mov    $0x2,%edi
call   1040 <gfx_select_alpha_region@plt>
xor    %edi,%edi
call   1050 <gfx_set_alpha_enable@plt>
xor    %edi,%edi
call   1040 <gfx_select_alpha_region@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <gfx_set_alpha_enable@plt>

LLVM IR (-O0):
define void @redcloud_reset_video() {
%1 = call i32 @gfx_set_video_enable(i32 0)
%2 = call i32 @gfx_select_alpha_region(i32 1)
%3 = call i32 @gfx_set_alpha_enable(i32 0)
%4 = call i32 @gfx_select_alpha_region(i32 2)
%5 = call i32 @gfx_set_alpha_enable(i32 0)
%6 = call i32 @gfx_select_alpha_region(i32 0)
%7 = call i32 @gfx_set_alpha_enable(i32 0)
ret void
}

LLVM IR (-O2):
define void @redcloud_reset_video() {
%1 = tail call i32 @gfx_set_video_enable(i32 0)
%2 = tail call i32 @gfx_select_alpha_region(i32 1)
%3 = tail call i32 @gfx_set_alpha_enable(i32 0)
%4 = tail call i32 @gfx_select_alpha_region(i32 2)
%5 = tail call i32 @gfx_set_alpha_enable(i32 0)
%6 = tail call i32 @gfx_select_alpha_region(i32 0)
%7 = tail call i32 @gfx_set_alpha_enable(i32 0)
ret void
}