xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "USAGE: htmlget host [page]\n\thost: the website hostname. "
                  "ex: coding.debuntu.org\n\tpage: the page to retrieve. ex: "
                  "index.html, default: /\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [136 x i8] c"USAGE: htmlget host [page]\0A\09host: the website hostname. ex: coding.debuntu.org\0A\09page: the page to retrieve. ex: index.html, default: /\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [136 x i8] c"USAGE: htmlget host [page]\0A\09host: the website hostname. ex: coding.debuntu.org\0A\09page: the page to retrieve. ex: index.html, default: /\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CMGR_finalize();
void dcache_finalize(void) {
  CMGR_finalize();
  ;
}


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

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

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

LLVM IR (-O2):
define void @dcache_finalize() {
%1 = tail call i32 (...) @CMGR_finalize()
ret void
}
char platform_getseparator() { return '/'; }


x86 assembly (clang, -O0):
<platform_getseparator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2f,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_getseparator>:
mov    $0x2f,%al
ret

LLVM IR (-O0):
define signext i8 @platform_getseparator() {
ret i8 47
}

LLVM IR (-O2):
define signext i8 @platform_getseparator() {
ret i8 47
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x4e() {
  Assert_real((isprint(78)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              395, ("isprint should be 1 for N"));
}


x86 assembly (clang, -O0):
<t_isprint_0x4e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x18b,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x4e>:
push   %rax
mov    $0x4e,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x18b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for N\00"
define void @t_isprint_0x4e() {
%1 = call i32 @isprint(i32 78)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for N\00"
define void @t_isprint_0x4e() {
%1 = tail call i32 @isprint(i32 78)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void initVM() {}


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

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

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

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

/* Variables and functions */
uint8_t Settings_GetStepPinMask(uint8_t axis_idx) {
  if (axis_idx == 0) {
    return (1 << 0);
  }
  if (axis_idx == 1) {
    return (1 << 1);
  }
  if (axis_idx == 2) {
    return (1 << 2);
  }
  if (axis_idx == 3) {
    return (1 << 3);
  }
  return (1 << 4);
}


x86 assembly (clang, -O0):
<Settings_GetStepPinMask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <Settings_GetStepPinMask+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1166 <Settings_GetStepPinMask+0x66>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <Settings_GetStepPinMask+0x33>
movl   $0x2,-0x4(%rbp)
jmp    1166 <Settings_GetStepPinMask+0x66>
cmpl   $0x2,-0x8(%rbp)
jne    1149 <Settings_GetStepPinMask+0x49>
movl   $0x4,-0x4(%rbp)
jmp    1166 <Settings_GetStepPinMask+0x66>
cmpl   $0x3,-0x8(%rbp)
jne    115f <Settings_GetStepPinMask+0x5f>
movl   $0x8,-0x4(%rbp)
jmp    1166 <Settings_GetStepPinMask+0x66>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Settings_GetStepPinMask>:
mov    $0x10,%eax
cmp    $0x3,%edi
ja     1117 <Settings_GetStepPinMask+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.Settings_GetStepPinMask = [4 x i32] [i32 1, i32 2, i32 4, i32 8]
define i32 @Settings_GetStepPinMask(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.Settings_GetStepPinMask, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 16, %1 ]
ret i32 %8
}
unsigned char prvucMBBIN2CHAR(unsigned char ucByte) {
  if (ucByte <= 0x09) {
    return (unsigned char)('0' + ucByte);
  } else if ((ucByte >= 0x0A) && (ucByte <= 0x0F)) {
    return (unsigned char)(ucByte - 0x0A + 'A');
  } else {
  }
  return '0';
}


x86 assembly (clang, -O0):
<prvucMBBIN2CHAR>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jg     1126 <prvucMBBIN2CHAR+0x26>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1160 <prvucMBBIN2CHAR+0x60>
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jl     1152 <prvucMBBIN2CHAR+0x52>
movzbl -0x2(%rbp),%eax
cmp    $0xf,%eax
jg     1152 <prvucMBBIN2CHAR+0x52>
movzbl -0x2(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    1160 <prvucMBBIN2CHAR+0x60>
jmp    1157 <prvucMBBIN2CHAR+0x57>
jmp    115c <prvucMBBIN2CHAR+0x5c>
movb   $0x30,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prvucMBBIN2CHAR>:
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
cmp    $0x10,%dil
movzbl %cl,%ecx
mov    $0x30,%edx
cmovb  %ecx,%edx
cmp    $0xa,%dil
movzbl %al,%eax
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @prvucMBBIN2CHAR(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = add i8 %0, 48
%4 = icmp ult i8 %0, 16
%5 = add i8 %0, 55
%6 = select i1 %4, i8 %5, i8 48
%7 = select i1 %2, i8 %3, i8 %6
ret i8 %7
}
void netcdf_UpdateTimeUnitsTS(int year, int month, int day, int hour, int min,
                              int sec) {}


x86 assembly (clang, -O0):
<netcdf_UpdateTimeUnitsTS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @netcdf_UpdateTimeUnitsTS(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @netcdf_UpdateTimeUnitsTS(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t base128_digit(uint64_t val, int i) { return ((val >> 7 * i) & 127); }


x86 assembly (clang, -O0):
<base128_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x7,-0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base128_digit>:
mov    %edi,%eax
lea    0x0(,%rsi,8),%ecx
sub    %esi,%ecx
sar    %cl,%eax
and    $0x7f,%eax
ret

LLVM IR (-O0):
define i32 @base128_digit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 7, %6
%8 = ashr i32 %5, %7
%9 = and i32 %8, 127
ret i32 %9
}

LLVM IR (-O2):
define i32 @base128_digit(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 7
%4 = ashr i32 %0, %3
%5 = and i32 %4, 127
ret i32 %5
}
/* Type definitions */
struct ListNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ adjustHeap(struct ListNode **, int, int);
void createHeap(struct ListNode **nums, int numsSize) {
  for (int i = (numsSize >> 1) - 1; i >= 0; i--) {
    adjustHeap(nums, numsSize, i);
  }
}


x86 assembly (clang, -O0):
<createHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1152 <createHeap+0x42>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <adjustHeap@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <createHeap+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createHeap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <createHeap+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <adjustHeap@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <createHeap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define void @createHeap(%struct.ListNode** %0, i32 %1) {
%3 = alloca %struct.ListNode**
%4 = alloca i32
%5 = alloca i32
store %struct.ListNode** %0, %struct.ListNode*** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = ashr i32 %6, 1
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load %struct.ListNode**, %struct.ListNode*** %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @adjustHeap(%struct.ListNode** %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define void @createHeap(%struct.ListNode** %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i32 [ %9, %7 ], [ %5, %4 ]
%9 = add nsw i32 %8, -1
%10 = tail call i32 @adjustHeap(%struct.ListNode** %0, i32 %1, i32 %9)
%11 = icmp ugt i32 %8, 1
br i1 %11, label %7, label %6
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, char const *, unsigned int);
int shim_fsopen(const char *fsname, unsigned int flags) {
  return shim_enosys(0, fsname, flags);
}


x86 assembly (clang, -O0):
<shim_fsopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_fsopen>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_fsopen(i8* %0, i32 %1) {
%3 = tail call i32 @shim_enosys(i32 0, i8* %0, i32 %1)
ret i32 %3
}
OP(dd, f7) { op_f7(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_f7()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ RDP(char *);
void uc2_rdphalf_2() { RDP("uc2:rdphalf_2\n"); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"uc2:rdphalf_2\0A\00"
define void @uc2_rdphalf_2() {
%1 = tail call i32 @RDP(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_14uint16_reg(unsigned short val) {
  return ((val) & (0x14 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_14uint16_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, 20
%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_14uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 20
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int log2i(int n) {
  int i = 0;
  int v = n;
  while (v > 1) {
    v /= 2;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<log2i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    113a <log2i+0x3a>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <log2i+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2i>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <log2i+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <log2i+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2i(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = lshr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp ugt i32 %4, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimirAno(int ano) {
  int diferenca;
  diferenca = 2015 - ano;
  if (diferenca <= 0) {
    printf("%d A.C.\n", -diferenca + 1);
  } else {
    printf("%d D.C.\n", diferenca);
  }
}


x86 assembly (clang, -O0):
<imprimirAno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7df,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1149 <imprimirAno+0x39>
xor    %esi,%esi
sub    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <imprimirAno+0x48>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirAno>:
mov    %edi,%eax
cmp    $0x7df,%edi
jl     112d <imprimirAno+0x1d>
add    $0xfffff822,%eax
lea    0xeda(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>
mov    $0x7df,%esi
sub    %eax,%esi
lea    0xece(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%d A.C.\0A\00"
@.str.1 = [9 x i8] c"%d D.C.\0A\00"
define void @imprimirAno(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 2015, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
%11 = add nsw i32 %10, 1
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %16
13: ; preds = %1
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %8
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d A.C.\0A\00"
@.str.1 = [9 x i8] c"%d D.C.\0A\00"
define void @imprimirAno(i32 %0) {
%2 = icmp sgt i32 %0, 2014
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nsw i32 %0, -2014
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %9
6: ; preds = %1
%7 = sub nsw i32 2015, %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *fp;
  fp = fopen("test.txt", "w");
  if (fp == NULL) {
    fprintf(fp, "Testing...");
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117a <main+0x4a>
mov    -0x10(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
jne    1168 <main+0x38>
lea    0xebb(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1050 <fwrite@plt>
xor    %edi,%edi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [11 x i8] c"Testing...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %6, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [11 x i8] c"Testing...\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 10, i64 1, i32* null)
%5 = tail call i32 @fclose(i32* null)
br label %6
6: ; preds = %3, %0
ret i32 0
}
void f8(int i) {
  switch (i)
    break;
  switch ((int)i)
    break;
  switch ((unsigned int)i)
    break;
  switch ((_Bool)i) {
  case 11:
    break;
  }
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
test   %al,%al
jne    111b <f8+0x1b>
jmp    1116 <f8+0x16>
jmp    111b <f8+0x1b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
%5 = load i32, i32* %2
switch i32 %5, label %6 [
]
6: ; preds = %4
%7 = load i32, i32* %2
switch i32 %7, label %8 [
]
8: ; preds = %6
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
switch i32 %11, label %13 [
i32 11, label %12
]
12: ; preds = %8
br label %13
13: ; preds = %8, %12
ret void
}

LLVM IR (-O2):
define void @f8(i32 %0) {
ret void
}
double ldexp(double value, int exp) {
  double temp;
  __asm("fscale" : "=t"(temp) : "0"(value), "u"((double)exp));
  return (temp);
}


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
fldl   -0x20(%rbp)
fldl   -0x28(%rbp)
fxch   %st(1)
fscale
fstp   %st(1)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
cvtsi2sd %edi,%xmm1
movsd  %xmm0,-0x8(%rsp)
movsd  %xmm1,-0x10(%rsp)
fldl   -0x8(%rsp)
fldl   -0x10(%rsp)
fxch   %st(1)
fscale
fstp   %st(1)
fstpl  -0x18(%rsp)
movsd  -0x18(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%6 = load double, double* %3
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = call double asm "fscale", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(double %6, double %8)
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = tail call double asm "fscale", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(double %0, double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ _cerror(int /*<<< orphan*/);
int getrusage() {
  _cerror(EINVAL);
  return -1;
}


x86 assembly (clang, -O0):
<getrusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <_cerror@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrusage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <_cerror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @getrusage() {
%1 = load i32, i32* @EINVAL
%2 = call i32 @_cerror(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @getrusage() {
%1 = load i32, i32* @EINVAL
%2 = tail call i32 @_cerror(i32 %1)
ret i32 -1
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char *, int);
int ntohl(int /*<<< orphan*/);
uint64_t I2ntohll(uint64_t n64) {
  uint64_t h64;
  char *t8 = (char *)&n64;
  uint32_t t32;
  memcpy(&t32, &t8[0], 4);
  h64 = ntohl(t32);
  h64 <<= 32;
  memcpy(&t32, &t8[4], 4);
  h64 |= ntohl(t32);
  return h64;
}


x86 assembly (clang, -O0):
<I2ntohll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edi
call   1040 <ntohl@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2ntohll>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0x8(%rsp),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x8(%rsp),%edi
call   1040 <ntohl@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x8(%rsp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @I2ntohll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %2
%6 = bitcast i32* %2 to i8*
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = call i32 @memcpy(i32* %5, i8* %8, i32 4)
%10 = load i32, i32* %5
%11 = call i32 @ntohl(i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = shl i32 %12, 32
store i32 %13, i32* %3
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 4
%16 = call i32 @memcpy(i32* %5, i8* %15, i32 4)
%17 = load i32, i32* %5
%18 = call i32 @ntohl(i32 %17)
%19 = load i32, i32* %3
%20 = or i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @I2ntohll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%7 = load i32, i32* %3
%8 = call i32 @ntohl(i32 %7)
%9 = getelementptr inbounds i32, i32* %2, i64 1
%10 = bitcast i32* %9 to i8*
%11 = call i32 @memcpy(i32* %3, i8* %10, i32 4)
%12 = load i32, i32* %3
%13 = call i32 @ntohl(i32 %12)
ret i32 poison
}
int main() {
  int i;
  if (i) {
    i = 0;
  } else {
    i = 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
movl   $0x0,-0x8(%rbp)
jmp    1128 <main+0x28>
movl   $0x2,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void customer_left(int cliente) { printf("cliente #%i foi embora\n", cliente); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"cliente #%i foi embora\0A\00"
define void @customer_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"cliente #%i foi embora\0A\00"
define void @customer_left(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void SteamAPI_ISteamUser_CancelAuthTicket(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamUser_CancelAuthTicket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamUser_CancelAuthTicket>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUser_CancelAuthTicket = [37 x i8] c"SteamAPI_ISteamUser_CancelAuthTicket\00"
define void @SteamAPI_ISteamUser_CancelAuthTicket(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @__func__.SteamAPI_ISteamUser_CancelAuthTicket, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUser_CancelAuthTicket = [37 x i8] c"SteamAPI_ISteamUser_CancelAuthTicket\00"
define void @SteamAPI_ISteamUser_CancelAuthTicket(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @__func__.SteamAPI_ISteamUser_CancelAuthTicket, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int i2c_smbus_write_byte_data(int, int, int);
int radxaI2CWriteReg8(int fd, int reg, int data) {
  return i2c_smbus_write_byte_data(fd, reg, data);
}


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

x86 assembly (clang, -O2):
<radxaI2CWriteReg8>:
jmp    1030 <i2c_smbus_write_byte_data@plt>

LLVM IR (-O0):
define i32 @radxaI2CWriteReg8(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 = load i32, i32* %6
%10 = call i32 @i2c_smbus_write_byte_data(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @radxaI2CWriteReg8(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @i2c_smbus_write_byte_data(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
double atof(char const *);
double C_ATOF(const char *str) { return atof(str); }


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

x86 assembly (clang, -O2):
<C_ATOF>:
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define double @C_ATOF(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
double circle_length(double r) { return 2 * 3.1415926 * r; }


x86 assembly (clang, -O0):
<circle_length>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_length>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @circle_length(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x401921FB4D12D84A, %3
ret double %4
}

LLVM IR (-O2):
define double @circle_length(double %0) {
%2 = fmul double %0, 0x401921FB4D12D84A
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void iface1_func3(void) { printf("B - version 0 func3\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"B - version 0 func3\00"
define void @iface1_func3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void gtk_color_selection_get_previous_alpha() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_get_previous_alpha() {
ret void
}
main() {
  void *p = &&a;
  void **pp = &p;
  goto **pp;
a:;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0x1c(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1132 <main+0x32>
xor    %eax,%eax
pop    %rbp
ret
mov    -0x20(%rbp),%rax
jmp    *%rax

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8**
store i32 0, i32* %1
store i8* blockaddress(@main, %6), i8** %2
store i8** %2, i8*** %3
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
br label %7
6: ; preds = %7
ret i32 0
7: ; preds = %0
%8 = phi i8* [ %5, %0 ]
indirectbr i8* %8, [label %6]
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SubjectModel_getSubjectCriteria(char *);
int /*<<< orphan*/ SubjectModel_modifySubject(char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
void Controller_updateSubjectRange(char subjectName[], char subjectRange[]) {
  char subjectCriteria[256];
  strcpy(subjectCriteria, SubjectModel_getSubjectCriteria(subjectName));
  SubjectModel_modifySubject(subjectName, subjectCriteria, subjectRange);
  return;
}


x86 assembly (clang, -O0):
<Controller_updateSubjectRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SubjectModel_getSubjectCriteria@plt>
mov    -0x118(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <SubjectModel_modifySubject@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Controller_updateSubjectRange>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <SubjectModel_getSubjectCriteria@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <SubjectModel_modifySubject@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Controller_updateSubjectRange(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @SubjectModel_getSubjectCriteria(i8* %7)
%9 = call i32 @strcpy(i8* %6, i32 %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @SubjectModel_modifySubject(i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @Controller_updateSubjectRange(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @SubjectModel_getSubjectCriteria(i8* %0)
%6 = call i32 @strcpy(i8* %4, i32 %5)
%7 = call i32 @SubjectModel_modifySubject(i8* %0, i8* %4, i8* %1)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcmp_null(const char *s1, const char *s2) {
  if (!s1 || !s2) {
    return (!!s1) - (!!s2);
  }
  return strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<strcmp_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <strcmp_null+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1165 <strcmp_null+0x55>
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmpq   $0x0,-0x18(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <strcmp_null+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_null>:
test   %rdi,%rdi
je     111f <strcmp_null+0xf>
test   %rsi,%rsi
je     111f <strcmp_null+0xf>
jmp    1030 <strcmp@plt>
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
cmp    $0x1,%rsi
adc    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @strcmp_null(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %23, label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
%14 = xor i1 %13, true
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
%17 = load i8*, i8** %5
%18 = icmp ne i8* %17, null
%19 = xor i1 %18, true
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = sub nsw i32 %16, %21
store i32 %22, i32* %3
br label %27
23: ; preds = %8
%24 = load i8*, i8** %4
%25 = load i8*, i8** %5
%26 = call i32 @strcmp(i8* %24, i8* %25)
store i32 %26, i32* %3
br label %27
27: ; preds = %23, %11
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @strcmp_null(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = zext i1 %3 to i32
%8 = sext i1 %4 to i32
%9 = add nsw i32 %8, %7
br label %12
10: ; preds = %2
%11 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %11, %10 ], [ %9, %6 ]
ret i32 %13
}
int test(void) { return (0); }


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

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

LLVM IR (-O0):
define i32 @test() {
ret i32 0
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
unsigned xrop3_204_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  return (S & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_204_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_204_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load i32, i32* %6
%15 = xor i32 %14, -1
%16 = and i32 %13, %15
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = and i32 %17, %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @xrop3_204_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
void alarminit(void) {}


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

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

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

LLVM IR (-O2):
define void @alarminit() {
ret void
}
/* Variables and functions */
size_t ho_strlen1(const char *s) {
  const char *sc;
  for (sc = s; *sc != '\0'; ++sc)
    ;
  return (sc - s);
}


x86 assembly (clang, -O0):
<ho_strlen1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <ho_strlen1+0x36>
jmp    1125 <ho_strlen1+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ho_strlen1+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_strlen1>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ho_strlen1+0x10>
ret

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

LLVM IR (-O2):
define i64 @ho_strlen1(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Type definitions */
struct rq_asset_irfuture {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rq_asset_irfuture_free(struct rq_asset_irfuture *);
void rq_asset_irfuture_freefunc(void *asset_data) {
  rq_asset_irfuture_free((struct rq_asset_irfuture *)asset_data);
}


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

x86 assembly (clang, -O2):
<rq_asset_irfuture_freefunc>:
jmp    1030 <rq_asset_irfuture_free@plt>

LLVM IR (-O0):
%struct.rq_asset_irfuture = type { i32 }
define void @rq_asset_irfuture_freefunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.rq_asset_irfuture*
%5 = call i32 @rq_asset_irfuture_free(%struct.rq_asset_irfuture* %4)
ret void
}

LLVM IR (-O2):
%struct.rq_asset_irfuture = type { i32 }
define void @rq_asset_irfuture_freefunc(i8* %0) {
%2 = bitcast i8* %0 to %struct.rq_asset_irfuture*
%3 = tail call i32 @rq_asset_irfuture_free(%struct.rq_asset_irfuture* %2)
ret void
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ omp_set_num_threads(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  omp_set_num_threads(2);
#pragma omp parallel
  {
#pragma omp critical
    { printf("hello from thread %d\n", omp_get_thread_num()); }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1050 <omp_set_num_threads@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1050 <omp_set_num_threads@plt>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"hello from thread %d\0A\00"
define i32 @main() {
%1 = call i32 @omp_set_num_threads(i32 2)
%2 = call i32 (...) @omp_get_thread_num()
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"hello from thread %d\0A\00"
define i32 @main() {
%1 = tail call i32 @omp_set_num_threads(i32 2)
%2 = tail call i32 (...) @omp_get_thread_num()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
void _Locale_time_destroy(void *__DUMMY_PAR) {}


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

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

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

LLVM IR (-O2):
define void @_Locale_time_destroy(i8* nocapture %0) {
ret void
}