xunge/DecIR huggingface dataset:
void strcar(char s[], char t[]) {
  int i, j;
  i = j = 0;
  while (s[i] != '\0')
    i++;
  while ((s[i++] = t[j++]) != '\0')
    ;
}


x86 assembly (clang, -O0):
<strcar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113d <strcar+0x3d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <strcar+0x1a>
jmp    1142 <strcar+0x42>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %edx,%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     117d <strcar+0x7d>
jmp    1142 <strcar+0x42>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcar>:
mov    $0xffffffff,%eax
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcar+0x10>
mov    %eax,%eax
add    %rax,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1130 <strcar+0x30>
ret

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

LLVM IR (-O2):
define void @strcar(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %14, %11 ]
%13 = phi i64 [ %10, %9 ], [ %17, %11 ]
%14 = add nuw i64 %12, 1
%15 = getelementptr inbounds i8, i8* %1, i64 %12
%16 = load i8, i8* %15
%17 = add nuw i64 %13, 1
%18 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 %16, i8* %18
%19 = icmp eq i8 %16, 0
br i1 %19, label %20, label %11
20: ; preds = %11
ret void
}
unsigned int eruConfigureOGU2(unsigned int exocon) {
  (*((volatile unsigned int *const)(0x40010600 + 0x28))) = exocon;
  return 0;
}


x86 assembly (clang, -O0):
<eruConfigureOGU2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x40010628,%eax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eruConfigureOGU2>:
mov    %edi,0x40010628
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @eruConfigureOGU2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1073808936 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @eruConfigureOGU2(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1073808936 to i32*)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ kprint(char *);
void clear_command(char *arg) {
  clear_screen();
  kprint("Screen Cleared\n");
}


