xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int /*<<< orphan*/ tm_zone;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
char *strdup(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *get_current_timezone(void) {
  static char *timezone = NULL;
  time_t t = time(NULL);
  struct tm lt = {0};
  localtime_r(&t, &lt);
  timezone = strdup(lt.tm_zone);
  return timezone;
}


x86 assembly (clang, -O0):
<get_current_timezone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x10(%rbp),%edi
call   1060 <strdup@plt>
mov    %rax,0x2ec8(%rip)
mov    0x2ec1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_timezone>:
sub    $0x18,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <localtime_r@plt>
mov    0x10(%rsp),%edi
call   1050 <strdup@plt>
mov    %rax,0x2ed9(%rip)
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
@get_current_timezone.timezone = internal global i8* null
define i8* @get_current_timezone() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = bitcast %struct.tm* %2 to i8*
%5 = call i32 @localtime_r(i32* %1, %struct.tm* %2)
%6 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i8* @strdup(i32 %7)
store i8* %8, i8** @get_current_timezone.timezone
%9 = load i8*, i8** @get_current_timezone.timezone
ret i8* %9
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
@get_current_timezone.timezone = internal unnamed_addr global i8* null
define i8* @get_current_timezone() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i64* %2 to %struct.tm*
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %1
%6 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%7 = call i32 @localtime_r(i32* %1, %struct.tm* %3)
%8 = bitcast i64* %2 to i32*
%9 = load i32, i32* %8
%10 = call i8* @strdup(i32 %9)
store i8* %10, i8** @get_current_timezone.timezone
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void motion(int x, int y) { printf("motion x=%x y=%d\n", x, y); }


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

x86 assembly (clang, -O2):
<motion>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"motion x=%x y=%d\0A\00"
define void @motion(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 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"motion x=%x y=%d\0A\00"
define void @motion(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void RTLatin1ToUtf16Tag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLatin1ToUtf16Tag() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(void *, char *, int);
void __print_int(void *to, void *v) { fprintf(to, "%02x ", *(int *)v); }


x86 assembly (clang, -O0):
<__print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__print_int>:
mov    (%rsi),%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%02x \00"
define void @__print_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = call i32 @fprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define void @__print_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @fprintf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_membarrier;
int syscall(int /*<<< orphan*/, int, int, int);
int sys_membarrier(int cmd, int flags, int cpu_id) {
  return syscall(__NR_membarrier, cmd, flags, cpu_id);
}


x86 assembly (clang, -O0):
<sys_membarrier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_membarrier>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_membarrier = global i32 0
define i32 @sys_membarrier(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_membarrier
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@__NR_membarrier = global i32 0
define i32 @sys_membarrier(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @__NR_membarrier
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i32 %2)
ret i32 %5
}
void XVaCreateNestedList() {}


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

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

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

LLVM IR (-O2):
define void @XVaCreateNestedList() {
ret void
}
long PowerInt(long n1, long n2) {
  long i;
  long answer = 1;
  for (i = 1; i <= n2; i++)
    answer *= n1;
  return (answer);
}


x86 assembly (clang, -O0):
<PowerInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x20(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1148 <PowerInt+0x48>
mov    -0x8(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <PowerInt+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PowerInt>:
test   %rsi,%rsi
jle    111b <PowerInt+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <PowerInt+0x21>
mov    $0x1,%eax
jmp    1156 <PowerInt+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <PowerInt+0x30>
test   %rcx,%rcx
je     116a <PowerInt+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <PowerInt+0x60>
ret

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

LLVM IR (-O2):
define i64 @PowerInt(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, 1
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul nsw i64 %11, %0
%14 = mul nsw i64 %13, %0
%15 = mul nsw i64 %14, %0
%16 = mul nsw i64 %15, %0
%17 = mul nsw i64 %16, %0
%18 = mul nsw i64 %17, %0
%19 = mul nsw i64 %18, %0
%20 = mul nsw i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul nsw i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
unsigned int get_servo_position_b(unsigned char servoNum) {
  return get_servo_position_b(servoNum);
}


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

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

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

LLVM IR (-O2):
define i32 @get_servo_position_b(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "%s [h?imarspldetfz]*\n", progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"%s [h?imarspldetfz]*\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"%s [h?imarspldetfz]*\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int sh_vector_compare_lexic(void const *, void const *);
int sh_stack_compare_lexic(const void *s, const void *s2) {
  return sh_vector_compare_lexic(s, s2);
}


x86 assembly (clang, -O0):
<sh_stack_compare_lexic>:
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   1030 <sh_vector_compare_lexic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh_stack_compare_lexic>:
jmp    1030 <sh_vector_compare_lexic@plt>

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

LLVM IR (-O2):
define i32 @sh_stack_compare_lexic(i8* %0, i8* %1) {
%3 = tail call i32 @sh_vector_compare_lexic(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void breakpoint_trap(void) { panic("exception(trap): breakpoint"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"exception(trap): breakpoint\00"
define void @breakpoint_trap() {
%1 = call i32 @panic(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"exception(trap): breakpoint\00"
define void @breakpoint_trap() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_61uint8_reg(unsigned char val) {
  return ((val) & (0x61 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_61uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 97
%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_61uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 97
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rtps_ser_init(void) { printf("rtps_ser_init()\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"rtps_ser_init()\00"
define void @rtps_ser_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fact(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int n, m, c, t;
  scanf("%d %d %d", &n, &m, &c);
  t = n + m - c - 1;
  printf("%lld\n", fact(t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x10(%rsp),%eax
add    0x14(%rsp),%eax
mov    0xc(%rsp),%edi
not    %edi
add    %eax,%edi
call   1040 <fact@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = call i32 @fact(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = load i32, i32* %3
%12 = xor i32 %11, -1
%13 = add i32 %10, %12
%14 = call i32 @fact(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_all_flags();
int run_benchmarks(int i) { check_all_flags(); }


x86 assembly (clang, -O0):
<run_benchmarks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <check_all_flags@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @run_benchmarks(i32 %0) {
%2 = tail call i32 (...) @check_all_flags()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int pack_unpack(char *, char *);
int main(void) {
  int n = pack_unpack("\200\001\377\376\035\300", "sl");
  if (n != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <pack_unpack@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1156 <main+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <pack_unpack@plt>
test   %eax,%eax
jne    113c <main+0x1c>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\80\01\FF\FE\1D\C0\00"
@.str.1 = [3 x i8] c"sl\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @pack_unpack(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"\80\01\FF\FE\1D\C0\00"
@.str.1 = [3 x i8] c"sl\00"
define i32 @main() {
%1 = tail call i32 @pack_unpack(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int free_int_2d(int ***pppMatrix) {
  free(&((*pppMatrix)[0][0]));
  free(*pppMatrix);
}


x86 assembly (clang, -O0):
<free_int_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_int_2d>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define i32 @free_int_2d(i32*** %0) {
%2 = alloca i32
%3 = alloca i32***
store i32*** %0, i32**** %3
%4 = load i32***, i32**** %3
%5 = load i32**, i32*** %4
%6 = getelementptr inbounds i32*, i32** %5, i64 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = bitcast i32* %8 to i8*
%10 = load i32***, i32**** %3
%11 = load i32**, i32*** %10
%12 = bitcast i32** %11 to i8*
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @free_int_2d(i32*** nocapture %0) {
%2 = bitcast i32*** %0 to i8***
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
%5 = bitcast i32*** %0 to i8**
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_STA();
void do0x32() { _I8080_STA(); }


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

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

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

LLVM IR (-O2):
define void @do0x32() {
%1 = tail call i32 (...) @_I8080_STA()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, char *);
char *plfit_strerror(int);
int /*<<< orphan*/ stderr;
void plfit_error_handler_printignore(const char *reason, const char *file,
                                     int line, int plfit_errno) {
  fprintf(stderr, "Error at %s:%i : %s, %s\n", file, line, reason,
          plfit_strerror(plfit_errno));
}


x86 assembly (clang, -O0):
<plfit_error_handler_printignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <plfit_strerror@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    %rax,%r9
lea    0xe88(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plfit_error_handler_printignore>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%r15
mov    0x2ea9(%rip),%rax
mov    (%rax),%ebp
mov    %ecx,%edi
call   1030 <plfit_strerror@plt>
lea    0xeb9(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r14d,%ecx
mov    %r15,%r8
mov    %rax,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Error at %s:%i : %s, %s\0A\00"
define void @plfit_error_handler_printignore(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %5
%13 = load i32, i32* %8
%14 = call i8* @plfit_strerror(i32 %13)
%15 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12, i8* %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Error at %s:%i : %s, %s\0A\00"
define void @plfit_error_handler_printignore(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i8* @plfit_strerror(i32 %3)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0, i8* %6)
ret void
}
int sub(int (*t)(int, int), int x, int y) { return (*t)(x, y); }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @sub(i32 (i32, i32)* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 %0(i32 %1, i32 %2)
ret i32 %4
}
int wordlen(char *word) {
  int i = 0;
  while (word[i++] != '\0')
    ;
  return i - 1;
}


x86 assembly (clang, -O0):
<wordlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1133 <wordlen+0x33>
jmp    110f <wordlen+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @wordlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
void *malloc(size_t);
void *default_malloc(void *opaque, size_t size) {
  (void)opaque;
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<default_malloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @default_malloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @default_malloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  if (!fork()) {
    printf("hello world!\n");
    while (1)
      ;
  } else {
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%eax
jne    1160 <main+0x30>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    115b <main+0x2b>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
jne    1152 <main+0x22>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
nopl   0x0(%rax,%rax,1)
jmp    1150 <main+0x20>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
%3 = icmp ne i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %6
br label %6
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %5
br label %5
6: ; preds = %0
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct nouveau_channel {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ OUT_RING(struct nouveau_channel *, int);
void BEGIN_NIC0(struct nouveau_channel *chan, int subc, int mthd, int size) {
  OUT_RING(chan, 0x60000000 | (size << 16) | (subc << 13) | (mthd >> 2));
}


x86 assembly (clang, -O0):
<BEGIN_NIC0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x10,%esi
or     $0x60000000,%esi
mov    -0xc(%rbp),%eax
shl    $0xd,%eax
or     %eax,%esi
mov    -0x10(%rbp),%eax
sar    $0x2,%eax
or     %eax,%esi
call   1030 <OUT_RING@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEGIN_NIC0>:
shl    $0x10,%ecx
shl    $0xd,%esi
sar    $0x2,%edx
or     %edx,%esi
or     %ecx,%esi
or     $0x60000000,%esi
jmp    1030 <OUT_RING@plt>

LLVM IR (-O0):
%struct.nouveau_channel = type { i32 }
define void @BEGIN_NIC0(%struct.nouveau_channel* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.nouveau_channel*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.nouveau_channel* %0, %struct.nouveau_channel** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.nouveau_channel*, %struct.nouveau_channel** %5
%10 = load i32, i32* %8
%11 = shl i32 %10, 16
%12 = or i32 1610612736, %11
%13 = load i32, i32* %6
%14 = shl i32 %13, 13
%15 = or i32 %12, %14
%16 = load i32, i32* %7
%17 = ashr i32 %16, 2
%18 = or i32 %15, %17
%19 = call i32 @OUT_RING(%struct.nouveau_channel* %9, i32 %18)
ret void
}

LLVM IR (-O2):
%struct.nouveau_channel = type { i32 }
define void @BEGIN_NIC0(%struct.nouveau_channel* %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 16
%6 = shl i32 %1, 13
%7 = ashr i32 %2, 2
%8 = or i32 %6, %7
%9 = or i32 %8, %5
%10 = or i32 %9, 1610612736
%11 = tail call i32 @OUT_RING(%struct.nouveau_channel* %0, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned long long);
int write_devattr(char const *, char *);
int write_devattr_int(const char *attr, unsigned long long value) {
  char buf[100];
  snprintf(buf, 100, "%llu", value);
  return write_devattr(attr, buf);
}


x86 assembly (clang, -O0):
<write_devattr_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x64,%esi
lea    0xeb9(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <write_devattr@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_devattr_int>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xecc(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x64,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <write_devattr@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%llu\00"
define i32 @write_devattr_int(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [100 x i8]
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = load i64, i64* %4
%8 = call i32 @snprintf(i8* %6, i32 100, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @write_devattr(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i32 @write_devattr_int(i8* %0, i64 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %1)
%6 = call i32 @write_devattr(i8* %0, i8* %4)
ret i32 %6
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t inb(uint16_t port) {
  uint8_t data;
  asm volatile("inb %w1, %b0" : "=a"(data) : "Nd"(port));
  return data;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inb(i32 %0) {
%2 = tail call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
int RoundDown(int val, int modulus) {
  int xvl;
  xvl = val - (val % modulus);
  if (val < 0 && val % modulus != 0)
    xvl -= modulus;
  return (xvl);
}


x86 assembly (clang, -O0):
<RoundDown>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1144 <RoundDown+0x44>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     1144 <RoundDown+0x44>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoundDown>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
cmove  %edx,%esi
xor    %eax,%eax
test   %edi,%edi
cmovs  %esi,%eax
add    %edx,%eax
sub    %eax,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @RoundDown(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp sgt i32 %0, -1
%5 = icmp eq i32 %3, 0
%6 = or i1 %4, %5
%7 = select i1 %6, i32 0, i32 %1
%8 = add i32 %3, %7
%9 = sub i32 %0, %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_attr_setscope(int /*<<< orphan*/ *, int);
void Pthread_attr_setscope(pthread_attr_t *attr, int scope) {
  int retval;
  assert(attr != NULL);
  retval = pthread_attr_setscope(attr, scope);
  if (retval != 0)
    Sys_failure("pthread_attr_setscope");
}


x86 assembly (clang, -O0):
<Pthread_attr_setscope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <pthread_attr_setscope@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1176 <Pthread_attr_setscope+0x46>
lea    0xe8f(%rip),%rdi
call   1050 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_attr_setscope>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <pthread_attr_setscope@plt>
test   %eax,%eax
je     1166 <Pthread_attr_setscope+0x36>
lea    0xea5(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Sys_failure@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"pthread_attr_setscope\00"
define void @Pthread_attr_setscope(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = call i32 @pthread_attr_setscope(i32* %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @Sys_failure(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"pthread_attr_setscope\00"
define void @Pthread_attr_setscope(i32* %0, i32 %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @pthread_attr_setscope(i32* %0, i32 %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}
void ScaleRowDown34_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_Any_SSSE3() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t ahci_ctrl_extract_bits(uint32_t val, uint32_t mask, uint8_t shift) {
  return (val & mask) >> shift;
}


x86 assembly (clang, -O0):
<ahci_ctrl_extract_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ahci_ctrl_extract_bits>:
mov    %edx,%ecx
mov    %edi,%eax
and    %esi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ahci_ctrl_extract_bits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %6
%11 = ashr i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ahci_ctrl_extract_bits(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = ashr i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int semctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void remove_semaphore_set(int semid) {
  if (-1 == semctl(semid, 0, IPC_RMID)) {
    perror("semctl:");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<remove_semaphore_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <semctl@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1173 <remove_semaphore_set+0x43>
lea    0xe9c(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_semaphore_set>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <semctl@plt>
cmp    $0xffffffff,%eax
je     1148 <remove_semaphore_set+0x18>
pop    %rax
ret
lea    0xeb1(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [8 x i8] c"semctl:\00"
define void @remove_semaphore_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @semctl(i32 %3, i32 0, i32 %4)
%6 = icmp eq i32 -1, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [8 x i8] c"semctl:\00"
define void @remove_semaphore_set(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @semctl(i32 %0, i32 0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
int left_child_index(int parent_index) { return 2 * parent_index + 1; }


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

x86 assembly (clang, -O2):
<left_child_index>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @left_child_index(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
struct iter {
  int dummy;
};

/* Variables and functions */
scalar_t__ tree_album_selected();
int tree_track_get_next_by_album(struct iter *);
int tree_track_get_next_by_artist(struct iter *);
int tree_track_get_next(struct iter *iter) {
  if (tree_album_selected())
    return tree_track_get_next_by_album(iter);
  else
    return tree_track_get_next_by_artist(iter);
}


x86 assembly (clang, -O0):
<tree_track_get_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <tree_album_selected@plt>
cmp    $0x0,%rax
je     115e <tree_track_get_next+0x2e>
mov    -0x10(%rbp),%rdi
call   1050 <tree_track_get_next_by_album@plt>
mov    %eax,-0x4(%rbp)
jmp    116a <tree_track_get_next+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <tree_track_get_next_by_artist@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_track_get_next>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <tree_album_selected@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1149 <tree_track_get_next+0x19>
pop    %rbx
jmp    1050 <tree_track_get_next_by_album@plt>
pop    %rbx
jmp    1040 <tree_track_get_next_by_artist@plt>

LLVM IR (-O0):
%struct.iter = type { i32 }
define i32 @tree_track_get_next(%struct.iter* %0) {
%2 = alloca i32
%3 = alloca %struct.iter*
store %struct.iter* %0, %struct.iter** %3
%4 = call i64 (...) @tree_album_selected()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.iter*, %struct.iter** %3
%8 = call i32 @tree_track_get_next_by_album(%struct.iter* %7)
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = load %struct.iter*, %struct.iter** %3
%11 = call i32 @tree_track_get_next_by_artist(%struct.iter* %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.iter = type { i32 }
define i32 @tree_track_get_next(%struct.iter* %0) {
%2 = tail call i64 (...) @tree_album_selected()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @tree_track_get_next_by_album(%struct.iter* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @tree_track_get_next_by_artist(%struct.iter* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
void mlx5_vhca_event_cleanup(struct mlx5_core_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.mlx5_core_dev = type opaque
define void @mlx5_vhca_event_cleanup(%struct.mlx5_core_dev* nocapture %0) {
ret void
}
/* Variables and functions */
char *CmdCurArg(char *);
int /*<<< orphan*/ isspace(char);
char *CmdNextArg(char *arg) {
  while (*arg && !isspace(*arg))
    arg++;
  return CmdCurArg(arg);
}


x86 assembly (clang, -O0):
<CmdNextArg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1158 <CmdNextArg+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1168 <CmdNextArg+0x48>
jmp    1179 <CmdNextArg+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <CmdNextArg+0xc>
mov    -0x8(%rbp),%rdi
call   1040 <CmdCurArg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdNextArg>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1148 <CmdNextArg+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1148 <CmdNextArg+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <CmdNextArg+0x10>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <CmdCurArg@plt>

LLVM IR (-O0):
define i8* @CmdNextArg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @isspace(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
%21 = call i8* @CmdCurArg(i8* %20)
ret i8* %21
}

LLVM IR (-O2):
define i8* @CmdNextArg(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
%15 = tail call i8* @CmdCurArg(i8* %14)
ret i8* %15
}