xunge/DecIR huggingface dataset:
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ uevent_filtering(struct __test_metadata *);
void wrapper_uevent_filtering(struct __test_metadata *_metadata,
                              struct __fixture_variant_metadata *variant) {
  uevent_filtering(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_uevent_filtering>:
jmp    1030 <uevent_filtering@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_uevent_filtering(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @uevent_filtering(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_uevent_filtering(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @uevent_filtering(%struct.__test_metadata* %0)
ret void
}
long vint(long v) { return v << 3; }


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

x86 assembly (clang, -O2):
<vint>:
lea    0x0(,%rdi,8),%rax
ret

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

LLVM IR (-O2):
define i64 @vint(i64 %0) {
%2 = shl i64 %0, 3
ret i64 %2
}
double logical_and(double a, double b) { return a != 0.0 && b != 0.0; }


x86 assembly (clang, -O0):
<logical_and>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1130 <logical_and+0x30>
jp     1130 <logical_and+0x30>
jmp    1147 <logical_and+0x47>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<logical_and>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
and    %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @logical_and(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp une double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp une double %8, 0.000000e+00
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @logical_and(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = and i1 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=sc8830 USING_OS_MEMORY=0 API_VERSION=17 "
         "REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0-rr3p1 "
         "CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 CPU= "
         "USING_UMP=1 USING_MALI200=0 USING_MALI400=6 USING_MALI400_L2_CACHE=1 "
         "USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/sc8830/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

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

LLVM IR (-O0):
@.str = [408 x i8] c"malidrv: CONFIG=sc8830 USING_OS_MEMORY=0 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0-rr3p1 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=6 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/sc8830/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([408 x i8], [408 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [408 x i8] c"malidrv: CONFIG=sc8830 USING_OS_MEMORY=0 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0-rr3p1 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=6 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/sc8830/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([408 x i8], [408 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_whitespace(int amount) {
  for (int i = 0; i < amount; i++) {
    putchar(' ');
  }
}


x86 assembly (clang, -O0):
<print_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <print_whitespace+0x36>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_whitespace+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_whitespace>:
push   %rbx
test   %edi,%edi
jle    112f <print_whitespace+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_whitespace+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_whitespace(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i8 signext 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ fbtext_putc(int /*<<< orphan*/);
void fbtext_puts(char *s) {
  while (*s) {
    fbtext_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<fbtext_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <fbtext_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <fbtext_putc@plt>
jmp    111c <fbtext_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fbtext_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <fbtext_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <fbtext_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <fbtext_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @fbtext_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @fbtext_putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ perror(char *);
int tcgetattr(int /*<<< orphan*/, struct termios *);
int mgetkey_attr_get(struct termios *ptty_attr) {
  if (tcgetattr(STDIN_FILENO, ptty_attr) == -1) {
    perror("mgetkey: Cannot get tty attributes");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<mgetkey_attr_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <tcgetattr@plt>
cmp    $0xffffffff,%eax
jne    115f <mgetkey_attr_get+0x3f>
lea    0xeb2(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1166 <mgetkey_attr_get+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgetkey_attr_get>:
push   %rax
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <tcgetattr@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1140 <mgetkey_attr_get+0x20>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@.str = [35 x i8] c"mgetkey: Cannot get tty attributes\00"
define i32 @mgetkey_attr_get(%struct.termios* %0) {
%2 = alloca i32
%3 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %3
%4 = load i32, i32* @STDIN_FILENO
%5 = load %struct.termios*, %struct.termios** %3
%6 = call i32 @tcgetattr(i32 %4, %struct.termios* %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@.str = [35 x i8] c"mgetkey: Cannot get tty attributes\00"
define i32 @mgetkey_attr_get(%struct.termios* %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = tail call i32 @tcgetattr(i32 %2, %struct.termios* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 0, %5 ], [ 1, %1 ]
ret i32 %8
}
int i_slicingDepth(int d) {
  if (d <= 5)
    return 1;
  if (d <= 7)
    return 2;
  if (d <= 12)
    return 3;
  return 4;
}


x86 assembly (clang, -O0):
<i_slicingDepth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     111d <i_slicingDepth+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1150 <i_slicingDepth+0x50>
cmpl   $0x7,-0x8(%rbp)
jg     1133 <i_slicingDepth+0x33>
movl   $0x2,-0x4(%rbp)
jmp    1150 <i_slicingDepth+0x50>
cmpl   $0xc,-0x8(%rbp)
jg     1149 <i_slicingDepth+0x49>
movl   $0x3,-0x4(%rbp)
jmp    1150 <i_slicingDepth+0x50>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_slicingDepth>:
mov    $0x1,%eax
cmp    $0x6,%edi
jl     111f <i_slicingDepth+0x1f>
mov    $0x2,%eax
cmp    $0x8,%edi
jb     111f <i_slicingDepth+0x1f>
cmp    $0xd,%edi
mov    $0x4,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @i_slicingDepth(i32 %0) {
%2 = icmp slt i32 %0, 6
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 8
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 13
%7 = select i1 %6, i32 3, i32 4
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ geteuid();
scalar_t__ setreuid(int /*<<< orphan*/, int /*<<< orphan*/);
bool upgrade() { return setreuid(geteuid(), 0) == 0; }


x86 assembly (clang, -O0):
<upgrade>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <geteuid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <setreuid@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<upgrade>:
push   %rax
xor    %eax,%eax
call   1030 <geteuid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <setreuid@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @upgrade() {
%1 = call i32 (...) @geteuid()
%2 = call i64 @setreuid(i32 %1, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @upgrade() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i64 @setreuid(i32 %1, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void end_timer(void) {}


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

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

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

LLVM IR (-O2):
define void @end_timer() {
ret void
}
int egsy_gcm_mult_lenc_lsb_csr_debug_set(
    unsigned int dev_id, union egsy_gcm_mult_lenc_lsb_csr_debug_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.egsy_gcm_mult_lenc_lsb_csr_debug_u = type opaque
define i32 @egsy_gcm_mult_lenc_lsb_csr_debug_set(i32 %0, %union.egsy_gcm_mult_lenc_lsb_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_gcm_mult_lenc_lsb_csr_debug_u*
store i32 %0, i32* %3
store %union.egsy_gcm_mult_lenc_lsb_csr_debug_u* %1, %union.egsy_gcm_mult_lenc_lsb_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_gcm_mult_lenc_lsb_csr_debug_u = type opaque
define i32 @egsy_gcm_mult_lenc_lsb_csr_debug_set(i32 %0, %union.egsy_gcm_mult_lenc_lsb_csr_debug_u* nocapture readnone %1) {
ret i32 1
}
int atoh(const char c) {
  int ret = 0;
  ret = (int)(c - '0');
  if (ret > 9) {
    ret = (int)(c - 'a' + 10);
  }
  return ret;
}


x86 assembly (clang, -O0):
<atoh>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jle    1132 <atoh+0x32>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoh>:
lea    -0x30(%rdi),%ecx
lea    -0x57(%rdi),%eax
cmp    $0x3a,%dil
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @atoh(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 48
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 9
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 97
%13 = add nsw i32 %12, 10
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @atoh(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp sgt i8 %0, 57
%4 = select i1 %3, i32 -87, i32 -48
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
scalar_t__ crypt_init();
int ipmi_rmcpplus_init(void) {
  if (crypt_init())
    return (-1);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @ipmi_rmcpplus_init() {
%1 = tail call i64 (...) @crypt_init()
%2 = icmp ne i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  while (1) {
    int n;
    scanf("%d", &n);
    printf("LEFT\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xec7(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"LEFT\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [5 x i8] c"LEFT\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %3
}
/* Type definitions */
struct benchmark_args {
  int dummy;
};
struct benchmark {
  int dummy;
};

/* Variables and functions */
int map_common_exit(struct benchmark *, struct benchmark_args *);
int /*<<< orphan*/ map_keys_exit(struct benchmark *, struct benchmark_args *);
int map_get_exit(struct benchmark *bench, struct benchmark_args *args) {
  map_keys_exit(bench, args);
  return map_common_exit(bench, args);
}


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

x86 assembly (clang, -O2):
<map_get_exit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <map_keys_exit@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <map_common_exit@plt>

LLVM IR (-O0):
%struct.benchmark = type { i32 }
%struct.benchmark_args = type { i32 }
define i32 @map_get_exit(%struct.benchmark* %0, %struct.benchmark_args* %1) {
%3 = alloca %struct.benchmark*
%4 = alloca %struct.benchmark_args*
store %struct.benchmark* %0, %struct.benchmark** %3
store %struct.benchmark_args* %1, %struct.benchmark_args** %4
%5 = load %struct.benchmark*, %struct.benchmark** %3
%6 = load %struct.benchmark_args*, %struct.benchmark_args** %4
%7 = call i32 @map_keys_exit(%struct.benchmark* %5, %struct.benchmark_args* %6)
%8 = load %struct.benchmark*, %struct.benchmark** %3
%9 = load %struct.benchmark_args*, %struct.benchmark_args** %4
%10 = call i32 @map_common_exit(%struct.benchmark* %8, %struct.benchmark_args* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.benchmark = type { i32 }
%struct.benchmark_args = type { i32 }
define i32 @map_get_exit(%struct.benchmark* %0, %struct.benchmark_args* %1) {
%3 = tail call i32 @map_keys_exit(%struct.benchmark* %0, %struct.benchmark_args* %1)
%4 = tail call i32 @map_common_exit(%struct.benchmark* %0, %struct.benchmark_args* %1)
ret i32 %4
}
/* Variables and functions */
int INT32_MIN;
int tadd_ok(int, int);
int tsub_ok(int x, int y) {
  if (y == INT32_MIN) {
    if (x < 0)
      return 0;
    else
      return 1;
  }
  return tadd_ok(x, -y);
}


x86 assembly (clang, -O0):
<tsub_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb8(%rip),%rcx
cmp    (%rcx),%eax
jne    1152 <tsub_ok+0x42>
cmpl   $0x0,-0x8(%rbp)
jge    1146 <tsub_ok+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1162 <tsub_ok+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1162 <tsub_ok+0x52>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
call   1030 <tadd_ok@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsub_ok>:
mov    0x2ec9(%rip),%rax
cmp    %esi,(%rax)
jne    1123 <tsub_ok+0x13>
not    %edi
shr    $0x1f,%edi
mov    %edi,%eax
ret
neg    %esi
jmp    1030 <tadd_ok@plt>

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

LLVM IR (-O2):
@INT32_MIN = global i32 0
define i32 @tsub_ok(i32 %0, i32 %1) {
%3 = load i32, i32* @INT32_MIN
%4 = icmp eq i32 %3, %1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = xor i32 %0, -1
%7 = lshr i32 %6, 31
br label %11
8: ; preds = %2
%9 = sub nsw i32 0, %1
%10 = tail call i32 @tadd_ok(i32 %0, i32 %9)
br label %11
11: ; preds = %5, %8
%12 = phi i32 [ %10, %8 ], [ %7, %5 ]
ret i32 %12
}
int test_imm_49uint16_reg(unsigned short val) {
  return ((val) & (-0x49 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_49uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffb7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_49uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -73
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t lfs2_frombe32(uint32_t a) {
  return (((uint8_t *)&a)[0] << 24) | (((uint8_t *)&a)[1] << 16) |
         (((uint8_t *)&a)[2] << 8) | (((uint8_t *)&a)[3] << 0);
}


x86 assembly (clang, -O0):
<lfs2_frombe32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    0x0(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    0x8(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lfs2_frombe32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = getelementptr inbounds i32, i32* %2, i64 0
%4 = load i32, i32* %3
%5 = shl i32 %4, 24
%6 = getelementptr inbounds i32, i32* %2, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = or i32 %5, %8
%10 = getelementptr inbounds i32, i32* %2, i64 2
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = getelementptr inbounds i32, i32* %2, i64 3
%15 = load i32, i32* %14
%16 = shl i32 %15, 0
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @lfs2_frombe32(i32 %0) {
ret i32 poison
}
void fail(void) {
ERROR:
  goto ERROR;
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fail+0x9>
jmp    1109 <fail+0x9>

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

LLVM IR (-O0):
define void @fail() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @fail() {
br label %1
1: ; preds = %1, %0
br label %1
}
int main(void) {
  volatile int number1, number2 = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
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 volatile i32 0, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
ret i32 0
}
unsigned long get_dr6(void) {
  unsigned long value;
  asm volatile("mov %%dr6,%0" : "=r"(value));
  return value;
}


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

x86 assembly (clang, -O2):
<get_dr6>:
mov    %db6,%rax
ret

LLVM IR (-O0):
define i64 @get_dr6() {
%1 = alloca i64
%2 = call i64 asm sideeffect "mov %dr6,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_dr6() {
%1 = tail call i64 asm sideeffect "mov %dr6,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void g_node_nth_child() {}


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

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

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

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

/* Variables and functions */
int strcoll(char const *, char const *);
int strcoll_l(const char *l, const char *r, locale_t loc) {
  return strcoll(l, r);
}


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

x86 assembly (clang, -O2):
<strcoll_l>:
jmp    1030 <strcoll@plt>

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

LLVM IR (-O2):
define i32 @strcoll_l(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strcoll(i8* %0, i8* %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int nextEntity(char *, int /*<<< orphan*/ *);
scalar_t__ strcmp(char const *, char *);
void discardTag(const char *tagname, FILE *in) {
  char entity[256];
  int istag;
  while ((istag = nextEntity(entity, in)) != -1) {
    if (istag == 1 && strcmp(tagname, entity) == 0)
      break;
  }
}


x86 assembly (clang, -O0):
<discardTag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <nextEntity@plt>
mov    %eax,-0x114(%rbp)
cmp    $0xffffffff,%eax
je     1183 <discardTag+0x63>
cmpl   $0x1,-0x114(%rbp)
jne    117e <discardTag+0x5e>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    117e <discardTag+0x5e>
jmp    1183 <discardTag+0x63>
jmp    1133 <discardTag+0x13>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discardTag>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
jmp    1150 <discardTag+0x30>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1165 <discardTag+0x45>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <nextEntity@plt>
cmp    $0x1,%eax
je     1140 <discardTag+0x20>
cmp    $0xffffffff,%eax
jne    1150 <discardTag+0x30>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @discardTag(i8* %0, i32* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %7, %2
%6 = call i32 @nextEntity(i8* %4, i32* %1)
switch i32 %6, label %7 [
i32 -1, label %11
i32 1, label %8
]
7: ; preds = %5, %8
br label %5
8: ; preds = %5
%9 = call i64 @strcmp(i8* %0, i8* %4)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %5, %8
ret void
}
/* Variables and functions */
int isinf(double);
int chpl_macro_double_isinf(double x) { return isinf(x); }


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

x86 assembly (clang, -O2):
<chpl_macro_double_isinf>:
jmp    1030 <isinf@plt>

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

LLVM IR (-O2):
define i32 @chpl_macro_double_isinf(double %0) {
%2 = tail call i32 @isinf(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print(char *str) { printf(str); }


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

x86 assembly (clang, -O2):
<print>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
int f() {
  int x;
  int y;
  x = 0;
  y = 1;
  {
    x = x + y;
    y = 10;
    {
      int y;
      x = x + y;
      y = 100;
      { x = x + y; }
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x64,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 201
}
void foo634(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo634(i32 %0) {
ret void
}
/* Variables and functions */
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
getchar() { return (getc(stdin)); }


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = call i32 @getc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
ret i32 %2
}
/* Variables and functions */
double pow(double, int);
double L(double rohair, double ustar, double t0, double h) {
  return (rohair * 1004 * pow(ustar, 3) * t0 / (0.41 * 9.807 * h));
}


x86 assembly (clang, -O0):
<L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  0xed4(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L>:
sub    $0x18,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
mulsd  0xed8(%rip),%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xeb4(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @L(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = fmul double %9, 1.004000e+03
%11 = load double, double* %6
%12 = call double @pow(double %11, i32 3)
%13 = fmul double %10, %12
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = load double, double* %8
%17 = fmul double 0x4010155EF1FDDEBD, %16
%18 = fdiv double %15, %17
ret double %18
}

LLVM IR (-O2):
define double @L(double %0, double %1, double %2, double %3) {
%5 = fmul double %0, 1.004000e+03
%6 = tail call double @pow(double %1, i32 3)
%7 = fmul double %5, %6
%8 = fmul double %7, %2
%9 = fmul double %3, 0x4010155EF1FDDEBD
%10 = fdiv double %8, %9
ret double %10
}
int sign_int(int num) {
  return ((((((num))) <= (((0)))) ? (((((num))) < (((0)))) ? ((-1)) : ((0)))
                                  : ((1))));
}


x86 assembly (clang, -O0):
<sign_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1129 <sign_int+0x29>
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <sign_int+0x36>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <sign_int+0x36>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_int>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
neg    %ecx
test   %edi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign_int(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = icmp ne i32 %0, 0
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 %4, i32 1
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
char *strstr(char *, char *);
char *parse_text(char *line, char *cmd) {
  char *parsed_text = strstr(line, cmd);
  if (parsed_text == line) {
    return parsed_text + strlen(cmd);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<parse_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1175 <parse_text+0x55>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    117d <parse_text+0x5d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_text>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1149 <parse_text+0x29>
xor    %r14d,%r14d
jmp    1156 <parse_text+0x36>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @parse_text(i8* %0, i8* %1) {
%3 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %1)
%4 = call i32 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
br label %10
10: ; preds = %2, %6
%11 = phi i8* [ %9, %6 ], [ null, %2 ]
ret i8* %11
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ colormap;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
unsigned long get_XStandardColormap_colormap(void *_p) {
  return (unsigned long)((XStandardColormap *)_p)->colormap;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XStandardColormap_colormap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XStandardColormap_colormap(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ hlt();
int /*<<< orphan*/ print_err(char *);
void sdram_no_memory(void) {
  print_err("No memory!!\r\n");
  while (1) {
    hlt();
  }
}


x86 assembly (clang, -O0):
<sdram_no_memory>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <print_err@plt>
mov    $0x0,%al
call   1040 <hlt@plt>
jmp    1130 <sdram_no_memory+0x10>

x86 assembly (clang, -O2):
<sdram_no_memory>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print_err@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <hlt@plt>
jmp    1130 <sdram_no_memory+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c"No memory!!\0D\0A\00"
define void @sdram_no_memory() {
%1 = call i32 @print_err(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @hlt()
br label %2
}

LLVM IR (-O2):
@.str = [14 x i8] c"No memory!!\0D\0A\00"
define void @sdram_no_memory() {
%1 = tail call i32 @print_err(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @hlt()
br label %2
}
/* Variables and functions */
int func1(int);
int main(int argc, char **argv) {
  int ret = 0;
  ret = func1(1);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 @func1(i32 1)
store i32 %7, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @func1(i32 1)
ret i32 0
}
void call___do_global_ctors_aux() { return; }


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

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

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

LLVM IR (-O2):
define void @call___do_global_ctors_aux() {
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ do_write(int, char const *, int);
ssize_t write_zero(int fd, size_t len) {
  size_t i = len;
  while (i--) {
    const char x = 0;
    if (do_write(fd, &x, 1) < 0)
      return -1;
  }
  return len;
}


x86 assembly (clang, -O0):
<write_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1170 <write_zero+0x60>
movb   $0x0,-0x19(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x19(%rbp),%rsi
mov    $0x1,%edx
call   1030 <do_write@plt>
cmp    $0x0,%rax
jge    116b <write_zero+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <write_zero+0x67>
jmp    1127 <write_zero+0x17>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_zero>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebp
lea    0x1(%rsi),%rbx
lea    0x7(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffffffffffff,%rbx
je     1155 <write_zero+0x45>
movb   $0x0,0x7(%rsp)
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <do_write@plt>
test   %rax,%rax
jns    1130 <write_zero+0x20>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @write_zero(i32 %0, i64 %1) {
%3 = alloca i8
br label %4
4: ; preds = %7, %2
%5 = phi i64 [ %1, %2 ], [ %8, %7 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = add i64 %5, -1
store i8 0, i8* %3
%9 = call i64 @do_write(i32 %0, i8* %3, i32 1)
%10 = icmp slt i64 %9, 0
br i1 %10, label %13, label %4
11: ; preds = %4
%12 = trunc i64 %1 to i32
br label %13
13: ; preds = %7, %11
%14 = phi i32 [ %12, %11 ], [ -1, %7 ]
ret i32 %14
}
void XkbChangeMap() {}


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

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

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

LLVM IR (-O2):
define void @XkbChangeMap() {
ret void
}
void f_acc_routine(void) {
#pragma acc parallel
  ;
}


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

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

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

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