xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Application for reading log messages and performing specified "
         "actions for found patterns\n");
  printf("Configuration is stored in /etc/confgi/logtrigger\n");
  printf("Usage: logtrigger <params>\n");
  printf(" -D <level>\tspecify loglevel\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
call   1030 <printf@plt>
lea    0xf4a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [90 x i8] c"Application for reading log messages and performing specified actions for found patterns\0A\00"
@.str.1 = [51 x i8] c"Configuration is stored in /etc/confgi/logtrigger\0A\00"
@.str.2 = [28 x i8] c"Usage: logtrigger <params>\0A\00"
@.str.3 = [30 x i8] c" -D <level>\09specify loglevel\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [89 x i8] c"Application for reading log messages and performing specified actions for found patterns\00"
@str.4 = [50 x i8] c"Configuration is stored in /etc/confgi/logtrigger\00"
@str.5 = [27 x i8] c"Usage: logtrigger <params>\00"
@str.6 = [29 x i8] c" -D <level>\09specify loglevel\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f2();
char *malloc(int);
void f1(void) {
  char *p = malloc(1024);
  f2();
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f2@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1024)
store i8* %2, i8** %1
%3 = call i32 (...) @f2()
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call i32 (...) @f2()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int readLong(int /*<<< orphan*/ *, char, int /*<<< orphan*/ *);
int readArgc(FILE *fp, ssize_t *target) { return readLong(fp, '*', target); }


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

x86 assembly (clang, -O2):
<readArgc>:
mov    %rsi,%rdx
mov    $0x2a,%esi
jmp    1030 <readLong@plt>

LLVM IR (-O0):
define i32 @readArgc(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 = call i32 @readLong(i32* %5, i8 signext 42, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @readArgc(i32* %0, i32* %1) {
%3 = tail call i32 @readLong(i32* %0, i8 signext 42, i32* %1)
ret i32 %3
}
int isalpha(int c) {
  return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') || c <= 'Z');
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
mov    $0x1,%al
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jge    1139 <isalpha+0x39>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ true, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led2Off();
void TestAppP__Leds__led2Off(void) { LedsP__Leds__led2Off(); }


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

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

LLVM IR (-O0):
define void @TestAppP__Leds__led2Off() {
%1 = call i32 (...) @LedsP__Leds__led2Off()
ret void
}

LLVM IR (-O2):
define void @TestAppP__Leds__led2Off() {
%1 = tail call i32 (...) @LedsP__Leds__led2Off()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_print_top(int x) {
  ft_putchar('/');
  while (x > 2) {
    ft_putchar('*');
    x--;
  }
  if (x > 1) {
    ft_putchar('\\');
  }
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_print_top>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2f,%edi
call   1030 <ft_putchar@plt>
cmpl   $0x2,-0x4(%rbp)
jle    1147 <ft_print_top+0x37>
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <ft_print_top+0x15>
cmpl   $0x1,-0x4(%rbp)
jle    115b <ft_print_top+0x4b>
mov    $0x5c,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_top>:
push   %rbx
mov    %edi,%ebx
mov    $0x2f,%edi
call   1030 <ft_putchar@plt>
cmp    $0x3,%ebx
jl     1144 <ft_print_top+0x34>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     1130 <ft_print_top+0x20>
jmp    1149 <ft_print_top+0x39>
cmp    $0x2,%ebx
jne    1153 <ft_print_top+0x43>
mov    $0x5c,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print_top(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ft_putchar(i8 signext 47)
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 2
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 @ft_putchar(i8 signext 42)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @ft_putchar(i8 signext 92)
br label %16
16: ; preds = %14, %11
%17 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_print_top(i32 %0) {
%2 = tail call i32 @ft_putchar(i8 signext 47)
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @ft_putchar(i8 signext 42)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %4, label %11
9: ; preds = %1
%10 = icmp eq i32 %0, 2
br i1 %10, label %11, label %13
11: ; preds = %4, %9
%12 = tail call i32 @ft_putchar(i8 signext 92)
br label %13
13: ; preds = %11, %9
%14 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ oled_write_byte(int);
void oled_set_column_address(unsigned char column) {
  oled_write_byte(0x10 | (column >> 4));
  oled_write_byte(0x0f & column);
}


x86 assembly (clang, -O0):
<oled_set_column_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
sar    $0x4,%edi
or     $0x10,%edi
call   1030 <oled_write_byte@plt>
movzbl -0x1(%rbp),%edi
and    $0xf,%edi
call   1030 <oled_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_set_column_address>:
push   %rbx
mov    %edi,%ebx
shr    $0x4,%edi
or     $0x10,%edi
call   1030 <oled_write_byte@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <oled_write_byte@plt>

LLVM IR (-O0):
define void @oled_set_column_address(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = or i32 16, %5
%7 = call i32 @oled_write_byte(i32 %6)
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 15, %9
%11 = call i32 @oled_write_byte(i32 %10)
ret void
}

LLVM IR (-O2):
define void @oled_set_column_address(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 4
%4 = or i32 %3, 16
%5 = tail call i32 @oled_write_byte(i32 %4)
%6 = and i32 %2, 15
%7 = tail call i32 @oled_write_byte(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_adcimm(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_lsls_imm(int, int, int);
void emit_shlsr(int t, int sr) {
  emit_andimm(sr, ~1, sr);
  emit_lsls_imm(t, 1, t);
  emit_adcimm(sr, 0, sr);
}


x86 assembly (clang, -O0):
<emit_shlsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    $0x1,%esi
call   1040 <emit_lsls_imm@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1030 <emit_adcimm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_shlsr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0xfffffffe,%esi
mov    %ebx,%edx
call   1050 <emit_andimm@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1040 <emit_lsls_imm@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <emit_adcimm@plt>

LLVM IR (-O0):
define void @emit_shlsr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @emit_andimm(i32 %5, i32 -2, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @emit_lsls_imm(i32 %8, i32 1, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @emit_adcimm(i32 %11, i32 0, i32 %12)
ret void
}

LLVM IR (-O2):
define void @emit_shlsr(i32 %0, i32 %1) {
%3 = tail call i32 @emit_andimm(i32 %1, i32 -2, i32 %1)
%4 = tail call i32 @emit_lsls_imm(i32 %0, i32 1, i32 %0)
%5 = tail call i32 @emit_adcimm(i32 %1, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a450();
int /*<<< orphan*/ a7550();
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ my_malloc1(int);
int /*<<< orphan*/ my_malloc3(int);
int main(void) {
  a7550();
  a450();
  my_malloc1(2000);
  malloc(8000);
  my_malloc3(200);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <a7550@plt>
mov    $0x0,%al
call   1070 <a450@plt>
mov    $0x7d0,%edi
call   1040 <my_malloc1@plt>
mov    $0x1f40,%edi
call   1060 <malloc@plt>
mov    $0xc8,%edi
call   1050 <my_malloc3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <a7550@plt>
xor    %eax,%eax
call   1070 <a450@plt>
mov    $0x7d0,%edi
call   1040 <my_malloc1@plt>
mov    $0x1f40,%edi
call   1060 <malloc@plt>
mov    $0xc8,%edi
call   1050 <my_malloc3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @a7550()
%3 = call i32 (...) @a450()
%4 = call i32 @my_malloc1(i32 2000)
%5 = call i32 @malloc(i32 8000)
%6 = call i32 @my_malloc3(i32 200)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a7550()
%2 = tail call i32 (...) @a450()
%3 = tail call i32 @my_malloc1(i32 2000)
%4 = tail call i32 @malloc(i32 8000)
%5 = tail call i32 @my_malloc3(i32 200)
ret i32 0
}
/* Variables and functions */
double floor(double);
int /*<<< orphan*/ isfinite(double);
double trunc(double x) {
  if (!isfinite(x))
    return x;
  if (x < 0.0)
    return -floor(-x);
  else
    return floor(x);
}


x86 assembly (clang, -O0):
<trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <isfinite@plt>
cmp    $0x0,%eax
jne    114f <trunc+0x2f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ae <trunc+0x8e>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    119f <trunc+0x7f>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ae <trunc+0x8e>
movsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunc>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
call   1030 <isfinite@plt>
test   %eax,%eax
je     115f <trunc+0x3f>
xorpd  %xmm0,%xmm0
movapd (%rsp),%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm1,%xmm0
jbe    1168 <trunc+0x48>
xorpd  0xeb3(%rip),%xmm0
call   1040 <floor@plt>
xorpd  0xea6(%rip),%xmm0
add    $0x18,%rsp
ret
movaps (%rsp),%xmm0
add    $0x18,%rsp
ret
add    $0x18,%rsp
jmp    1040 <floor@plt>

LLVM IR (-O0):
define double @trunc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @isfinite(double %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load double, double* %3
store double %8, double* %2
br label %20
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load double, double* %3
%14 = fneg double %13
%15 = call double @llvm.floor.f64(double %14)
%16 = fneg double %15
store double %16, double* %2
br label %20
17: ; preds = %9
%18 = load double, double* %3
%19 = call double @llvm.floor.f64(double %18)
store double %19, double* %2
br label %20
20: ; preds = %17, %12, %7
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @trunc(double %0) {
%2 = tail call i32 @isfinite(double %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = fcmp olt double %0, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = fneg double %0
%8 = tail call double @llvm.floor.f64(double %7)
%9 = fneg double %8
br label %12
10: ; preds = %4
%11 = tail call double @llvm.floor.f64(double %0)
br label %12
12: ; preds = %1, %10, %6
%13 = phi double [ %9, %6 ], [ %11, %10 ], [ %0, %1 ]
ret double %13
}
int test_imm_4Duint16_mem(unsigned short *val) {
  return ((*val) & (-0x4D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Duint16_mem>:
movzwl (%rdi),%eax
test   $0xffb3,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -77
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int mvm_release_irq(unsigned int);
int xnarch_release_irq(unsigned irq) { return mvm_release_irq(irq); }


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

x86 assembly (clang, -O2):
<xnarch_release_irq>:
jmp    1030 <mvm_release_irq@plt>

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

LLVM IR (-O2):
define i32 @xnarch_release_irq(i32 %0) {
%2 = tail call i32 @mvm_release_irq(i32 %0)
ret i32 %2
}
int clamp_int(int *val, int min, int max) {
  if (*val < min) {
    *val = min;
    return 1;
  }
  if (*val > max) {
    *val = max;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<clamp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jge    1132 <clamp_int+0x32>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115d <clamp_int+0x5d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x18(%rbp),%eax
jle    1156 <clamp_int+0x56>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115d <clamp_int+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_int>:
mov    (%rdi),%ecx
cmp    %esi,%ecx
jl     110e <clamp_int+0xe>
xor    %eax,%eax
mov    %edx,%esi
cmp    %edx,%ecx
jle    1115 <clamp_int+0x15>
mov    %esi,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp_int(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = icmp slt i32 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = icmp sgt i32 %4, %2
br i1 %7, label %8, label %10
8: ; preds = %6, %3
%9 = phi i32 [ %1, %3 ], [ %2, %6 ]
store i32 %9, i32* %0
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ 0, %6 ], [ 1, %8 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ dFunDD(double, double);
int iFunII(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c = 0;
  c = iFunII(5, 4);
  printf("%d\n", c);
  c = (int)dFunDD(5.1, 4.2);
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x4,%esi
call   1050 <iFunII@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe91(%rip),%xmm0
movsd  0xe91(%rip),%xmm1
call   1030 <dFunDD@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
mov    $0x4,%esi
call   1050 <iFunII@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movsd  0xea7(%rip),%xmm0
movsd  0xea7(%rip),%xmm1
call   1030 <dFunDD@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @iFunII(i32 5, i32 4)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i64 @dFunDD(double 5.100000e+00, double 4.200000e+00)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @iFunII(i32 5, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i64 @dFunDD(double 5.100000e+00, double 4.200000e+00)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ delay_10us(scalar_t__);
void delay_ms(uint8_t delay) {
  uint8_t i;
  for (i = delay; i > 0; i--)
    delay_10us(((uint8_t)104));
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    114a <delay_ms+0x3a>
mov    $0x68,%edi
call   1030 <delay_10us@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <delay_ms+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
push   %rbx
test   %rdi,%rdi
jle    1134 <delay_ms+0x24>
mov    %rdi,%rbx
add    $0x1,%rbx
nopl   (%rax)
mov    $0x68,%edi
call   1030 <delay_10us@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1120 <delay_ms+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay_ms(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
br label %5
5: ; preds = %10, %1
%6 = load i64, i64* %3
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 @delay_10us(i64 104)
br label %10
10: ; preds = %8
%11 = load i64, i64* %3
%12 = add nsw i64 %11, -1
store i64 %12, i64* %3
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @delay_ms(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @delay_10us(i64 104)
%6 = add nsw i64 %4, -1
%7 = icmp ugt i64 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
unsigned char *tiger2_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_tiger2(unsigned char *out, const unsigned char *in,
                                  size_t in_len) {
  return tiger2_buffer(out, in, in_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_tiger2>:
jmp    1030 <tiger2_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_tiger2(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @tiger2_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
void glutTabletMotionFunc(void (*func)(int x, int y)) {}


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

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

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

LLVM IR (-O2):
define void @glutTabletMotionFunc(void (i32, i32)* nocapture %0) {
ret void
}
const char *get_psy_version(void) {
  static const char *const str = "0"
                                 "."
                                 "93";
  return str;
}


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

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

LLVM IR (-O0):
@get_psy_version.str = internal constant i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
@.str = [5 x i8] c"0.93\00"
define i8* @get_psy_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"0.93\00"
define i8* @get_psy_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
int test_imm_89int64_lowword_reg(long long val) {
  return ((val) & (0x89 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_89int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 137
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fnLinSearch(int A[], int k, int iN) {
  if (iN == 0)
    return -1;
  else if (k == A[iN - 1])
    return iN;
  else
    return fnLinSearch(A, k, iN - 1);
}


x86 assembly (clang, -O0):
<fnLinSearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1138 <fnLinSearch+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <fnLinSearch+0x61>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jne    115c <fnLinSearch+0x4c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <fnLinSearch+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
call   1030 <fnLinSearch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnLinSearch>:
movslq %edx,%rcx
lea    0x1(%rcx),%eax
cs nopw 0x0(%rax,%rax,1)
sub    $0x1,%rcx
jb     111f <fnLinSearch+0x1f>
add    $0xffffffff,%eax
cmp    %esi,(%rdi,%rcx,4)
jne    1110 <fnLinSearch+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @fnLinSearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
br label %5
5: ; preds = %8, %3
%6 = phi i64 [ %9, %8 ], [ %4, %3 ]
%7 = icmp eq i64 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = add nsw i64 %6, -1
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %8
%14 = trunc i64 %6 to i32
br label %15
15: ; preds = %5, %13
%16 = phi i32 [ %14, %13 ], [ -1, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int usage(void) {
  fprintf(stdout, "punch_hole <-f path> <-s start> <-l length>\n");
  fprintf(stdout, "Example:\n"
                  "       punch_hole -f /storage/testifle "
                  "-s 0 -l 1073741824\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeee(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [45 x i8] c"punch_hole <-f path> <-s start> <-l length>\0A\00"
@.str.1 = [68 x i8] c"Example:\0A punch_hole -f /storage/testifle -s 0 -l 1073741824\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [45 x i8] c"punch_hole <-f path> <-s start> <-l length>\0A\00"
@.str.1 = [68 x i8] c"Example:\0A punch_hole -f /storage/testifle -s 0 -l 1073741824\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ variate(int /*<<< orphan*/);
int main(void) {
  variate(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @variate(i32 0)
ret i32 0
}
/* Variables and functions */
int hal_gpio_init();
int hal_init() { return hal_gpio_init(); }


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

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

LLVM IR (-O0):
define i32 @hal_init() {
%1 = call i32 (...) @hal_gpio_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @hal_init() {
%1 = tail call i32 (...) @hal_gpio_init()
ret i32 %1
}
int calc_length(long n) {
  int len = 1;
  for (; n != 1; len++) {
    if (n % 2 == 0) {
      n /= 2;
    } else {
      n = 3 * n + 1;
    }
  }
  return len;
}


x86 assembly (clang, -O0):
<calc_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x1,-0x8(%rbp)
je     1169 <calc_length+0x69>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1149 <calc_length+0x49>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1156 <calc_length+0x56>
imul   $0x3,-0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    115b <calc_length+0x5b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <calc_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_length>:
mov    $0x1,%eax
cmp    $0x1,%rdi
jne    110c <calc_length+0xc>
ret
mov    $0x1,%eax
jmp    1131 <calc_length+0x31>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rdi,%rdi,2),%rdi
add    $0x1,%rdi
add    $0x1,%eax
cmp    $0x1,%rdi
je     110b <calc_length+0xb>
test   $0x1,%dil
jne    1120 <calc_length+0x20>
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
sar    %rcx
mov    %rcx,%rdi
jmp    1128 <calc_length+0x28>

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

LLVM IR (-O2):
define i32 @calc_length(i64 %0) {
%2 = icmp eq i64 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i32 [ %15, %13 ], [ 1, %1 ]
%5 = phi i64 [ %14, %13 ], [ %0, %1 ]
%6 = and i64 %5, 1
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sdiv i64 %5, 2
br label %13
10: ; preds = %3
%11 = mul nsw i64 %5, 3
%12 = add nsw i64 %11, 1
br label %13
13: ; preds = %8, %10
%14 = phi i64 [ %9, %8 ], [ %12, %10 ]
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i64 %14, 1
br i1 %16, label %17, label %3
17: ; preds = %13, %1
%18 = phi i32 [ 1, %1 ], [ %15, %13 ]
ret i32 %18
}
/* Type definitions */
struct option_a {
  int dummy;
};
struct _getopt_data_a {
  int dummy;
};

/* Variables and functions */
int _getopt_internal_r_a(int, char *const *, char const *,
                         struct option_a const *, int *, int,
                         struct _getopt_data_a *, int /*<<< orphan*/);
int _getopt_long_only_r_a(int argc, char *const *argv, const char *options,
                          const struct option_a *long_options, int *opt_index,
                          struct _getopt_data_a *d) {
  return _getopt_internal_r_a(argc, argv, options, long_options, opt_index, 1,
                              d, 0);
}


x86 assembly (clang, -O0):
<_getopt_long_only_r_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%rax
mov    $0x1,%r9d
xor    %r10d,%r10d
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <_getopt_internal_r_a@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getopt_long_only_r_a>:
push   %rax
mov    %r9,%rax
mov    $0x1,%r9d
push   $0x0
push   %rax
call   1030 <_getopt_internal_r_a@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.option_a = type { i32 }
%struct._getopt_data_a = type { i32 }
define i32 @_getopt_long_only_r_a(i32 %0, i8** %1, i8* %2, %struct.option_a* %3, i32* %4, %struct._getopt_data_a* %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8*
%10 = alloca %struct.option_a*
%11 = alloca i32*
%12 = alloca %struct._getopt_data_a*
store i32 %0, i32* %7
store i8** %1, i8*** %8
store i8* %2, i8** %9
store %struct.option_a* %3, %struct.option_a** %10
store i32* %4, i32** %11
store %struct._getopt_data_a* %5, %struct._getopt_data_a** %12
%13 = load i32, i32* %7
%14 = load i8**, i8*** %8
%15 = load i8*, i8** %9
%16 = load %struct.option_a*, %struct.option_a** %10
%17 = load i32*, i32** %11
%18 = load %struct._getopt_data_a*, %struct._getopt_data_a** %12
%19 = call i32 @_getopt_internal_r_a(i32 %13, i8** %14, i8* %15, %struct.option_a* %16, i32* %17, i32 1, %struct._getopt_data_a* %18, i32 0)
ret i32 %19
}

LLVM IR (-O2):
%struct.option_a = type { i32 }
%struct._getopt_data_a = type { i32 }
define i32 @_getopt_long_only_r_a(i32 %0, i8** %1, i8* %2, %struct.option_a* %3, i32* %4, %struct._getopt_data_a* %5) {
%7 = tail call i32 @_getopt_internal_r_a(i32 %0, i8** %1, i8* %2, %struct.option_a* %3, i32* %4, i32 1, %struct._getopt_data_a* %5, i32 0)
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void WatchdogUnlock(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x40000000) || (ui32Base == 0x40001000));
  (*((volatile uint32_t *)(ui32Base + 0x00000C00))) = 0x1ACCE551;
}


x86 assembly (clang, -O0):
<WatchdogUnlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x40000000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <WatchdogUnlock+0x2a>
cmpl   $0x40001000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0xc00,%eax
cltq
movl   $0x1acce551,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogUnlock>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40000000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
movl   $0x1acce551,0xc00(%rax)
e5 cc 1a
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogUnlock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 3072
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 449635665, i32* %15
ret void
}

LLVM IR (-O2):
define void @WatchdogUnlock(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 3072
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 449635665, i32* %8
ret void
}
/* Variables and functions */
scalar_t__ can_read(char *);
scalar_t__ can_write(char *);
int get_rw(char *current_addr) {
  if (can_read(current_addr)) {
    if (can_write(current_addr)) {
      return 1;
    }
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_rw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <can_read@plt>
cmp    $0x0,%rax
je     116a <get_rw+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <can_write@plt>
cmp    $0x0,%rax
je     115e <get_rw+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1171 <get_rw+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1171 <get_rw+0x51>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rw>:
push   %rbx
mov    %rdi,%rbx
call   1030 <can_read@plt>
test   %rax,%rax
je     1143 <get_rw+0x23>
mov    %rbx,%rdi
call   1040 <can_write@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_rw(i8* %0) {
%2 = tail call i64 @can_read(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @can_write(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
int xmlUCSIsCherokee(int code) {
  return (((code >= 0x13A0) && (code <= 0x13FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCherokee>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x13a0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsCherokee+0x26>
cmpl   $0x13ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCherokee>:
add    $0xffffec60,%edi
xor    %eax,%eax
cmp    $0x60,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCherokee(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 5024
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 5119
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsCherokee(i32 %0) {
%2 = add i32 %0, -5024
%3 = icmp ult i32 %2, 96
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS)
    stream = stdout;
  fprintf(stream, "Usage: %s <username> [utmp_file] [wtmp_file]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [46 x i8] c"Usage: %s <username> [utmp_file] [wtmp_file]\0A\00"
define void @helpAndLeave(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** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [46 x i8] c"Usage: %s <username> [utmp_file] [wtmp_file]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srl_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_srl_epi32(__m128i A, __m128i B) { return _mm_srl_epi32(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_srl_epi32>:
jmp    1030 <_mm_srl_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srl_epi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srl_epi32(i32 %0, i32 %1)
ret i32 %3
}
int iso_error_get_priority(int e) { return ((e & 0x00700000) << 8); }


x86 assembly (clang, -O0):
<iso_error_get_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x700000,%eax
shl    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_error_get_priority>:
mov    %edi,%eax
shl    $0x8,%eax
and    $0x70000000,%eax
ret

LLVM IR (-O0):
define i32 @iso_error_get_priority(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 7340032
%5 = shl i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @iso_error_get_priority(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, 1879048192
ret i32 %3
}
/* Variables and functions */
int options_validate(void *, void *, void *, int, char **);
int options_validate_cb(void *old_options, void *options, void *default_options,
                        int from_setconf, char **msg) {
  return options_validate(old_options, options, default_options, from_setconf,
                          msg);
}


x86 assembly (clang, -O0):
<options_validate_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1030 <options_validate@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options_validate_cb>:
jmp    1030 <options_validate@plt>

LLVM IR (-O0):
define i32 @options_validate_cb(i8* %0, i8* %1, i8* %2, i32 %3, i8** %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8**
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8** %4, i8*** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i8**, i8*** %10
%16 = call i32 @options_validate(i8* %11, i8* %12, i8* %13, i32 %14, i8** %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @options_validate_cb(i8* %0, i8* %1, i8* %2, i32 %3, i8** %4) {
%6 = tail call i32 @options_validate(i8* %0, i8* %1, i8* %2, i32 %3, i8** %4)
ret i32 %6
}