xunge/DecIR huggingface dataset:
int isVCHAR(char *request, int *cursor) {
  if ((request[(*cursor)] >= 0x21) && (request[(*cursor)] <= 0x7E)) {
    (*cursor)++;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isVCHAR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x21,%eax
jl     1153 <isVCHAR+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7e,%eax
jg     1153 <isVCHAR+0x53>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115a <isVCHAR+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isVCHAR>:
movslq (%rsi),%rcx
mov    (%rdi,%rcx,1),%dl
add    $0x81,%dl
xor    %eax,%eax
cmp    $0xa2,%dl
jb     111a <isVCHAR+0x1a>
add    $0x1,%ecx
mov    %ecx,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isVCHAR(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = add i8 %6, -127
%8 = icmp ult i8 %7, -94
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = add nsw i32 %3, 1
store i32 %10, i32* %1
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %12
}
int prefix_underscores_count(const char *str) {
  const char *tail = str;
  while (*tail != '_')
    tail++;
  return tail - str;
}


x86 assembly (clang, -O0):
<prefix_underscores_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     1131 <prefix_underscores_count+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <prefix_underscores_count+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_underscores_count>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x5f,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <prefix_underscores_count+0x10>
ret

LLVM IR (-O0):
define i32 @prefix_underscores_count(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 95
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @prefix_underscores_count(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 95
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
int f(int a) {
  auto int b = 0;
  static int c = 3;
  b = b + 1;
  c = c + 1;
  return (a + b + c);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    0x2f03(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2efa(%rip)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    0x2eee(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
add    %edi,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
@f.c = internal global i32 3
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* @f.c
%7 = add nsw i32 %6, 1
store i32 %7, i32* @f.c
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = load i32, i32* @f.c
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
@f.c = internal unnamed_addr global i32 3
define i32 @f(i32 %0) {
%2 = load i32, i32* @f.c
%3 = add nsw i32 %2, 1
store i32 %3, i32* @f.c
%4 = add nsw i32 %0, 1
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int _buffer_read_array(struct ac_buffer *, int /*<<< orphan*/ *, int *, int);
int buffer_read_int64_array(struct ac_buffer *buffer, int64_t *value,
                            int *size) {
  return _buffer_read_array(buffer, value, size, sizeof(int64_t));
}


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

x86 assembly (clang, -O2):
<buffer_read_int64_array>:
mov    $0x4,%ecx
jmp    1030 <_buffer_read_array@plt>

LLVM IR (-O0):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_int64_array(%struct.ac_buffer* %0, i32* %1, i32* %2) {
%4 = alloca %struct.ac_buffer*
%5 = alloca i32*
%6 = alloca i32*
store %struct.ac_buffer* %0, %struct.ac_buffer** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load %struct.ac_buffer*, %struct.ac_buffer** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @_buffer_read_array(%struct.ac_buffer* %7, i32* %8, i32* %9, i32 4)
ret i32 %10
}

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_int64_array(%struct.ac_buffer* %0, i32* %1, i32* %2) {
%4 = tail call i32 @_buffer_read_array(%struct.ac_buffer* %0, i32* %1, i32* %2, i32 4)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void subtractOvf(int x, int y) {
  int sum = x * x + y * y;
  int rem = (1u << 31) - sum;
  printf("subtract after overflow = %d (0x%x)\n", rem, rem);
}


x86 assembly (clang, -O0):
<subtractOvf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x80000000,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtractOvf>:
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
mov    $0x80000000,%edx
sub    %esi,%edx
lea    0xeda(%rip),%rdi
mov    %edx,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"subtract after overflow = %d (0x%x)\0A\00"
define void @subtractOvf(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = add nsw i32 %9, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = sub i32 -2147483648, %14
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = load i32, i32* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"subtract after overflow = %d (0x%x)\0A\00"
define void @subtractOvf(i32 %0, i32 %1) {
%3 = mul i32 %0, %0
%4 = mul i32 %1, %1
%5 = add i32 %4, %3
%6 = sub i32 -2147483648, %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %6)
ret void
}
/* Type definitions */
typedef unsigned int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t full_mod31_16(uint32_t a) {
  unsigned r = (a & 0x3ff) + (a >> 10);
  r = (r >> 5) + (r & 0x1f);
  r = (r >> 5) + (r & 0x1f);
  return r;
}


x86 assembly (clang, -O0):
<full_mod31_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
mov    -0x4(%rbp),%ecx
sar    $0xa,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x5,%eax
mov    -0x8(%rbp),%ecx
and    $0x1f,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x5,%eax
mov    -0x8(%rbp),%ecx
and    $0x1f,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_mod31_16>:
mov    %edi,%eax
and    $0x3ff,%eax
sar    $0xa,%edi
add    %edi,%eax
mov    %eax,%ecx
shr    $0x5,%ecx
and    $0x1f,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x5,%ecx
and    $0x1f,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @full_mod31_16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 1023
%6 = load i32, i32* %2
%7 = ashr i32 %6, 10
%8 = add nsw i32 %5, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = lshr i32 %9, 5
%11 = load i32, i32* %3
%12 = and i32 %11, 31
%13 = add i32 %10, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 5
%16 = load i32, i32* %3
%17 = and i32 %16, 31
%18 = add i32 %15, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @full_mod31_16(i32 %0) {
%2 = and i32 %0, 1023
%3 = ashr i32 %0, 10
%4 = add nsw i32 %2, %3
%5 = lshr i32 %4, 5
%6 = and i32 %4, 31
%7 = add nuw nsw i32 %5, %6
%8 = lshr i32 %7, 5
%9 = and i32 %7, 31
%10 = add nuw nsw i32 %8, %9
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
bool uDMAChannelIsEnabled(uint32_t ui32ChannelNum) {
  ASSERT((ui32ChannelNum & 0xffff) < 32);
  return (
      ((*((volatile uint32_t *)(0x400FF028))) & (1 << (ui32ChannelNum & 0x1f)))
          ? true
          : false);
}


x86 assembly (clang, -O0):
<uDMAChannelIsEnabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
cmp    $0x20,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x400ff028,%eax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelIsEnabled>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   $0xffe0,%ebx
sete   %dil
call   1030 <ASSERT@plt>
mov    0x400ff028,%eax
mov    %ebx,%ecx
shr    %cl,%eax
and    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @uDMAChannelIsEnabled(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = icmp slt i32 %4, 32
%6 = zext i1 %5 to i32
%7 = call i32 @ASSERT(i32 %6)
%8 = load volatile i32, i32* inttoptr (i64 1074786344 to i32*)
%9 = load i32, i32* %2
%10 = and i32 %9, 31
%11 = shl i32 1, %10
%12 = and i32 %8, %11
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @uDMAChannelIsEnabled(i32 %0) {
%2 = and i32 %0, 65504
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = load volatile i32, i32* inttoptr (i64 1074786344 to i32*)
%7 = and i32 %0, 31
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (!ptr) {
    fprintf(stderr, "realloc() failed.  Exit.\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117b <xrealloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"realloc() failed. Exit.\0A\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"realloc() failed. Exit.\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char *modifyNickMode(int, void *);
char *devoiceCmd(void *args) { return modifyNickMode(4, args); }


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

x86 assembly (clang, -O2):
<devoiceCmd>:
mov    %rdi,%rsi
mov    $0x4,%edi
jmp    1030 <modifyNickMode@plt>

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

LLVM IR (-O2):
define i8* @devoiceCmd(i8* %0) {
%2 = tail call i8* @modifyNickMode(i32 4, i8* %0)
ret i8* %2
}
struct __attribute__((packed)) name9 {
  volatile int (*name10)(const int (*name11)(int, int));
  int(name12);
}(name13)(name_a, name_b, name_c) struct bark {
  int (*name14)(struct { int name15, name16; } param);
} * name_a;
int name_b[10];
int(name_c) __attribute__((pure));
{ printf("Goodbye.\n"); }


x86 assembly (clang, -O0):
<name13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x30(%rbp),%edx
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bark = type { i32 (i64)* }
%struct.name9 = type <{ i32 (i32 (i32, i32)*)*, i32 }>
@.str = [10 x i8] c"Goodbye.\0A\00"
define { i32 (i32 (i32, i32)*)*, i32 } @name13(%struct.bark* %0, i32* %1, i32 %2) {
%4 = alloca %struct.name9
%5 = alloca %struct.bark*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca { i32 (i32 (i32, i32)*)*, i32 }
store %struct.bark* %0, %struct.bark** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = bitcast { i32 (i32 (i32, i32)*)*, i32 }* %8 to i8*
%11 = bitcast %struct.name9* %4 to i8*
%12 = load { i32 (i32 (i32, i32)*)*, i32 }, { i32 (i32 (i32, i32)*)*, i32 }* %8
ret { i32 (i32 (i32, i32)*)*, i32 } %12
}

LLVM IR (-O2):
%struct.bark = type { i32 (i64)* }
@str = [9 x i8] c"Goodbye.\00"
define { i32 (i32 (i32, i32)*)*, i32 } @name13(%struct.bark* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret { i32 (i32 (i32, i32)*)*, i32 } undef
}
const char *libbootimg_version_str(void) { return "0.2.2"; }


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

x86 assembly (clang, -O2):
<libbootimg_version_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0.2.2\00"
define i8* @libbootimg_version_str() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.2.2\00"
define i8* @libbootimg_version_str() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int atoi(char const *);
int /*<<< orphan*/ printf(char *, int);
void two(const char *grade) {
  if (atoi(grade) > 70)
    printf("%d passed!\n", atoi(grade));
  else
    printf("%d not passed!\n", atoi(grade));
}


x86 assembly (clang, -O0):
<two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
cmp    $0x46,%eax
jle    115a <two+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <two+0x51>
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two>:
push   %rax
call   1040 <atoi@plt>
cmp    $0x47,%eax
lea    0xed0(%rip),%rcx
lea    0xed5(%rip),%rdi
cmovge %rcx,%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d passed!\0A\00"
@.str.1 = [16 x i8] c"%d not passed!\0A\00"
define void @two(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = icmp sgt i32 %2, 70
%4 = select i1 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a1(int);
int main() {
  a1(9);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1030 <a1@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a1(i32 9)
ret i32 0
}
/* Variables and functions */
scalar_t__ num_users();
int cond_users() {
  if (num_users() > 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<cond_users>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <num_users@plt>
cmp    $0x0,%rax
jle    1135 <cond_users+0x25>
movl   $0x1,-0x4(%rbp)
jmp    113c <cond_users+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cond_users>:
push   %rax
xor    %eax,%eax
call   1030 <num_users@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cond_users() {
%1 = alloca i32
%2 = call i64 (...) @num_users()
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @cond_users() {
%1 = tail call i64 (...) @num_users()
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
__attribute__((visibility("default"))) long long echo_int64(long long arg,
                                                            ...) {
  return arg;
}


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

x86 assembly (clang, -O2):
<echo_int64>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @echo_int64(i64 %0, ...) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @echo_int64(i64 returned %0, ...) {
ret i64 %0
}
void pf_test(int i) { pf_test(++i); }


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

x86 assembly (clang, -O2):
<pf_test>:
jmp    1100 <pf_test>

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

LLVM IR (-O2):
define void @pf_test(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int compare_ints(const void *int1, const void *int2) {
  return *(int *)int1 - *(int *)int2;
}


x86 assembly (clang, -O0):
<compare_ints>:
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):
<compare_ints>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_ints(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 @compare_ints(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
}
/* Variables and functions */
int nrf_write_register(int, char, char *);
int nrf_set_rf_channel(int rfchannel, char *retstatus) {
  rfchannel &= 0x7F;
  return nrf_write_register(0x05, (char)rfchannel, retstatus);
}


x86 assembly (clang, -O0):
<nrf_set_rf_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rdx
mov    $0x5,%edi
movsbl %al,%esi
call   1030 <nrf_write_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_set_rf_channel>:
mov    %rsi,%rdx
mov    %edi,%esi
and    $0x7f,%esi
mov    $0x5,%edi
jmp    1030 <nrf_write_register@plt>

LLVM IR (-O0):
define i32 @nrf_set_rf_channel(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 = and i32 %5, 127
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = call i32 @nrf_write_register(i32 5, i8 signext %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @nrf_set_rf_channel(i32 %0, i8* %1) {
%3 = trunc i32 %0 to i8
%4 = and i8 %3, 127
%5 = tail call i32 @nrf_write_register(i32 5, i8 signext %4, i8* %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HwTauLinkHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void HwTauLinkRequestUpdate() { UAVObjRequestUpdate(HwTauLinkHandle()); }


x86 assembly (clang, -O0):
<HwTauLinkRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HwTauLinkHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @HwTauLinkRequestUpdate() {
%1 = call i32 (...) @HwTauLinkHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwTauLinkRequestUpdate() {
%1 = tail call i32 (...) @HwTauLinkHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
size_t bc_strv_length(char **strv) {
  if (strv == NULL)
    return 0;
  size_t i;
  for (i = 0; strv[i] != NULL; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<bc_strv_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <bc_strv_length+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1159 <bc_strv_length+0x59>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1151 <bc_strv_length+0x51>
jmp    1140 <bc_strv_length+0x40>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <bc_strv_length+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bc_strv_length>:
test   %rdi,%rdi
je     1120 <bc_strv_length+0x20>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <bc_strv_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @bc_strv_length(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %4, %3 ]
ret i64 %10
}
void ECDSA_sign_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @ECDSA_sign_setup() {
ret void
}
sfunc12(int a, int b) { return a * b + 2; }


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

x86 assembly (clang, -O2):
<sfunc12>:
imul   %esi,%edi
lea    0x2(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sfunc12(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 = mul nsw i32 %5, %6
%8 = add nsw i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @sfunc12(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_resolve_new(void **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_resolve_new>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_resolve_new>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_resolve_new(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_resolve_new(i8** nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
void av_audio_fifo_peek() {}


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

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

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

LLVM IR (-O2):
define void @av_audio_fifo_peek() {
ret void
}
/* Type definitions */
typedef scalar_t__ ulong;
typedef scalar_t__ uint;

/* Variables and functions */
int neq(ulong x, ulong y) { return (uint)x != (uint)y; }


x86 assembly (clang, -O0):
<neq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neq>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @neq(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @neq(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int EINVAL;
int tzdev_migration_request(unsigned long arg) {
  (void)arg;
  return -EINVAL;
}


x86 assembly (clang, -O0):
<tzdev_migration_request>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tzdev_migration_request>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @tzdev_migration_request(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @tzdev_migration_request(i64 %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int EOF;
int getch();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c;
  while ((c = getch()) != EOF) {
    printf("c = %c\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     115c <main+0x3c>
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getch@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [8 x i8] c"c = %c\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getch()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @getch()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
int test_imm_D2int8_reg(signed char val) {
  return ((val) & (-0xD2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D2int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -210
%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_D2int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -210
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ scanf(char *, int *);
void promptValue(const char *prompt, int *value) {
  printf("%s:\n", prompt);
  scanf("%d", value);
}


x86 assembly (clang, -O0):
<promptValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<promptValue>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @promptValue(i8* %0, i32* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void enc_fputc(int ch, int *col, FILE *fOut) {
  fputc(ch, fOut);
  if (76 <= ++*col) {
    fputs("\r\n", fOut);
    *col = 0;
  }
}


x86 assembly (clang, -O0):
<enc_fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <fputc@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    $0x4c,%eax
cmp    %ecx,%eax
jg     1171 <enc_fputc+0x51>
mov    -0x18(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enc_fputc>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdx,%rsi
call   1030 <fputc@plt>
mov    (%rbx),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rbx)
cmp    $0x4b,%eax
jl     115d <enc_fputc+0x3d>
lea    0xebb(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
movl   $0x0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @enc_fputc(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** %6
%9 = call i32 @fputc(i32 %7, i32* %8)
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = icmp sle i32 76, %12
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = load i32*, i32** %6
%16 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = load i32*, i32** %5
store i32 0, i32* %17
br label %18
18: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @enc_fputc(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = tail call i32 @fputc(i32 %0, i32* %2)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = icmp sgt i32 %5, 74
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %2)
store i32 0, i32* %1
br label %10
10: ; preds = %8, %3
ret void
}
int sum2(int i1, int i2) { return i1 + i2; }


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

x86 assembly (clang, -O2):
<sum2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @sum2(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @sum2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void aquire_bus(void) {}


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

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

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

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

/* Variables and functions */
long _get_ncpus_sys_devices(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
long get_ncpus_sys_devices(const char *path) {
  FILE *online_cpus_fp = fopen(path, "r");
  if (online_cpus_fp == NULL) {
    return -1;
  }
  long ncpus = _get_ncpus_sys_devices(online_cpus_fp);
  fclose(online_cpus_fp);
  return ncpus;
}


x86 assembly (clang, -O0):
<get_ncpus_sys_devices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <get_ncpus_sys_devices+0x38>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1186 <get_ncpus_sys_devices+0x56>
mov    -0x18(%rbp),%rdi
call   1030 <_get_ncpus_sys_devices@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ncpus_sys_devices>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1160 <get_ncpus_sys_devices+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <_get_ncpus_sys_devices@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rax
jmp    1167 <get_ncpus_sys_devices+0x37>
mov    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i64 @get_ncpus_sys_devices(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @_get_ncpus_sys_devices(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i64 [ %5, %4 ], [ -1, %1 ]
ret i64 %8
}
/* Variables and functions */
int f(int *);
g(int *p) { return f(p); }


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

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

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

LLVM IR (-O2):
define i32 @g(i32* %0) {
%2 = tail call i32 @f(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int randChar(char *);
int randInt(int);
int N() {
  printf("%c", randChar("0123456789"));
  if (randInt(10) < 8)
    N();
}


x86 assembly (clang, -O0):
<N>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1050 <randChar@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1060 <randInt@plt>
cmp    $0x8,%eax
jge    117a <N+0x3a>
call   1030 <N@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<N>:
push   %r14
push   %rbx
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <randChar@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <randInt@plt>
cmp    $0x7,%eax
jg     1191 <N+0x61>
lea    0xe9f(%rip),%r14
lea    0xe95(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <randChar@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <randInt@plt>
cmp    $0x8,%eax
jl     1170 <N+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [11 x i8] c"0123456789\00"
define i32 @N() {
%1 = tail call i32 @randChar(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @randInt(i32 10)
%4 = icmp slt i32 %3, 8
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = tail call i32 @randChar(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @randInt(i32 10)
%9 = icmp slt i32 %8, 8
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 undef
}
/* Variables and functions */
int foo(int, int, int);
int bar(int x, int y, int z) { return foo(x * x, y * y, z * z); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
imul   -0xc(%rbp),%edx
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
imul   %edi,%edi
imul   %esi,%esi
imul   %edx,%edx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @bar(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* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
%16 = call i32 @foo(i32 %9, i32 %12, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, %0
%5 = mul nsw i32 %1, %1
%6 = mul nsw i32 %2, %2
%7 = tail call i32 @foo(i32 %4, i32 %5, i32 %6)
ret i32 %7
}