x86 assembly (clang, -O0):
<clear_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <clear_screen@plt>
lea    0xec6(%rip),%rdi
call   1030 <kprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_command>:
push   %rax
xor    %eax,%eax
call   1040 <clear_screen@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <kprint@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Screen Cleared\0A\00"
define void @clear_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @clear_screen()
%4 = call i32 @kprint(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Screen Cleared\0A\00"
define void @clear_command(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @clear_screen()
%3 = tail call i32 @kprint(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
void XBEE_UART_SaveConfig(void) {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @crit_exit() {
ret void
}
int main() {
  char input[30] = {"This is a test message.\n"};
  char output[30];
  int length = 25;
  asm volatile("cld\n\t"
               "rep movsb"
               :
               : "S"(input), "D"(output), "c"(length));
  printf("%s", output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x14(%rbp)
movl   $0x19,-0x54(%rbp)
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%ecx
cld
rep movsb %ds:(%rsi),%es:(%rdi)
lea    -0x50(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xef3(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
lea    0x20(%rsp),%rax
mov    %rax,%rdi
mov    $0x19,%ecx
cld
rep movsb %ds:(%rsi),%es:(%rdi)
lea    0xed9(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.input = [30 x i8] c"This is a test message.\0A\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca [30 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [30 x i8]* %2 to i8*
store i32 25, i32* %4
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %4
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.input = [30 x i8] c"This is a test message.\0A\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ convert_to_microseconds(struct timespec *);
int64_t get_timestamp_posix() {
  struct timespec tms;
  int retval;
  retval = clock_gettime(CLOCK_REALTIME, &tms);
  if (retval == 0) {
    return 0;
  }
  return convert_to_microseconds(&tms);
}


x86 assembly (clang, -O0):
<get_timestamp_posix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1153 <get_timestamp_posix+0x33>
movl   $0x0,-0x4(%rbp)
jmp    115f <get_timestamp_posix+0x3f>
lea    -0x8(%rbp),%rdi
call   1030 <convert_to_microseconds@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timestamp_posix>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <clock_gettime@plt>
test   %eax,%eax
je     1140 <get_timestamp_posix+0x20>
mov    %rsp,%rdi
call   1030 <convert_to_microseconds@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @get_timestamp_posix() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = alloca i32
%4 = load i32, i32* @CLOCK_REALTIME
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %1
br label %11
9: ; preds = %0
%10 = call i32 @convert_to_microseconds(%struct.timespec* %2)
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @get_timestamp_posix() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @convert_to_microseconds(%struct.timespec* %1)
br label %8
8: ; preds = %0, %6
%9 = phi i32 [ %7, %6 ], [ 0, %0 ]
ret i32 %9
}
unsigned long smGetVersion() { return 0x020001; }


x86 assembly (clang, -O0):
<smGetVersion>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20001,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @smGetVersion() {
ret i64 131073
}

LLVM IR (-O2):
define i64 @smGetVersion() {
ret i64 131073
}
void init_led(void) {
  (*(volatile unsigned int *)(0x7F008820)) &= ~0xFFFF;
  (*(volatile unsigned int *)(0x7F008820)) |= 0x1111;
  (*(volatile unsigned int *)(0x7F008828)) &= ~0xFF;
  (*(volatile unsigned int *)(0x7F008824)) |= 0xF;
  return;
}


x86 assembly (clang, -O0):
<init_led>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008820,%eax
mov    (%rax),%ecx
and    $0xffff0000,%ecx
mov    $0x7f008820,%eax
mov    %ecx,(%rax)
mov    $0x7f008820,%eax
mov    (%rax),%ecx
or     $0x1111,%ecx
mov    $0x7f008820,%eax
mov    %ecx,(%rax)
mov    $0x7f008828,%eax
mov    (%rax),%ecx
and    $0xffffff00,%ecx
mov    $0x7f008828,%eax
mov    %ecx,(%rax)
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0xf,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_led>:
andl   $0xffff0000,0x7f008820
orl    $0x1111,0x7f008820
andl   $0xffffff00,0x7f008828
orl    $0xf,0x7f008824
0f
ret

LLVM IR (-O0):
define void @init_led() {
%1 = load volatile i32, i32* inttoptr (i64 2130741280 to i32*)
%2 = and i32 %1, -65536
store volatile i32 %2, i32* inttoptr (i64 2130741280 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 2130741280 to i32*)
%4 = or i32 %3, 4369
store volatile i32 %4, i32* inttoptr (i64 2130741280 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 2130741288 to i32*)
%6 = and i32 %5, -256
store volatile i32 %6, i32* inttoptr (i64 2130741288 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%8 = or i32 %7, 15
store volatile i32 %8, i32* inttoptr (i64 2130741284 to i32*)
ret void
}

LLVM IR (-O2):
define void @init_led() {
%1 = load volatile i32, i32* inttoptr (i64 2130741280 to i32*)
%2 = and i32 %1, -65536
store volatile i32 %2, i32* inttoptr (i64 2130741280 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 2130741280 to i32*)
%4 = or i32 %3, 4369
store volatile i32 %4, i32* inttoptr (i64 2130741280 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 2130741288 to i32*)
%6 = and i32 %5, -256
store volatile i32 %6, i32* inttoptr (i64 2130741288 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%8 = or i32 %7, 15
store volatile i32 %8, i32* inttoptr (i64 2130741284 to i32*)
ret void
}
/* Variables and functions */
int logger_size_get(char *);
int logger_size_check(char *logfile, int len) {
  int file_size;
  file_size = logger_size_get(logfile);
  if (-1 == file_size)
    return 0;
  if (file_size + len < (1024 * 1024 / 2))
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<logger_size_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <logger_size_get@plt>
mov    %eax,-0x18(%rbp)
mov    $0xffffffff,%eax
cmp    -0x18(%rbp),%eax
jne    1145 <logger_size_check+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1169 <logger_size_check+0x59>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    $0x80000,%eax
jge    1162 <logger_size_check+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1169 <logger_size_check+0x59>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_size_check>:
push   %rbx
mov    %esi,%ebx
call   1030 <logger_size_get@plt>
cmp    $0xffffffff,%eax
setne  %cl
add    %eax,%ebx
cmp    $0x80000,%ebx
setge  %al
and    %cl,%al
movzbl %al,%eax
neg    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @logger_size_check(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = call i32 @logger_size_get(i8* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp eq i32 -1, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %19
12: ; preds = %2
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = add nsw i32 %13, %14
%16 = icmp slt i32 %15, 524288
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %3
br label %19
18: ; preds = %12
store i32 -1, i32* %3
br label %19
19: ; preds = %18, %17, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @logger_size_check(i8* %0, i32 %1) {
%3 = tail call i32 @logger_size_get(i8* %0)
%4 = icmp ne i32 %3, -1
%5 = add nsw i32 %3, %1
%6 = icmp sgt i32 %5, 524287
%7 = select i1 %4, i1 %6, i1 false
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ SHA256(unsigned char const *, size_t, unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
size_t strlen(char const *);
void shastr(const char *str, unsigned char *sha) {
  size_t l = strlen(str);
  unsigned char tmp[32];
  SHA256((const unsigned char *)str, l, tmp);
  memcpy(sha, tmp, 20);
}


x86 assembly (clang, -O0):
<shastr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <SHA256@plt>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x14,%edx
call   1050 <memcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shastr>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r15,%rdx
call   1030 <SHA256@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x14,%edx
call   1050 <memcpy@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @shastr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca [32 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %5
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%12 = call i32 @SHA256(i8* %9, i64 %10, i8* %11)
%13 = load i8*, i8** %4
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%15 = call i32 @memcpy(i8* %13, i8* %14, i32 20)
ret void
}

LLVM IR (-O2):
define void @shastr(i8* %0, i8* %1) {
%3 = alloca [32 x i8]
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = call i32 @SHA256(i8* %0, i64 %4, i8* %5)
%7 = call i32 @memcpy(i8* %1, i8* %5, i32 20)
ret void
}
void freecmd(char *args[20], int num_args) {
  for (int i = num_args; i < 20; i++)
    args[i] = '\0';
}


x86 assembly (clang, -O0):
<freecmd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    1139 <freecmd+0x39>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1111 <freecmd+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<freecmd>:
cmp    $0x13,%esi
jg     1137 <freecmd+0x27>
push   %rax
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
mov    $0x13,%eax
sub    %esi,%eax
lea    0x8(,%rax,8),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @freecmd(i8** nocapture writeonly %0, i32 %1) {
%3 = icmp slt i32 %1, 20
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = sext i32 %1 to i64
%6 = getelementptr i8*, i8** %0, i64 %5
%7 = bitcast i8** %6 to i8*
%8 = sub i32 19, %1
%9 = zext i32 %8 to i64
%10 = shl nuw nsw i64 %9, 3
%11 = add nuw nsw i64 %10, 8
br label %12
12: ; preds = %4, %2
ret void
}
void tx_do_tx_idle(struct lldp_port *lldp_port) {}


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

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

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

LLVM IR (-O2):
%struct.lldp_port = type opaque
define void @tx_do_tx_idle(%struct.lldp_port* nocapture %0) {
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ copy_string(char *, char *);
char *prepend_char(char a, char *s) {
  char *ret = calloc(4096, sizeof(char));
  ret[0] = a;
  copy_string((ret + 1), s);
  return ret;
}


x86 assembly (clang, -O0):
<prepend_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1000,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <copy_string@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepend_char>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x1000,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %bpl,(%rax)
lea    0x1(%rax),%rdi
mov    %r14,%rsi
call   1030 <copy_string@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @prepend_char(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = call i8* @calloc(i32 4096, i32 1)
store i8* %6, i8** %5
%7 = load i8, i8* %3
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8*, i8** %4
%13 = call i32 @copy_string(i8* %11, i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @prepend_char(i8 signext %0, i8* %1) {
%3 = tail call dereferenceable_or_null(4096) i8* @calloc(i32 4096, i32 1)
store i8 %0, i8* %3
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = tail call i32 @copy_string(i8* %4, i8* %1)
ret i8* %3
}
int f(int a, int b) { return (a *= a) > (b *= b) ? (a - b) : (b - a); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    %ecx,-0x8(%rbp)
cmp    %ecx,%eax
jle    1134 <f+0x34>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <f+0x3d>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
imul   %edi,%edi
imul   %esi,%esi
mov    %esi,%eax
sub    %edi,%eax
neg    %eax
sub    %edi,%esi
cmovae %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(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* %3
%7 = mul nsw i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, %8
store i32 %10, i32* %4
%11 = icmp sgt i32 %7, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
br label %20
16: ; preds = %2
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = sub nsw i32 %17, %18
br label %20
20: ; preds = %16, %12
%21 = phi i32 [ %15, %12 ], [ %19, %16 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = mul nsw i32 %1, %1
%5 = icmp ugt i32 %3, %4
%6 = sub nsw i32 %3, %4
%7 = sub nsw i32 %4, %3
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int fibo(int);
int main() {
  int x = 15;
  int result = fibo(x);
  if (result == 610) {
    __VERIFIER_error();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fibo@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x262,-0xc(%rbp)
jne    1155 <main+0x35>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
call   1040 <fibo@plt>
cmp    $0x262,%eax
jne    1139 <main+0x19>
xor    %eax,%eax
call   1030 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 15, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fibo(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 610
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @__VERIFIER_error()
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fibo(i32 15)
%2 = icmp eq i32 %1, 610
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
size_t ZBUFFv05_limitCopy(void *dst, size_t maxDstSize, const void *src,
                          size_t srcSize) {
  size_t length = ((maxDstSize) < (srcSize) ? (maxDstSize) : (srcSize));
  memcpy(dst, src, length);
  return length;
}


x86 assembly (clang, -O0):
<ZBUFFv05_limitCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1143 <ZBUFFv05_limitCopy+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    114b <ZBUFFv05_limitCopy+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZBUFFv05_limitCopy>:
push   %rbx
mov    %rcx,%rbx
cmp    %rcx,%rsi
cmovb  %rsi,%rbx
mov    %rdx,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ZBUFFv05_limitCopy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i64, i64* %6
%11 = load i64, i64* %8
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i64, i64* %6
br label %17
15: ; preds = %4
%16 = load i64, i64* %8
br label %17
17: ; preds = %15, %13
%18 = phi i64 [ %14, %13 ], [ %16, %15 ]
store i64 %18, i64* %9
%19 = load i8*, i8** %5
%20 = load i8*, i8** %7
%21 = load i64, i64* %9
%22 = call i32 @memcpy(i8* %19, i8* %20, i64 %21)
%23 = load i64, i64* %9
ret i64 %23
}

LLVM IR (-O2):
define i64 @ZBUFFv05_limitCopy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp ult i64 %1, %3
%6 = select i1 %5, i64 %1, i64 %3
%7 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %6)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned short);
__attribute__((no, noclone)) unsigned short f11(unsigned short x,
                                                unsigned short y) {
  unsigned short r = x - y;
  if (y < r)
    foo(r);
  return r;
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    114d <f11+0x3d>
movzwl -0x6(%rbp),%edi
call   1030 <foo@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f11>:
push   %rbx
mov    %edi,%ebx
sub    %esi,%ebx
cmp    %si,%bx
jbe    1122 <f11+0x12>
movzwl %bx,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @f11(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i16, i16* %5
%19 = call i32 @foo(i16 zeroext %18)
br label %20
20: ; preds = %17, %2
%21 = load i16, i16* %5
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @f11(i16 zeroext %0, i16 zeroext %1) {
%3 = sub i16 %0, %1
%4 = icmp ugt i16 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i16 zeroext %3)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ rul__msg_print(char *, char *);
void rul__completion(void (*address)(void)) {
  rul__msg_print("OBSOLFEAT W Obsolete feature %s",
                 "OPS_COMPLETION, replace with RETURN in ENTRY-BLOCK");
}


x86 assembly (clang, -O0):
<rul__completion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xef6(%rip),%rsi
call   1030 <rul__msg_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rul__completion>:
lea    0xee9(%rip),%rdi
lea    0xf02(%rip),%rsi
jmp    1030 <rul__msg_print@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"OBSOLFEAT W Obsolete feature %s\00"
@.str.1 = [51 x i8] c"OPS_COMPLETION, replace with RETURN in ENTRY-BLOCK\00"
define void @rul__completion(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = call i32 @rul__msg_print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"OBSOLFEAT W Obsolete feature %s\00"
@.str.1 = [51 x i8] c"OPS_COMPLETION, replace with RETURN in ENTRY-BLOCK\00"
define void @rul__completion(void ()* nocapture readnone %0) {
%2 = tail call i32 @rul__msg_print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct demod_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ selcall_init(struct demod_state *);
void eia_init(struct demod_state *s) { selcall_init(s); }


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

x86 assembly (clang, -O2):
<eia_init>:
jmp    1030 <selcall_init@plt>

LLVM IR (-O0):
%struct.demod_state = type { i32 }
define void @eia_init(%struct.demod_state* %0) {
%2 = alloca %struct.demod_state*
store %struct.demod_state* %0, %struct.demod_state** %2
%3 = load %struct.demod_state*, %struct.demod_state** %2
%4 = call i32 @selcall_init(%struct.demod_state* %3)
ret void
}

LLVM IR (-O2):
%struct.demod_state = type { i32 }
define void @eia_init(%struct.demod_state* %0) {
%2 = tail call i32 @selcall_init(%struct.demod_state* %0)
ret void
}
unsigned long TimerMatchGet(unsigned long ulBase, unsigned long ulTimer) {
  ;
  ;
  return ((ulTimer == 0x000000ff)
              ? (*((volatile unsigned long *)(ulBase + 0x00000030)))
              : (*((volatile unsigned long *)(ulBase + 0x00000034))));
}


x86 assembly (clang, -O0):
<TimerMatchGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xff,-0x10(%rbp)
jne    112b <TimerMatchGet+0x2b>
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <TimerMatchGet+0x37>
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerMatchGet>:
xor    %eax,%eax
cmp    $0xff,%rsi
setne  %al
mov    0x30(%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i64 @TimerMatchGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 255
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add i64 %8, 48
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
br label %17
12: ; preds = %2
%13 = load i64, i64* %3
%14 = add i64 %13, 52
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
br label %17
17: ; preds = %12, %7
%18 = phi i64 [ %11, %7 ], [ %16, %12 ]
ret i64 %18
}

LLVM IR (-O2):
define i64 @TimerMatchGet(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 255
%4 = select i1 %3, i64 48, i64 52
%5 = add i64 %4, %0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
unsigned char I_TBS2I_MCS(unsigned char I_TBS) {
  unsigned char I_MCS = -1;
  if (I_TBS <= 9)
    I_MCS = I_TBS;
  else if (I_TBS <= 15)
    I_MCS = I_TBS + 1;
  else if (I_TBS > 15 && I_TBS <= 26)
    I_MCS = I_TBS + 2;
  return I_MCS;
}


x86 assembly (clang, -O0):
<I_TBS2I_MCS>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0xff,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jg     1126 <I_TBS2I_MCS+0x26>
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
jmp    1170 <I_TBS2I_MCS+0x70>
movzbl -0x1(%rbp),%eax
cmp    $0xf,%eax
jg     1142 <I_TBS2I_MCS+0x42>
movzbl -0x1(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x2(%rbp)
jmp    116b <I_TBS2I_MCS+0x6b>
movzbl -0x1(%rbp),%eax
cmp    $0xf,%eax
jle    1166 <I_TBS2I_MCS+0x66>
movzbl -0x1(%rbp),%eax
cmp    $0x1a,%eax
jg     1166 <I_TBS2I_MCS+0x66>
movzbl -0x1(%rbp),%eax
add    $0x2,%eax
mov    %al,-0x2(%rbp)
jmp    116b <I_TBS2I_MCS+0x6b>
jmp    1170 <I_TBS2I_MCS+0x70>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I_TBS2I_MCS>:
mov    %edi,%eax
cmp    $0xa,%al
jb     111d <I_TBS2I_MCS+0x1d>
cmp    $0xf,%al
ja     110d <I_TBS2I_MCS+0xd>
add    $0x1,%al
ret
lea    0x2(%rax),%ecx
cmp    $0x1b,%al
movzbl %cl,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @I_TBS2I_MCS(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 -1, i8* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp sle i32 %5, 9
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8, i8* %2
store i8 %8, i8* %3
br label %33
9: ; preds = %1
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = icmp sle i32 %11, 15
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = add nsw i32 %15, 1
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
br label %32
18: ; preds = %9
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = icmp sgt i32 %20, 15
br i1 %21, label %22, label %31
22: ; preds = %18
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = icmp sle i32 %24, 26
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = load i8, i8* %2
%28 = zext i8 %27 to i32
%29 = add nsw i32 %28, 2
%30 = trunc i32 %29 to i8
store i8 %30, i8* %3
br label %31
31: ; preds = %26, %22, %18
br label %32
32: ; preds = %31, %13
br label %33
33: ; preds = %32, %7
%34 = load i8, i8* %3
ret i8 %34
}

LLVM IR (-O2):
define zeroext i8 @I_TBS2I_MCS(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp ult i8 %0, 16
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add nuw nsw i8 %0, 1
br label %11
7: ; preds = %3
%8 = icmp ult i8 %0, 27
%9 = add i8 %0, 2
%10 = select i1 %8, i8 %9, i8 -1
br label %11
11: ; preds = %7, %1, %5
%12 = phi i8 [ %6, %5 ], [ %0, %1 ], [ %10, %7 ]
ret i8 %12
}
int main() {
  int i, j;
  j = 10;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/, int);
int sqlite3_column_bytes(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sqlite3_column_text(int /*<<< orphan*/ *, int);
const char *beholddb_column_text(sqlite3_stmt *stmt, int column) {
  int textlen = sqlite3_column_bytes(stmt, column) + 1;
  char *text = malloc(textlen);
  memcpy(text, sqlite3_column_text(stmt, column), textlen);
  return text;
}


x86 assembly (clang, -O0):
<beholddb_column_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sqlite3_column_bytes@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <sqlite3_column_text@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beholddb_column_text>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1040 <sqlite3_column_bytes@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14d,%esi
call   1050 <sqlite3_column_text@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @beholddb_column_text(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @sqlite3_column_bytes(i32* %7, i32 %8)
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = call i32 @sqlite3_column_text(i32* %14, i32 %15)
%17 = load i32, i32* %5
%18 = call i32 @memcpy(i8* %13, i32 %16, i32 %17)
%19 = load i8*, i8** %6
ret i8* %19
}

LLVM IR (-O2):
define i8* @beholddb_column_text(i32* %0, i32 %1) {
%3 = tail call i32 @sqlite3_column_bytes(i32* %0, i32 %1)
%4 = add nsw i32 %3, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @sqlite3_column_text(i32* %0, i32 %1)
%7 = tail call i32 @memcpy(i8* %5, i32 %6, i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ remove_ending_whitespace(char **);
int /*<<< orphan*/ skip_whitespace_var(char **);
char *stripspaces(char *s) {
  char *ptr = s;
  skip_whitespace_var(&ptr);
  remove_ending_whitespace(&ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<stripspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <skip_whitespace_var@plt>
lea    -0x10(%rbp),%rdi
call   1030 <remove_ending_whitespace@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripspaces>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <skip_whitespace_var@plt>
mov    %rbx,%rdi
call   1030 <remove_ending_whitespace@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @stripspaces(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%4 = call i32 @skip_whitespace_var(i8** %2)
%5 = call i32 @remove_ending_whitespace(i8** %2)
%6 = load i8*, i8** %2
ret i8* %6
}
/* Variables and functions */
int quantity_tri(int);
int adjust_trigger_value(int times_per_unit, int cur_thr) {
  int result;
  int fix_times = quantity_tri(times_per_unit);
  int fix_result;
  fix_result = fix_times;
  result = cur_thr + (5000 - 1000) * fix_result;
  return result;
}


x86 assembly (clang, -O0):
<adjust_trigger_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <quantity_tri@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   $0xfa0,-0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_trigger_value>:
push   %rbx
mov    %esi,%ebx
call   1030 <quantity_tri@plt>
imul   $0xfa0,%eax,%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @adjust_trigger_value(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @quantity_tri(i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %7
%13 = mul nsw i32 4000, %12
%14 = add nsw i32 %11, %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @adjust_trigger_value(i32 %0, i32 %1) {
%3 = tail call i32 @quantity_tri(i32 %0)
%4 = mul nsw i32 %3, 4000
%5 = add nsw i32 %4, %1
ret i32 %5
}
int abs(int n) { return (n < 0 ? -n : n); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exception_env_pop();
int /*<<< orphan*/ exception_set(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void exception_cleanup(void) {
  exception_env_pop();
  exception_set(NULL, NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<exception_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <exception_env_pop@plt>
xor    %eax,%eax
mov    %eax,%r9d
xor    %ecx,%ecx
mov    %r9,%rdi
mov    %r9,%rsi
mov    %r9,%rdx
mov    %r9,%r8
call   1040 <exception_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exception_cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <exception_env_pop@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rax
jmp    1040 <exception_set@plt>

LLVM IR (-O0):
define void @exception_cleanup() {
%1 = call i32 (...) @exception_env_pop()
%2 = call i32 @exception_set(i32* null, i32* null, i32* null, i32 0, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @exception_cleanup() {
%1 = tail call i32 (...) @exception_env_pop()
%2 = tail call i32 @exception_set(i32* null, i32* null, i32* null, i32 0, i32* null, i32* null)
ret void
}
indirect(typeobj) char typeobj;
{
  if (typeobj == 1) {
    ol("movsbl (%eax),%eax");
  } else {
    ol("movl (%eax), %eax");
  }
}


x86 assembly (clang, -O0):
<indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x1,%eax
jne    113e <indirect+0x2e>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
jmp    114c <indirect+0x3c>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect>:
cmp    $0x1,%dil
lea    0xee5(%rip),%rax
lea    0xef1(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"movsbl (%eax),%eax\00"
@.str.1 = [18 x i8] c"movl (%eax), %eax\00"
define i32 @indirect(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [19 x i8] c"movsbl (%eax),%eax\00"
@.str.1 = [18 x i8] c"movl (%eax), %eax\00"
define i32 @indirect(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* %4)
ret i32 undef
}
int builtin_false(int argc, char *argv[]) { return 1; }


x86 assembly (clang, -O0):
<builtin_false>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @builtin_false(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
int GetSocketTypeOfService(const int fd __attribute__((__unused__))) {
  ;
  return (-1);
}


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

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

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

LLVM IR (-O2):
define i32 @GetSocketTypeOfService(i32 %0) {
ret i32 -1
}
void putACfirst(run, val) int run, val;
{
  if (run == 0 && (val == 1 || val == -1))
    putbits(2 | (val < 0), 2);
  else
    putAC(run, val, 0);
}


x86 assembly (clang, -O0):
<putACfirst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    116c <putACfirst+0x4c>
cmpl   $0x1,-0x8(%rbp)
je     114c <putACfirst+0x2c>
cmpl   $0xffffffff,-0x8(%rbp)
jne    116c <putACfirst+0x4c>
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
or     $0x2,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <putbits@plt>
jmp    117b <putACfirst+0x5b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <putAC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putACfirst>:
test   %edi,%edi
je     112d <putACfirst+0xd>
xor    %edx,%edx
xor    %eax,%eax
jmp    1040 <putAC@plt>
cmp    $0x1,%esi
je     1137 <putACfirst+0x17>
cmp    $0xffffffff,%esi
jne    1124 <putACfirst+0x4>
shr    $0x1f,%esi
or     $0x2,%esi
mov    %esi,%edi
mov    $0x2,%esi
xor    %eax,%eax
jmp    1030 <putbits@plt>

LLVM IR (-O0):
define void @putACfirst(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %19
13: ; preds = %10, %7
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 0
%16 = zext i1 %15 to i32
%17 = or i32 2, %16
%18 = call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 %17, i32 2)
br label %23
19: ; preds = %10, %2
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putAC to i32 (i32, i32, i32, ...)*)(i32 %20, i32 %21, i32 0)
br label %23
23: ; preds = %19, %13
ret void
}

LLVM IR (-O2):
define void @putACfirst(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2
switch i32 %1, label %9 [
i32 -1, label %5
i32 1, label %5
]
5: ; preds = %4, %4
%6 = lshr i32 %1, 31
%7 = or i32 %6, 2
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 %7, i32 2)
br label %11
9: ; preds = %4, %2
%10 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @putAC to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 0)
br label %11
11: ; preds = %9, %5
ret void
}