xunge/DecIR huggingface dataset:
void transfer_YUV888_to_UYVA8888(unsigned char *(*output),
                                 unsigned char *input) {
  (*output)[0] = input[1];
  (*output)[1] = input[0];
  (*output)[2] = input[2];
  (*output)[3] = 0xff;
  (*output) += 4;
}


x86 assembly (clang, -O0):
<transfer_YUV888_to_UYVA8888>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movb   $0xff,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_YUV888_to_UYVA8888>:
mov    0x1(%rsi),%al
mov    (%rdi),%rcx
mov    %al,(%rcx)
mov    (%rsi),%al
mov    (%rdi),%rcx
mov    %al,0x1(%rcx)
mov    0x2(%rsi),%al
mov    (%rdi),%rcx
mov    %al,0x2(%rcx)
mov    (%rdi),%rax
movb   $0xff,0x3(%rax)
addq   $0x4,(%rdi)
ret

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

LLVM IR (-O2):
define void @transfer_YUV888_to_UYVA8888(i8** nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %3
%5 = load i8*, i8** %0
store i8 %4, i8* %5
%6 = load i8, i8* %1
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %1, i64 2
%10 = load i8, i8* %9
%11 = load i8*, i8** %0
%12 = getelementptr inbounds i8, i8* %11, i64 2
store i8 %10, i8* %12
%13 = load i8*, i8** %0
%14 = getelementptr inbounds i8, i8* %13, i64 3
store i8 -1, i8* %14
%15 = load i8*, i8** %0
%16 = getelementptr inbounds i8, i8* %15, i64 4
store i8* %16, i8** %0
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_multprec_container_to_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(284, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_container_to_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_container_to_start_system>:
mov    $0x11c,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_multprec_container_to_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 284, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_multprec_container_to_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 284, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ indirectx();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
void adcIndirectx8(void) { adc8(readmem65816(indirectx())); }


x86 assembly (clang, -O0):
<adcIndirectx8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectx@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcIndirectx8>:
push   %rax
xor    %eax,%eax
call   1040 <indirectx@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcIndirectx8() {
%1 = call i32 (...) @indirectx()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcIndirectx8() {
%1 = tail call i32 (...) @indirectx()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}
void X509_certificate_type(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_certificate_type() {
ret void
}
/* Variables and functions */
unsigned char dxl_read_word(unsigned char, int);
unsigned char getFirmwareVersion(unsigned char id) {
  return dxl_read_word(id, (2));
}


x86 assembly (clang, -O0):
<getFirmwareVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_word@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFirmwareVersion>:
mov    $0x2,%esi
jmp    1030 <dxl_read_word@plt>

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

LLVM IR (-O2):
define zeroext i8 @getFirmwareVersion(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_word(i8 zeroext %0, i32 2)
ret i8 %2
}
void gtk_vseparator_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_vseparator_get_type() {
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, int);
char *strdup(char *);
char *int_to_string(int x) {
  char tmp_buf[33];
  int ret = -1;
  ret = snprintf(tmp_buf, 32, "%d", x);
  if (ret <= 0)
    return NULL;
  tmp_buf[32] = '\0';
  return strdup(tmp_buf);
}


x86 assembly (clang, -O0):
<int_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0xc(%rbp)
movl   $0xffffffff,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x20,%esi
lea    0xebb(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jg     1164 <int_to_string+0x44>
movq   $0x0,-0x8(%rbp)
jmp    1175 <int_to_string+0x55>
movb   $0x0,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_string>:
sub    $0x28,%rsp
mov    %edi,%ecx
lea    0xed3(%rip),%rdx
mov    %rsp,%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
test   %eax,%eax
jle    1150 <int_to_string+0x30>
movb   $0x0,0x20(%rsp)
mov    %rsp,%rdi
call   1040 <strdup@plt>
add    $0x28,%rsp
ret
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @int_to_string(i32 %0) {
%2 = alloca [33 x i8]
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = icmp slt i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 32
store i8 0, i8* %7
%8 = call i8* @strdup(i8* %3)
br label %9
9: ; preds = %1, %6
%10 = phi i8* [ %8, %6 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
char *strncpy(char *dst, const char *src, size_t n) {
  char *q = dst;
  const char *p = src;
  char ch;
  while (n--) {
    *q++ = ch = *p++;
    if (!ch)
      break;
  }
  return dst;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1172 <strncpy+0x72>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%cl
mov    %cl,-0x29(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
cmpb   $0x0,-0x29(%rbp)
jne    116d <strncpy+0x6d>
jmp    1172 <strncpy+0x72>
jmp    1120 <strncpy+0x20>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rcx,%rdx
je     1126 <strncpy+0x26>
movzbl (%rsi,%rcx,1),%edi
mov    %dil,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dil,%dil
jne    1110 <strncpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %13, %9 ]
%6 = phi i8* [ %1, %3 ], [ %11, %9 ]
%7 = phi i64 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = add i64 %7, -1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %6
%13 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %12, i8* %5
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %9, %4
ret i8* %0
}
int test_imm_D6uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xD6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D6uint64_lowword_mem>:
testb  $0xd6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D6uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 214
%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_D6uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 214
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handleSendRequest() { printf("Function unimplemented!\n"); }


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

x86 assembly (clang, -O2):
<handleSendRequest>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Function unimplemented!\0A\00"
define void @handleSendRequest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Function unimplemented!\00"
define void @handleSendRequest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool conflict(char c1, char c2) { return (c1 == 'W' || c1 != c2); }


x86 assembly (clang, -O0):
<conflict>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x57,%ecx
mov    %al,-0x3(%rbp)
je     1132 <conflict+0x32>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conflict>:
cmp    $0x57,%dil
sete   %al
cmp    %sil,%dil
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @conflict(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 87
%4 = icmp ne i8 %0, %1
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ nextPut(unsigned int, char);
void nextPutCRLF(unsigned int uartBase, char ch) {
  if (ch == '\n')
    nextPut(uartBase, '\r');
  nextPut(uartBase, ch);
}


x86 assembly (clang, -O0):
<nextPutCRLF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    113b <nextPutCRLF+0x2b>
mov    -0x4(%rbp),%edi
mov    $0xd,%esi
call   1030 <nextPut@plt>
mov    -0x4(%rbp),%edi
movsbl -0x5(%rbp),%esi
call   1030 <nextPut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextPutCRLF>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
cmp    $0xa,%bpl
jne    1129 <nextPutCRLF+0x19>
mov    %ebx,%edi
mov    $0xd,%esi
call   1030 <nextPut@plt>
movsbl %bpl,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <nextPut@plt>

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

LLVM IR (-O2):
define void @nextPutCRLF(i32 %0, i8 signext %1) {
%3 = icmp eq i8 %1, 10
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @nextPut(i32 %0, i8 signext 13)
br label %6
6: ; preds = %4, %2
%7 = tail call i32 @nextPut(i32 %0, i8 signext %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLushort;
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glPixelMapusv(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *);
void PixelMapusv(GLenum map, GLint mapsize, GLushort *values) {
  glPixelMapusv(map, mapsize, values);
}


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

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

LLVM IR (-O0):
define void @PixelMapusv(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 @glPixelMapusv(i32 %7, i32 %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @PixelMapusv(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @glPixelMapusv(i32 %0, i32 %1, i32* %2)
ret void
}
int offSet(long x) {
  int len = 1;
  int k = 1;
  while (x - 16 * k >= 0) {
    len++;
    k = k * 16;
  }
  return len;
}


x86 assembly (clang, -O0):
<offSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x4,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
cmp    $0x0,%rax
jl     1147 <offSet+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <offSet+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<offSet>:
mov    $0x1,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
shl    $0x4,%ecx
movslq %ecx,%rdx
add    $0x1,%eax
cmp    %rdi,%rdx
jle    1110 <offSet+0x10>
ret

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

LLVM IR (-O2):
define i32 @offSet(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = phi i32 [ 1, %1 ], [ %5, %2 ]
%5 = shl nsw i32 %4, 4
%6 = sext i32 %5 to i64
%7 = icmp sgt i64 %6, %0
%8 = add nuw nsw i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int sl_getwAt(int);
int sl_getdAt(int adr) {
  int c0, c1;
  c0 = sl_getwAt(adr);
  c1 = sl_getwAt(adr + 2);
  return c0 + (c1 << 16);
}


x86 assembly (clang, -O0):
<sl_getdAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sl_getwAt@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1030 <sl_getwAt@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl_getdAt>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <sl_getwAt@plt>
mov    %eax,%ebp
add    $0x2,%ebx
mov    %ebx,%edi
call   1030 <sl_getwAt@plt>
shl    $0x10,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sl_getdAt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @sl_getwAt(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 2
%9 = call i32 @sl_getwAt(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = shl i32 %11, 16
%13 = add nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @sl_getdAt(i32 %0) {
%2 = tail call i32 @sl_getwAt(i32 %0)
%3 = add nsw i32 %0, 2
%4 = tail call i32 @sl_getwAt(i32 %3)
%5 = shl i32 %4, 16
%6 = add nsw i32 %5, %2
ret i32 %6
}
int vergleiche(const void *i, const void *j) { return *(int *)i - *(int *)j; }


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

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

LLVM IR (-O0):
define i32 @vergleiche(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @vergleiche(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, struct zone *zone,
                                      int priority) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.mem_cgroup = type opaque
%struct.zone = type opaque
define i64 @mem_cgroup_calc_reclaim_inactive(%struct.mem_cgroup* %0, %struct.zone* %1, i32 %2) {
%4 = alloca %struct.mem_cgroup*
%5 = alloca %struct.zone*
%6 = alloca i32
store %struct.mem_cgroup* %0, %struct.mem_cgroup** %4
store %struct.zone* %1, %struct.zone** %5
store i32 %2, i32* %6
ret i64 0
}

LLVM IR (-O2):
%struct.mem_cgroup = type opaque
%struct.zone = type opaque
define i64 @mem_cgroup_calc_reclaim_inactive(%struct.mem_cgroup* nocapture readnone %0, %struct.zone* nocapture readnone %1, i32 %2) {
ret i64 0
}
unsigned char get_AT_response_data_length(unsigned int length) {
  return (unsigned char)length - 5;
}


x86 assembly (clang, -O0):
<get_AT_response_data_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
sub    $0x5,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_AT_response_data_length>:
lea    -0x5(%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i8 @get_AT_response_data_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = sub nsw i32 %5, 5
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @get_AT_response_data_length(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, -5
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int q1(char c) {
  if (c == 'a') {
    printf("*** state 1 ***\n");
    return 2;
  } else if (c == 'b') {
    return 3;
  }
}


x86 assembly (clang, -O0):
<q1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jne    1143 <q1+0x33>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1161 <q1+0x51>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    115c <q1+0x4c>
movl   $0x3,-0x4(%rbp)
jmp    1161 <q1+0x51>
jmp    1161 <q1+0x51>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1>:
mov    $0x3,%eax
cmp    $0x61,%dil
jne    1131 <q1+0x21>
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"*** state 1 ***\0A\00"
define i32 @q1(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 eq i32 %5, 97
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %2
br label %15
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 98
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 3, i32* %2
br label %15
14: ; preds = %9
br label %15
15: ; preds = %7, %13, %14
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@str = [16 x i8] c"*** state 1 ***\00"
define i32 @q1(i8 signext %0) {
%2 = icmp eq i8 %0, 97
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 2, %3 ], [ 3, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int fcntl(int fildes, int cmd, ...) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<fcntl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @fcntl(i32 %0, i32 %1, ...) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @fcntl(i32 %0, i32 %1, ...) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int GmfCloseMesh(int);
int gmfclosemeshf77_(int *idx) { return (GmfCloseMesh(*idx)); }


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

x86 assembly (clang, -O2):
<gmfclosemeshf77_>:
mov    (%rdi),%edi
jmp    1030 <GmfCloseMesh@plt>

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

LLVM IR (-O2):
define i32 @gmfclosemeshf77_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @GmfCloseMesh(i32 %2)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_Laurent_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(785, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_Laurent_start_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x311,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_Laurent_start_system_to_container>:
mov    $0x311,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_Laurent_start_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 785, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_Laurent_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 785, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int test_imm_84int64_lowword_mem(long long *val) {
  return ((*val) & (0x84 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_84int64_lowword_mem>:
testb  $0x84,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_84int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 132
%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_84int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 132
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int lpcli_main(int, char **);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(int argc, char **argv) {
  setlocale(LC_ALL, "");
  int ret = lpcli_main(argc, argv);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <lpcli_main@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1040 <setlocale@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <lpcli_main@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @LC_ALL
%8 = call i32 @setlocale(i32 %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @lpcli_main(i32 %9, i8** %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @lpcli_main(i32 %0, i8** %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tio_set_text_bold(void) { printf("\033[1m"); }


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

x86 assembly (clang, -O2):
<tio_set_text_bold>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[1m\00"
define void @tio_set_text_bold() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[1m\00"
define void @tio_set_text_bold() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcspn(char const *, char *);
const char *next_separator(const char *str) {
  return str + strcspn(str, " \t");
}


x86 assembly (clang, -O0):
<next_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcspn@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_separator>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcspn@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
define i8* @next_separator(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strcspn(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
ret i8* %7
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define i8* @next_separator(i8* %0) {
%2 = tail call i32 @strcspn(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
void f(void) {
  char buffer[16];
  gets(buffer);
}


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

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @f() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *do_nothing(void *null) {
  int i;
  i = 0;
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<do_nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @do_nothing(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = call i32 @pthread_exit(i32* null)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @do_nothing(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned long);
int /*<<< orphan*/ sleep(int);
void *main_thread(void *arg) {
  unsigned long i = 0;
  unsigned int thread_id;
  thread_id = *((unsigned int *)arg);
  while (1) {
    printf("%u %lu\n", thread_id, i);
    i++;
    sleep(1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<main_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    113d <main_thread+0x1d>

x86 assembly (clang, -O2):
<main_thread>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%ebp
xor    %ebx,%ebx
lea    0xed1(%rip),%r14
nop
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    $0x1,%rbx
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main_thread+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"%u %lu\0A\00"
define i8* @main_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 0, i64* %3
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %4
br label %8
8: ; preds = %1, %8
%9 = load i32, i32* %4
%10 = load i64, i64* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i64 %10)
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
%14 = call i32 @sleep(i32 1)
br label %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"%u %lu\0A\00"
define noalias i8* @main_thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ 0, %1 ], [ %7, %4 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3, i64 %5)
%7 = add i64 %5, 1
%8 = tail call i32 @sleep(i32 1)
br label %4
}
unsigned char printchar(unsigned char c) {
  if (c < ' ' || c > '~')
    return '.';
  return c;
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     1124 <printchar+0x24>
movzbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jle    112d <printchar+0x2d>
movb   $0x2e,-0x1(%rbp)
jmp    1133 <printchar+0x33>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
lea    -0x7f(%rdi),%eax
cmp    $0xa1,%al
mov    $0x2e,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @printchar(i8 zeroext %0) {
%2 = add i8 %0, -127
%3 = icmp ult i8 %2, -95
%4 = select i1 %3, i8 46, i8 %0
ret i8 %4
}
/* Variables and functions */
double exp2(double);
__attribute__((__weak__, __always___)) double softboundcets_exp2(double x) {
  return exp2(x);
}


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

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

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

LLVM IR (-O2):
define weak double @softboundcets_exp2(double %0) {
%2 = tail call double @exp2(double %0)
ret double %2
}
void ff_hevc_put_hevc_pel_pixels24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels24_10_sse4() {
ret void
}
void reset_viewer(int max_time) { int i = 0; }


x86 assembly (clang, -O0):
<reset_viewer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @reset_viewer(i32 %0) {
ret void
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createAddExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x0A, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createAddExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xa,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createAddExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 10, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createAddExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 10, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Variables and functions */
int /*<<< orphan*/ pixel_pack_portable_s16u8_y(short *, unsigned char *,
                                               unsigned int);
void llconv_grey_s16u8(short int *src, unsigned char *dst,
                       unsigned int nbpixels) {
  pixel_pack_portable_s16u8_y(src, dst, nbpixels);
}


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

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

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

LLVM IR (-O2):
define void @llconv_grey_s16u8(i16* %0, i8* %1, i32 %2) {
%4 = tail call i32 @pixel_pack_portable_s16u8_y(i16* %0, i8* %1, i32 %2)
ret void
}
imm0adrreg1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (22 <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0adrreg1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsd  0x21e888(%rax),%xmm0
movsd  0xed0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1146 <imm0adrreg1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <imm0adrreg1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0adrreg1>:
movsd  0x21e888(%rcx),%xmm0
xor    %eax,%eax
ucomisd 0xeee(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @imm0adrreg1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %13
%15 = getelementptr inbounds double, double* %14, i64 277777
%16 = load double, double* %15
%17 = fcmp ole double 2.200000e+01, %16
br i1 %17, label %18, label %19
18: ; preds = %6
store i32 1, i32* %7
br label %20
19: ; preds = %6
store i32 0, i32* %7
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @imm0adrreg1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture %5) {
%7 = getelementptr inbounds double, double* %5, i64 277777
%8 = load double, double* %7
%9 = fcmp oge double %8, 2.200000e+01
%10 = zext i1 %9 to i32
ret i32 %10
}
int over_thresh(unsigned long long used, unsigned long long hard, int thresh) {
  if (thresh && used >= hard * (thresh / 100.0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<over_thresh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1183 <over_thresh+0x83>
movq   -0x10(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm3
punpckldq %xmm3,%xmm0
movapd 0xeef(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x18(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
cvtsi2sdl -0x1c(%rbp),%xmm2
movsd  0xe9b(%rip),%xmm3
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1183 <over_thresh+0x83>
movl   $0x1,-0x4(%rbp)
jmp    118a <over_thresh+0x8a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<over_thresh>:
test   %edx,%edx
je     1164 <over_thresh+0x64>
movq   %rdi,%xmm0
movdqa 0xeef(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xef3(%rip),%xmm2
subpd  %xmm2,%xmm0
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
addsd  %xmm0,%xmm3
movq   %rsi,%xmm0
punpckldq %xmm1,%xmm0
subpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  0xecb(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    $0x1,%eax
ucomisd %xmm0,%xmm3
jae    1166 <over_thresh+0x66>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @over_thresh(i64 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load i64, i64* %5
%12 = uitofp i64 %11 to double
%13 = load i64, i64* %6
%14 = uitofp i64 %13 to double
%15 = load i32, i32* %7
%16 = sitofp i32 %15 to double
%17 = fdiv double %16, 1.000000e+02
%18 = fmul double %14, %17
%19 = fcmp oge double %12, %18
br i1 %19, label %20, label %21
20: ; preds = %10
store i32 1, i32* %4
br label %22
21: ; preds = %10, %3
store i32 0, i32* %4
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @over_thresh(i64 %0, i64 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = uitofp i64 %0 to double
%7 = uitofp i64 %1 to double
%8 = sitofp i32 %2 to double
%9 = fdiv double %8, 1.000000e+02
%10 = fmul double %9, %7
%11 = fcmp ugt double %10, %6
br i1 %11, label %12, label %13
12: ; preds = %5, %3
br label %13
13: ; preds = %5, %12
%14 = phi i32 [ 0, %12 ], [ 1, %5 ]
ret i32 %14
}
int calc(int n) {
  int a = n + 5;
  return a;
}


x86 assembly (clang, -O0):
<calc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc>:
lea    0x5(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @calc(i32 %0) {
%2 = add nsw i32 %0, 5
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
void testC(void) { lua_error("`testC' not active"); }


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

x86 assembly (clang, -O2):
<testC>:
lea    0xee9(%rip),%rdi
jmp    1030 <lua_error@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"`testC' not active\00"
define void @testC() {
%1 = call i32 @lua_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"`testC' not active\00"
define void @testC() {
%1 = tail call i32 @lua_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}