xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *wcsncpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                            size_t);
wchar_t *dvm_wcsncpy(wchar_t *dest, const wchar_t *src, size_t n) {
  return wcsncpy(dest, src, n);
}


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

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

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

LLVM IR (-O2):
define i32* @dvm_wcsncpy(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32* @wcsncpy(i32* %0, i32* %1, i64 %2)
ret i32* %4
}
void aFctWithFctPtr(int (*aFctPtr)(int, int), int secondArg) { int i = 0; }


x86 assembly (clang, -O0):
<aFctWithFctPtr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @aFctWithFctPtr(i32 (i32, i32)* nocapture %0, i32 %1) {
ret void
}
int __attribute__((no)) bar(int *a) { return *a; }


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

x86 assembly (clang, -O2):
<bar>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void ggscanlist2_(actno, maxno, list, return_code) int *actno, *maxno,
    *return_code;
float *list;
{}


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

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

LLVM IR (-O0):
define void @ggscanlist2_(i32* %0, i32* %1, float* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca float*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store float* %2, float** %7
store i32* %3, i32** %8
ret void
}

LLVM IR (-O2):
define void @ggscanlist2_(i32* nocapture %0, i32* nocapture %1, float* nocapture %2, i32* nocapture %3) {
ret void
}
int binaryLog2(int asciiNum) {
  int i = 0, val = 1;
  if (asciiNum < 0) {
    return 0;
  } else if (asciiNum == 0) {
    return 1;
  }
  for (i = 0; asciiNum > 0; i++) {
    asciiNum /= 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<binaryLog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    112b <binaryLog2+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1179 <binaryLog2+0x79>
cmpl   $0x0,-0x8(%rbp)
jne    1141 <binaryLog2+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1179 <binaryLog2+0x79>
jmp    1146 <binaryLog2+0x46>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1173 <binaryLog2+0x73>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <binaryLog2+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binaryLog2>:
test   %edi,%edi
js     1125 <binaryLog2+0x25>
je     1128 <binaryLog2+0x28>
xor    %eax,%eax
mov    $0xcccccccd,%ecx
nopl   (%rax)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <binaryLog2+0x10>
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @binaryLog2(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i32 [ %8, %5 ], [ %0, %3 ]
%8 = udiv i32 %7, 10
%9 = add nuw nsw i32 %6, 1
%10 = icmp ult i32 %7, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %3, %1
%12 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ replace_char(char, char *, char *, int, int);
int replace_spec_chars(char *string, int str_len) {
  replace_char('\n', "#012", string, str_len, 4);
  replace_char('\t', "#011", string, str_len, 4);
  return 0;
}


x86 assembly (clang, -O0):
<replace_spec_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0xa,%edi
lea    0xece(%rip),%rsi
mov    $0x4,%r8d
call   1030 <replace_char@plt>
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x9,%edi
lea    0xeb5(%rip),%rsi
mov    $0x4,%r8d
call   1030 <replace_char@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_spec_chars>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xee1(%rip),%rsi
mov    $0xa,%edi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    $0x4,%r8d
call   1030 <replace_char@plt>
lea    0xeca(%rip),%rsi
mov    $0x9,%edi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    $0x4,%r8d
call   1030 <replace_char@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\00"
@.str.1 = [5 x i8] c"\00"
define i32 @replace_spec_chars(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @replace_char(i8 signext 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6, i32 4)
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @replace_char(i8 signext 9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %9, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\00"
@.str.1 = [5 x i8] c"\00"
define i32 @replace_spec_chars(i8* %0, i32 %1) {
%3 = tail call i32 @replace_char(i8 signext 10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 4)
%4 = tail call i32 @replace_char(i8 signext 9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1, i32 4)
ret i32 0
}
void MUTEX_EXIT(unsigned volatile *x) { return __sync_lock_release(x); }


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

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

LLVM IR (-O0):
define void @MUTEX_EXIT(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store atomic i32 0, i32* %3 release
ret void
}

LLVM IR (-O2):
define void @MUTEX_EXIT(i32* nocapture writeonly %0) {
store atomic i32 0, i32* %0 release
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEpop(int /*<<< orphan*/ *);
void code_pop() { appendCODE(makeCODEpop(NULL)); }


x86 assembly (clang, -O0):
<code_pop>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <makeCODEpop@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @code_pop() {
%1 = call i32 @makeCODEpop(i32* null)
%2 = call i32 @appendCODE(i32 %1)
ret void
}

LLVM IR (-O2):
define void @code_pop() {
%1 = tail call i32 @makeCODEpop(i32* null)
%2 = tail call i32 @appendCODE(i32 %1)
ret void
}
int min(long long int a, long long int b) {
  if (a > b)
    return b;
  else
    return a;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1126 <min+0x26>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    112d <min+0x2d>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
%5 = trunc i64 %4 to i32
ret i32 %5
}
int _close_r(struct _reent *r, int file) { return 0; }


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

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

LLVM IR (-O0):
%struct._reent = type opaque
define i32 @_close_r(%struct._reent* %0, i32 %1) {
%3 = alloca %struct._reent*
%4 = alloca i32
store %struct._reent* %0, %struct._reent** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct._reent = type opaque
define i32 @_close_r(%struct._reent* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htole32(int /*<<< orphan*/);
void WriteLE32(unsigned char *ptr, uint32_t x) {
  *((uint32_t *)ptr) = htole32(x);
}


x86 assembly (clang, -O0):
<WriteLE32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htole32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLE32>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htole32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @WriteLE32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htole32(i32 %5)
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @WriteLE32(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htole32(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
double asin(double);
double math__Float__asin(double self) {
  double var;
  double var1;
  var1 = asin(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

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

LLVM IR (-O0):
define double @math__Float__asin(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @asin(double %5)
store double %6, double* %4
%7 = load double, double* %4
store double %7, double* %3
br label %8
8: ; preds = %1
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @math__Float__asin(double %0) {
%2 = tail call double @asin(double %0)
ret double %2
}
double Max(double a, double b) { return ((a > b) ? a : b); }


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <Max+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <Max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @Max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void tracecmd_free_list(char **list) {
  int i;
  if (!list)
    return;
  for (i = 0; list[i]; i++)
    free(list[i]);
  free(list);
}


x86 assembly (clang, -O0):
<tracecmd_free_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <tracecmd_free_list+0x1c>
jmp    116e <tracecmd_free_list+0x5e>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1165 <tracecmd_free_list+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <tracecmd_free_list+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracecmd_free_list>:
test   %rdi,%rdi
je     1150 <tracecmd_free_list+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <tracecmd_free_list+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <tracecmd_free_list+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @tracecmd_free_list(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %1, %13
ret void
}
char *strcpy(char *dest, const char *src) {
  const unsigned char *s = src;
  unsigned char *d = dest;
  while ((*d++ = *s++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114b <strcpy+0x4b>
jmp    111c <strcpy+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

LLVM IR (-O0):
define i8* @strcpy(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** %4
store i8* %7, i8** %5
%8 = load i8*, i8** %3
store i8* %8, i8** %6
br label %9
9: ; preds = %16, %2
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %5
%12 = load i8, i8* %10
%13 = load i8*, i8** %6
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %6
store i8 %12, i8* %13
%15 = icmp ne i8 %12, 0
br i1 %15, label %16, label %17
16: ; preds = %9
br label %9
17: ; preds = %9
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ s2chromacpts(int, float *, float *, float *, float *,
                                float *, float, float);
void s2chromacpts_(int *n, float *ix, float *iy, float *iz, float *dist,
                   float *size, float *dmin, float *dmax) {
  s2chromacpts(*n, ix, iy, iz, dist, size, *dmin, *dmax);
}


x86 assembly (clang, -O0):
<s2chromacpts_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    0x18(%rbp),%rax
movss  (%rax),%xmm1
call   1030 <s2chromacpts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2chromacpts_>:
mov    0x10(%rsp),%r10
mov    0x8(%rsp),%rax
mov    (%rdi),%edi
movss  (%rax),%xmm0
movss  (%r10),%xmm1
jmp    1030 <s2chromacpts@plt>

LLVM IR (-O0):
define void @s2chromacpts_(i32* %0, float* %1, float* %2, float* %3, float* %4, float* %5, float* %6, float* %7) {
%9 = alloca i32*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca float*
%15 = alloca float*
%16 = alloca float*
store i32* %0, i32** %9
store float* %1, float** %10
store float* %2, float** %11
store float* %3, float** %12
store float* %4, float** %13
store float* %5, float** %14
store float* %6, float** %15
store float* %7, float** %16
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load float*, float** %10
%20 = load float*, float** %11
%21 = load float*, float** %12
%22 = load float*, float** %13
%23 = load float*, float** %14
%24 = load float*, float** %15
%25 = load float, float* %24
%26 = load float*, float** %16
%27 = load float, float* %26
%28 = call i32 @s2chromacpts(i32 %18, float* %19, float* %20, float* %21, float* %22, float* %23, float %25, float %27)
ret void
}

LLVM IR (-O2):
define void @s2chromacpts_(i32* nocapture %0, float* %1, float* %2, float* %3, float* %4, float* %5, float* nocapture %6, float* nocapture %7) {
%9 = load i32, i32* %0
%10 = load float, float* %6
%11 = load float, float* %7
%12 = tail call i32 @s2chromacpts(i32 %9, float* %1, float* %2, float* %3, float* %4, float* %5, float %10, float %11)
ret void
}
/* Variables and functions */
int get_flag(int);
bool get_halfcarry() { return get_flag(5); }


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

x86 assembly (clang, -O2):
<get_halfcarry>:
mov    $0x5,%edi
jmp    1030 <get_flag@plt>

LLVM IR (-O0):
define i32 @get_halfcarry() {
%1 = call i32 @get_flag(i32 5)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_halfcarry() {
%1 = tail call i32 @get_flag(i32 5)
ret i32 %1
}
/* Variables and functions */
char *oauth_serialize_url(int, int, char **);
char *oauth_serialize_url_parameters(int argc, char **argv) {
  return oauth_serialize_url(argc, 1, argv);
}


x86 assembly (clang, -O0):
<oauth_serialize_url_parameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <oauth_serialize_url@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oauth_serialize_url_parameters>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <oauth_serialize_url@plt>

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

LLVM IR (-O2):
define i8* @oauth_serialize_url_parameters(i32 %0, i8** %1) {
%3 = tail call i8* @oauth_serialize_url(i32 %0, i32 1, i8** %1)
ret i8* %3
}
int test_imm_AFuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xAF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AFuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xaf,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_AFuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11468800
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned short int f77(unsigned short int x, int y) {
  return (x << y) + (x >> ((-y) & (8 * sizeof(unsigned short) - 1)));
}


x86 assembly (clang, -O0):
<f77>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
movslq %ecx,%rcx
and    $0xf,%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f77>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0xf,%cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f77(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = sext i32 %12 to i64
%14 = and i64 %13, 15
%15 = trunc i64 %14 to i32
%16 = ashr i32 %10, %15
%17 = add nsw i32 %8, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f77(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = shl i32 %3, %1
%5 = sub nsw i32 0, %1
%6 = and i32 %5, 15
%7 = lshr i32 %3, %6
%8 = add nsw i32 %7, %4
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int _write(int fd, const void *buffer, unsigned int count) {
  fprintf(stderr, "write not implemented\n");
  return -1;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"write not implemented\0A\00"
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"write not implemented\0A\00"
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
char *PrinterError(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char string[100] = {0};
  fflush(stdin);
  gets(string);
  char *result = PrinterError(string);
  puts(result);
  free(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
lea    -0x80(%rbp),%rdi
call   1070 <gets@plt>
lea    -0x80(%rbp),%rdi
call   1050 <PrinterError@plt>
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1050 <PrinterError@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [100 x i8]* %6 to i8*
%9 = load i32, i32* @stdin
%10 = call i32 @fflush(i32 %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%12 = call i32 @gets(i8* %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = call i8* @PrinterError(i8* %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = call i32 @puts(i8* %15)
%17 = load i8*, i8** %7
%18 = call i32 @free(i8* %17)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32 @gets(i8* %4)
%8 = call i8* @PrinterError(i8* %4)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
%10 = call i32 @free(i8* %8)
ret i32 0
}
unsigned int test_1(unsigned int a, unsigned int b, unsigned int c,
                    unsigned int d) {
  return (a / b) + c + d;
}


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

x86 assembly (clang, -O2):
<test_1>:
mov    %edx,%r8d
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    %ecx,%r8d
add    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @test_1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = udiv i32 %9, %10
%12 = load i32, i32* %7
%13 = add i32 %11, %12
%14 = load i32, i32* %8
%15 = add i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @test_1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = udiv i32 %0, %1
%6 = add i32 %3, %2
%7 = add i32 %6, %5
ret i32 %7
}
unsigned long task_size(void) { return (0x0000400000000000UL); }


x86 assembly (clang, -O0):
<task_size>:
push   %rbp
mov    %rsp,%rbp
movabs $0x400000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_size>:
movabs $0x400000000000,%rax
ret

LLVM IR (-O0):
define i64 @task_size() {
ret i64 70368744177664
}

LLVM IR (-O2):
define i64 @task_size() {
ret i64 70368744177664
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int initgroups(const char *user, gid_t group) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @initgroups(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ isnum(char);
int ntoi(char c) {
  if (isnum(c))
    return c - '0';
  return -1;
}


x86 assembly (clang, -O0):
<ntoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isnum@plt>
cmp    $0x0,%rax
je     1140 <ntoi+0x30>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <ntoi+0x37>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntoi>:
push   %rbx
mov    %edi,%ebx
call   1030 <isnum@plt>
add    $0xffffffd0,%ebx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ntoi(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isnum(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @ntoi(i8 signext %0) {
%2 = tail call i64 @isnum(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main() {
  int a, b, c, d;
  scanf("%d %d %d %d", &a, &b, &c, &d);
  printf("DIFERENCA = %d\n", (a * b - c * d));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
sub    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
imul   0x14(%rsp),%esi
mov    0x8(%rsp),%eax
imul   0xc(%rsp),%eax
sub    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [16 x i8] c"DIFERENCA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, %10
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, %13
%16 = sub nsw i32 %12, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}
int _ipa_read_dbg_cnt_v1_1(char *buf, int max_len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_ipa_read_dbg_cnt_v1_1(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int toupper(int);
int from_hex(int letter) {
  letter = toupper(letter);
  if (letter < '0')
    return 0;
  if (letter > 'F')
    return 15;
  letter -= '0';
  if (letter > 9)
    letter -= 7;
  return letter;
}


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jge    113c <from_hex+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1174 <from_hex+0x64>
cmpl   $0x46,-0x8(%rbp)
jle    1152 <from_hex+0x42>
movl   $0xf,-0x4(%rbp)
jmp    1174 <from_hex+0x64>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jle    116e <from_hex+0x5e>
mov    -0x8(%rbp),%eax
sub    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
push   %rax
call   1030 <toupper@plt>
xor    %ecx,%ecx
cmp    $0x30,%eax
jl     1133 <from_hex+0x23>
mov    $0xf,%ecx
cmp    $0x46,%eax
ja     1133 <from_hex+0x23>
lea    -0x30(%rax),%edx
lea    -0x37(%rax),%ecx
cmp    $0x3a,%eax
cmovb  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @from_hex(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
%3 = icmp slt i32 %2, 48
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = icmp ugt i32 %2, 70
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = icmp ugt i32 %2, 57
%8 = select i1 %7, i32 -55, i32 -48
%9 = add nsw i32 %8, %2
br label %10
10: ; preds = %4, %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ], [ 15, %4 ]
ret i32 %11
}
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ nodename;
};

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, size_t);
int uname(struct utsname *);
int gethostname(char *name, size_t len) {
  struct utsname utn;
  if (-1 == uname(&utn)) {
    return -1;
  }
  strncpy(name, utn.nodename, len);
  return 0;
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <uname@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1154 <gethostname+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <gethostname+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostname>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1040 <uname@plt>
cmp    $0xffffffff,%eax
je     1149 <gethostname+0x29>
mov    (%rsp),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <strncpy@plt>
xor    %eax,%eax
jmp    114e <gethostname+0x2e>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.utsname = type { i32 }
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %struct.utsname
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = call i32 @uname(%struct.utsname* %6)
%8 = icmp eq i32 -1, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %16
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i64, i64* %5
%15 = call i32 @strncpy(i8* %11, i32 %13, i64 %14)
store i32 0, i32* %3
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca %struct.utsname
%4 = bitcast %struct.utsname* %3 to i8*
%5 = call i32 @uname(%struct.utsname* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32 @strncpy(i8* %0, i32 %9, i64 %1)
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %12
}
short readshort(void *value) {
  unsigned char *bytes = (unsigned char *)value;
  return bytes[0] | (bytes[1] << 8);
}


x86 assembly (clang, -O0):
<readshort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<readshort>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define signext i16 @readshort(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @readshort(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = or i16 %7, %3
ret i16 %8
}
int comparelongs(a, b)
long *a, *b;
{ return (((*a) < (*b)) ? -1 : (((*a) == (*b)) ? 0 : 1)); }


x86 assembly (clang, -O0):
<comparelongs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jge    112d <comparelongs+0x2d>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <comparelongs+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparelongs>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comparelongs(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = icmp slt i64 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %19
11: ; preds = %2
%12 = load i64*, i64** %3
%13 = load i64, i64* %12
%14 = load i64*, i64** %4
%15 = load i64, i64* %14
%16 = icmp eq i64 %13, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 1
br label %19
19: ; preds = %11, %10
%20 = phi i32 [ -1, %10 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @comparelongs(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = icmp slt i64 %3, %4
%6 = icmp ne i64 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
int test_imm_34int64_midword_reg(long long val) {
  return ((val >> 16) & (0x34 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_34int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x34,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_34int64_midword_reg(i64 %0) {
%2 = and i64 %0, 3407872
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void jumpaway(int *ptr) { __builtin_longjmp(ptr, 1); }


x86 assembly (clang, -O0):
<jumpaway>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rbp
mov    0x8(%rcx),%rax
mov    0x10(%rcx),%rsp
jmp    *%rax

x86 assembly (clang, -O2):
<jumpaway>:
push   %rbp
mov    (%rdi),%rbp
mov    0x8(%rdi),%rax
mov    0x10(%rdi),%rsp
jmp    *%rax

LLVM IR (-O0):
define void @jumpaway(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8**
%5 = bitcast i8** %4 to i8*
unreachable
}

LLVM IR (-O2):
define void @jumpaway(i32* %0) {
%2 = bitcast i32* %0 to i8*
tail call void @llvm.eh.sjlj.longjmp(i8* %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bitmap_size(int);
void *calloc(int, int /*<<< orphan*/);
void *bitmap_alloc(int nr_bits) { return calloc(1, bitmap_size(nr_bits)); }


x86 assembly (clang, -O0):
<bitmap_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bitmap_size@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_alloc>:
push   %rax
call   1040 <bitmap_size@plt>
mov    $0x1,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @bitmap_alloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bitmap_size(i32 %3)
%5 = call i8* @calloc(i32 1, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @bitmap_alloc(i32 %0) {
%2 = tail call i32 @bitmap_size(i32 %0)
%3 = tail call i8* @calloc(i32 1, i32 %2)
ret i8* %3
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i1 = 3, i2 = 5;
  printf("i1 + i2 = %i\n", i1 + i2);
  printf("add(i1, i2) = %i\n", add(i1, i2));
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <add@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"i1 + i2 = %i\0A\00"
@.str.1 = [18 x i8] c"add(i1, i2) = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @add(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 1
}

LLVM IR (-O2):
@.str = [14 x i8] c"i1 + i2 = %i\0A\00"
@.str.1 = [18 x i8] c"add(i1, i2) = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @add(i32 3, i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 1
}
void resume_device_irqs(void) {}


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

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

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

LLVM IR (-O2):
define void @resume_device_irqs() {
ret void
}