xunge/DecIR huggingface dataset:
int redislite_get_2bytes(unsigned char *p) { return p[1] + (p[0] << 8); }


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

x86 assembly (clang, -O2):
<redislite_get_2bytes>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @redislite_get_2bytes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @redislite_get_2bytes(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvInitCapture(char byBoardNum) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvInitCapture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvInitCapture(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvInitCapture(i8 signext %0) {
%2 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char *strcpy(char *s1, const char *s2) {
  char *t;
  t = s1;
  while ((*s1++ = *s2++) != '\0')
    ;
  return t;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%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*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %15, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = sext i8 %10 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %7
br label %7
16: ; preds = %7
%17 = load i8*, i8** %5
ret i8* %17
}

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*/ quicksort_shuffle(long *, int);
int /*<<< orphan*/ quicksort_sort(long *, int /*<<< orphan*/, int);
void quicksort(long *array, int length) {
  quicksort_shuffle(array, length);
  quicksort_sort(array, 0, length - 1);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <quicksort_shuffle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <quicksort_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <quicksort_shuffle@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <quicksort_sort@plt>

LLVM IR (-O0):
define void @quicksort(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = call i32 @quicksort_shuffle(i64* %5, i32 %6)
%8 = load i64*, i64** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = call i32 @quicksort_sort(i64* %8, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @quicksort(i64* %0, i32 %1) {
%3 = tail call i32 @quicksort_shuffle(i64* %0, i32 %1)
%4 = add nsw i32 %1, -1
%5 = tail call i32 @quicksort_sort(i64* %0, i32 0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_material_fromfile(int /*<<< orphan*/);
void fgmvwrite_material_fromfile_(char filnam[]) {
  gmvwrite_material_fromfile(fortchartoc(filnam));
}


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_material_fromfile_(i8* %0) {
%2 = tail call i32 @fortchartoc(i8* %0)
%3 = tail call i32 @gmvwrite_material_fromfile(i32 %2)
ret void
}
int _close_PCI(int pci_handle, int BASE0, int BASE1) {
  int temp;
  return 1;
}


x86 assembly (clang, -O0):
<_close_PCI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_close_PCI(i32 %0, i32 %1, i32 %2) {
ret i32 1
}
/* Variables and functions */
int test_client_nonblock_slow();
int main() {
  int nret = 0;
  nret = test_client_nonblock_slow();
  return -nret;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test_client_nonblock_slow()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_client_nonblock_slow()
%2 = sub nsw i32 0, %1
ret i32 %2
}
unsigned p_HexCharValue(char cValue) {
  if (cValue < ('9' + 1))
    return (cValue - '0');
  if (cValue < ('F' + 1))
    return (cValue - 'A' + 10);
  return (cValue - 'a' + 10);
}


x86 assembly (clang, -O0):
<p_HexCharValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x3a,%eax
jge    1126 <p_HexCharValue+0x26>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <p_HexCharValue+0x52>
movsbl -0x5(%rbp),%eax
cmp    $0x47,%eax
jge    1145 <p_HexCharValue+0x45>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <p_HexCharValue+0x52>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_HexCharValue>:
xor    %ecx,%ecx
cmp    $0x47,%dil
setb   %cl
shl    $0x5,%ecx
add    $0xffffffa9,%ecx
cmp    $0x3a,%dil
mov    $0xffffffd0,%eax
cmovge %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @p_HexCharValue(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 58
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 %25
11: ; preds = %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp slt i32 %13, 71
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 65
%19 = add nsw i32 %18, 10
store i32 %19, i32* %2
br label %25
20: ; preds = %11
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 97
%24 = add nsw i32 %23, 10
store i32 %24, i32* %2
br label %25
25: ; preds = %20, %15, %7
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @p_HexCharValue(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 58
%4 = icmp ult i8 %0, 71
%5 = select i1 %4, i32 -55, i32 -87
%6 = select i1 %3, i32 -48, i32 %5
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ DSA;

/* Variables and functions */
int /*<<< orphan*/ DSA_up_ref(int /*<<< orphan*/ *);
int EVP_PKEY_assign_DSA(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) {
  int ret = EVP_PKEY_assign_DSA(pkey, key);
  if (ret)
    DSA_up_ref(key);
  return ret;
}


x86 assembly (clang, -O0):
<EVP_PKEY_set1_DSA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <EVP_PKEY_assign_DSA@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1153 <EVP_PKEY_set1_DSA+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <DSA_up_ref@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_PKEY_set1_DSA>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <EVP_PKEY_assign_DSA@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1139 <EVP_PKEY_set1_DSA+0x19>
mov    %rbx,%rdi
call   1030 <DSA_up_ref@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @EVP_PKEY_set1_DSA(i32* %0, i32* %1) {
%3 = tail call i32 @EVP_PKEY_assign_DSA(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @DSA_up_ref(i32* %1)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EOR_();
int /*<<< orphan*/ c64_memAbsoluteAddr();
void EOR_abs(void) {
  c64_memAbsoluteAddr();
  EOR_();
}


x86 assembly (clang, -O0):
<EOR_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <c64_memAbsoluteAddr@plt>
mov    $0x0,%al
call   1030 <EOR_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EOR_abs>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memAbsoluteAddr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <EOR_@plt>

LLVM IR (-O0):
define void @EOR_abs() {
%1 = call i32 (...) @c64_memAbsoluteAddr()
%2 = call i32 (...) @EOR_()
ret void
}

LLVM IR (-O2):
define void @EOR_abs() {
%1 = tail call i32 (...) @c64_memAbsoluteAddr()
%2 = tail call i32 (...) @EOR_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcdPutchar(int, int /*<<< orphan*/);
void lcdPuts(int fd, char *string) {
  while (*string)
    lcdPutchar(fd, *string++);
}


x86 assembly (clang, -O0):
<lcdPuts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <lcdPuts+0x3b>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <lcdPutchar@plt>
jmp    111f <lcdPuts+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdPuts>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1145 <lcdPuts+0x35>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <lcdPutchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <lcdPuts+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @lcdPuts(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @lcdPutchar(i32 %0, i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
void position(char maze[23][30], int numbers_player[3], char player) {
  int i, j;
  i = numbers_player[0];
  j = numbers_player[1];
  maze[i][j] = player;
}


x86 assembly (clang, -O0):
<position>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<position>:
movslq (%rsi),%rax
movslq 0x4(%rsi),%rcx
mov    %rax,%rsi
shl    $0x5,%rsi
sub    %rax,%rsi
sub    %rax,%rsi
add    %rdi,%rsi
mov    %dl,(%rcx,%rsi,1)
ret

LLVM IR (-O0):
define void @position([30 x i8]* %0, i32* %1, i8 signext %2) {
%4 = alloca [30 x i8]*
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store [30 x i8]* %0, [30 x i8]** %4
store i32* %1, i32** %5
store i8 %2, i8* %6
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
store i32 %14, i32* %8
%15 = load i8, i8* %6
%16 = load [30 x i8]*, [30 x i8]** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 %18
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [30 x i8], [30 x i8]* %19, i64 0, i64 %21
store i8 %15, i8* %22
ret void
}

LLVM IR (-O2):
define void @position([30 x i8]* nocapture writeonly %0, i32* nocapture %1, i8 signext %2) {
%4 = load i32, i32* %1
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = sext i32 %4 to i64
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %0, i64 %7, i64 %8
store i8 %2, i8* %9
ret void
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ inch();
int /*<<< orphan*/ report_byte(int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
void cmd_inch(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_byte(inch());
}


x86 assembly (clang, -O0):
<cmd_inch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_inch+0x27>
jmp    117f <cmd_inch+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <inch@plt>
mov    %eax,%edi
call   1030 <report_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_inch>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_inch+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <inch@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_byte@plt>

LLVM IR (-O0):
define void @cmd_inch(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 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @inch()
%12 = call i32 @report_byte(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_inch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @inch()
%8 = tail call i32 @report_byte(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
void __attribute__((used)) used_fn2(void) {}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @used_fn2 to i8*)], section "llvm.metadata"
define void @used_fn2() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @used_fn2 to i8*)], section "llvm.metadata"
define void @used_fn2() {
ret void
}
lower(s) char *s;
{
  int n = 0;
  while (*s) {
    if (isupper(*s))
      *s = tolower(*s);
    s++, n++;
  }
  return (n);
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1183 <lower+0x63>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     1169 <lower+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <lower+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1169 <lower+0x49>
mov    %rdi,%r14
xor    %ebx,%ebx
jmp    114e <lower+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
je     116b <lower+0x4b>
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %eax,%eax
je     1140 <lower+0x20>
mov    %ebp,%edi
call   1030 <tolower@plt>
mov    %al,(%r14,%rbx,1)
jmp    1140 <lower+0x20>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %14
%5 = phi i8 [ %17, %14 ], [ %2, %1 ]
%6 = phi i32 [ %16, %14 ], [ 0, %1 ]
%7 = phi i8* [ %15, %14 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = tail call i32 @isupper(i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %4
%12 = tail call i32 @tolower(i32 %8)
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
br label %14
14: ; preds = %11, %4
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = add nuw nsw i32 %6, 1
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %14, %1
%20 = phi i32 [ 0, %1 ], [ %16, %14 ]
ret i32 %20
}
/* Type definitions */
struct sg_rand_state {
  int dummy;
};

/* Variables and functions */
scalar_t__ sg_irand(struct sg_rand_state *);
double sg_frand(struct sg_rand_state *s) {
  return (float)sg_irand(s) * (1.0f / 4294967296.0f);
}


x86 assembly (clang, -O0):
<sg_frand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sg_irand@plt>
cvtsi2ss %rax,%xmm0
movss  0xece(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_frand>:
push   %rax
call   1030 <sg_irand@plt>
cvtsi2ss %rax,%xmm0
mulss  0xedd(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.sg_rand_state = type { i32 }
define double @sg_frand(%struct.sg_rand_state* %0) {
%2 = alloca %struct.sg_rand_state*
store %struct.sg_rand_state* %0, %struct.sg_rand_state** %2
%3 = load %struct.sg_rand_state*, %struct.sg_rand_state** %2
%4 = call i64 @sg_irand(%struct.sg_rand_state* %3)
%5 = sitofp i64 %4 to float
%6 = fmul float %5, 0x3DF0000000000000
%7 = fpext float %6 to double
ret double %7
}

LLVM IR (-O2):
%struct.sg_rand_state = type { i32 }
define double @sg_frand(%struct.sg_rand_state* %0) {
%2 = tail call i64 @sg_irand(%struct.sg_rand_state* %0)
%3 = sitofp i64 %2 to float
%4 = fmul float %3, 0x3DF0000000000000
%5 = fpext float %4 to double
ret double %5
}
void ff_hevc_put_hevc_bi_epel_v16_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v16_12_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ jenkins_hash_array(int /*<<< orphan*/ const *,
                                      int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t jenkins_hash_intarray2(const int32_t *d, uint32_t n, uint32_t seed) {
  return jenkins_hash_array((const uint32_t *)d, n, seed);
}


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

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

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

LLVM IR (-O2):
define i32 @jenkins_hash_intarray2(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @jenkins_hash_array(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int getbc(int);
int getbc0(int, int);
int getnum_l1a() {
  int i = 1, j;
  for (;;) {
    j = getbc(1);
    if (j < 0)
      return j;
    if (j)
      break;
    i = getbc0(1, i);
    if (i < 0)
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<getnum_l1a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <getbc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1151 <getnum_l1a+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118a <getnum_l1a+0x6a>
cmpl   $0x0,-0xc(%rbp)
je     1160 <getnum_l1a+0x40>
jmp    1184 <getnum_l1a+0x64>
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1030 <getbc0@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    117f <getnum_l1a+0x5f>
jmp    1184 <getnum_l1a+0x64>
jmp    112f <getnum_l1a+0xf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum_l1a>:
push   %rbx
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <getbc@plt>
test   %eax,%eax
js     1154 <getnum_l1a+0x34>
jne    1156 <getnum_l1a+0x36>
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <getbc0@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1130 <getnum_l1a+0x10>
jmp    1156 <getnum_l1a+0x36>
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getnum_l1a() {
br label %1
1: ; preds = %7, %0
%2 = phi i32 [ 1, %0 ], [ %8, %7 ]
%3 = tail call i32 @getbc(i32 1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = icmp eq i32 %3, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = tail call i32 @getbc0(i32 1, i32 %2)
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %1
10: ; preds = %5, %7, %1
%11 = phi i32 [ %3, %1 ], [ %2, %5 ], [ %8, %7 ]
ret i32 %11
}
float SQR(float a) {
  if (a == 0.0) {
    return 0.0;
  } else {
    return a * a;
  }
}


x86 assembly (clang, -O0):
<SQR>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1132 <SQR+0x32>
jp     1132 <SQR+0x32>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1141 <SQR+0x41>
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SQR>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpeqss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @SQR(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %12
8: ; preds = %1
%9 = load float, float* %3
%10 = load float, float* %3
%11 = fmul float %9, %10
store float %11, float* %2
br label %12
12: ; preds = %8, %7
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @SQR(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
%3 = fmul float %0, %0
%4 = select i1 %2, float 0.000000e+00, float %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int sample_to_new_slices();
int solcon_write_standard_solutions();
int swap_slices();
int validate_solutions();
int witness_set_to_system_container();
int track_paths(void) {
  int fail;
  fail = sample_to_new_slices();
  if (0 > 0)
    printf("Done tracking.\n");
  if (0 > 1)
    printf("Solutions computed :\n");
  if (0 > 1)
    fail = solcon_write_standard_solutions();
  fail = swap_slices();
  fail = witness_set_to_system_container();
  fail = validate_solutions();
  return fail;
}


x86 assembly (clang, -O0):
<track_paths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <sample_to_new_slices@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <swap_slices@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <witness_set_to_system_container@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <validate_solutions@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<track_paths>:
push   %rax
xor    %eax,%eax
call   1050 <sample_to_new_slices@plt>
xor    %eax,%eax
call   1040 <swap_slices@plt>
xor    %eax,%eax
call   1030 <witness_set_to_system_container@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <validate_solutions@plt>

LLVM IR (-O0):
define i32 @track_paths() {
%1 = alloca i32
%2 = call i32 (...) @sample_to_new_slices()
store i32 %2, i32* %1
%3 = call i32 (...) @swap_slices()
store i32 %3, i32* %1
%4 = call i32 (...) @witness_set_to_system_container()
store i32 %4, i32* %1
%5 = call i32 (...) @validate_solutions()
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @track_paths() {
%1 = tail call i32 (...) @sample_to_new_slices()
%2 = tail call i32 (...) @swap_slices()
%3 = tail call i32 (...) @witness_set_to_system_container()
%4 = tail call i32 (...) @validate_solutions()
ret i32 %4
}
int __syscall_error(void) {
  register int edx __asm__("%edx");
  __asm__("mov %eax, %edx\n\t"
          "negl %edx");
  __set_errno(edx);
  return -1;
}


x86 assembly (clang, -O0):
<__syscall_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %eax,%edx
neg    %edx
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_error>:
push   %rax
mov    %eax,%edx
neg    %edx
xor    %eax,%eax
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__syscall_error() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 (i32, ...) bitcast (i32 (...)* @__set_errno to i32 (i32, ...)*)(i32 %2)
ret i32 -1
}

LLVM IR (-O2):
define i32 @__syscall_error() {
tail call void asm sideeffect "mov %eax, %edx\0A\09negl %edx", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @__set_errno to i32 (i32, ...)*)(i32 undef)
ret i32 -1
}
/* Variables and functions */
int *malloc(int);
int *int_ptr(int val) {
  int *res = malloc(sizeof res);
  *res = val;
  return res;
}


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

x86 assembly (clang, -O2):
<int_ptr>:
push   %rbx
mov    %edi,%ebx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @int_ptr(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @malloc(i32 8)
store i32* %4, i32** %3
%5 = load i32, i32* %2
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = load i32*, i32** %3
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @int_ptr(i32 %0) {
%2 = tail call i32* @malloc(i32 8)
store i32 %0, i32* %2
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ system(char *);
int main() {
  chdir("/mnt/user/code/MotoredCamera/bin");
  system("/mnt/user/jvm/java Main");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <chdir@plt>
lea    0xeea(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"/mnt/user/code/MotoredCamera/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @chdir(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"/mnt/user/code/MotoredCamera/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void g_value_array_free() {}


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

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

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

LLVM IR (-O2):
define void @g_value_array_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_SHRU(int r, int v) { C67_asm("SHRU.S", r, v, v); }


x86 assembly (clang, -O0):
<C67_SHRU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed2(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_SHRU>:
mov    %esi,%ecx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
mov    %ecx,%edx
jmp    1030 <C67_asm@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"SHRU.S\00"
define void @C67_SHRU(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %1)
ret void
}
void d2i_PKCS7(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PKCS7() {
ret void
}
/* Type definitions */
struct brw_compile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ brw_wm_projective_st(struct brw_compile *, int, int, int);
int brw_wm_sample(struct brw_compile *, int, int, int, int);
int brw_wm_projective(struct brw_compile *p, int dw, int channel, int msg,
                      int result) {
  brw_wm_projective_st(p, dw, channel, msg);
  return brw_wm_sample(p, dw, channel, msg, result);
}


x86 assembly (clang, -O0):
<brw_wm_projective>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <brw_wm_projective_st@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1040 <brw_wm_sample@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brw_wm_projective>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <brw_wm_projective_st@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <brw_wm_sample@plt>

LLVM IR (-O0):
%struct.brw_compile = type { i32 }
define i32 @brw_wm_projective(%struct.brw_compile* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.brw_compile*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.brw_compile* %0, %struct.brw_compile** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.brw_compile*, %struct.brw_compile** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = call i32 @brw_wm_projective_st(%struct.brw_compile* %11, i32 %12, i32 %13, i32 %14)
%16 = load %struct.brw_compile*, %struct.brw_compile** %6
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = call i32 @brw_wm_sample(%struct.brw_compile* %16, i32 %17, i32 %18, i32 %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
%struct.brw_compile = type { i32 }
define i32 @brw_wm_projective(%struct.brw_compile* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @brw_wm_projective_st(%struct.brw_compile* %0, i32 %1, i32 %2, i32 %3)
%7 = tail call i32 @brw_wm_sample(%struct.brw_compile* %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret i32 %7
}
int main(void) {
  5 % 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int __raw_readl(unsigned int ptr) {
  return *((volatile unsigned int *)ptr);
}


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

x86 assembly (clang, -O2):
<__raw_readl>:
mov    %edi,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @__raw_readl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @__raw_readl(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
ret i32 %4
}
void m_trace(text) char *text;
{ m_errline(text); }


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

x86 assembly (clang, -O2):
<m_trace>:
xor    %eax,%eax
jmp    1030 <m_errline@plt>

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

LLVM IR (-O2):
define void @m_trace(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @m_errline to i32 (i8*, ...)*)(i8* %0)
ret void
}
int test_imm_8Euint8_reg(unsigned char val) {
  return ((val) & (-0x8E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Euint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff72,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Euint8_reg>:
test   $0x72,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Euint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 114
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void backspace(void) {
  putc(8, stdout);
  putc(32, stdout);
  putc(8, stdout);
}


x86 assembly (clang, -O0):
<backspace>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0x8,%edi
call   1030 <putc@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1030 <putc@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    $0x8,%edi
call   1030 <putc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<backspace>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0x8,%edi
call   1030 <putc@plt>
mov    (%rbx),%esi
mov    $0x20,%edi
call   1030 <putc@plt>
mov    (%rbx),%esi
mov    $0x8,%edi
pop    %rbx
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @backspace() {
%1 = load i32, i32* @stdout
%2 = call i32 @putc(i32 8, i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @putc(i32 32, i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @putc(i32 8, i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @backspace() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @putc(i32 8, i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @putc(i32 32, i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @putc(i32 8, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void stk_echo(const char *instr) { fprintf(stderr, "%s\n", instr); }


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @stk_echo(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct FATPartition {
  int dummy;
};

/* Variables and functions */
int FAT_format(void *, struct FATPartition *);
int FAT_mkfs(void *ctx, struct FATPartition *part) {
  return FAT_format(ctx, part);
}


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

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

LLVM IR (-O0):
%struct.FATPartition = type { i32 }
define i32 @FAT_mkfs(i8* %0, %struct.FATPartition* %1) {
%3 = alloca i8*
%4 = alloca %struct.FATPartition*
store i8* %0, i8** %3
store %struct.FATPartition* %1, %struct.FATPartition** %4
%5 = load i8*, i8** %3
%6 = load %struct.FATPartition*, %struct.FATPartition** %4
%7 = call i32 @FAT_format(i8* %5, %struct.FATPartition* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.FATPartition = type { i32 }
define i32 @FAT_mkfs(i8* %0, %struct.FATPartition* %1) {
%3 = tail call i32 @FAT_format(i8* %0, %struct.FATPartition* %1)
ret i32 %3
}
void debugpins_frame_set() {}


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

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

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

LLVM IR (-O2):
define void @debugpins_frame_set() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short);
short testshort(short a, unsigned short b) {
  printf("%d\n", a);
  printf("%u\n", b);
  return a + b;
}


x86 assembly (clang, -O0):
<testshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    0xed3(%rip),%rdi
movzwl -0x2(%rbp),%esi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
movzwl -0x4(%rbp),%esi
call   1030 <printf@plt>
movswl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testshort>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movzwl %bp,%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%u\0A\00"
define signext i16 @testshort(i16 signext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext %5)
%7 = load i16, i16* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %7)
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = add nsw i32 %10, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%u\0A\00"
define signext i16 @testshort(i16 signext %0, i16 zeroext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %1)
%5 = add i16 %1, %0
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ func();
void test2(char *signature) {
  char ch = signature[0];
  if (ch == 15 || ch == 3) {
    if (ch > 14)
      func();
  }
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xf,%eax
je     113f <test2+0x2f>
movsbl -0x9(%rbp),%eax
cmp    $0x3,%eax
jne    1158 <test2+0x48>
movsbl -0x9(%rbp),%eax
cmp    $0xe,%eax
jle    1153 <test2+0x43>
mov    $0x0,%al
call   1030 <func@plt>
jmp    1158 <test2+0x48>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
cmpb   $0xf,(%rdi)
jne    111c <test2+0xc>
xor    %eax,%eax
jmp    1030 <func@plt>
ret

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

LLVM IR (-O2):
define void @test2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 15
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @func()
br label %6
6: ; preds = %4, %1
ret void
}