xunge/DecIR huggingface dataset:
int board_is_valid_size(const int board_size) {
  if (board_size == 3 || board_size == 6 || board_size == 12) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<board_is_valid_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1125 <board_is_valid_size+0x25>
cmpl   $0x6,-0x8(%rbp)
je     1125 <board_is_valid_size+0x25>
cmpl   $0xc,-0x8(%rbp)
jne    1131 <board_is_valid_size+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <board_is_valid_size+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_is_valid_size>:
cmp    $0xc,%edi
ja     1115 <board_is_valid_size+0x15>
mov    $0x1,%eax
mov    $0x1048,%ecx
bt     %edi,%ecx
jae    1115 <board_is_valid_size+0x15>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @board_is_valid_size(i32 %0) {
switch i32 %0, label %2 [
i32 12, label %3
i32 6, label %3
i32 3, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ charrep(char, int);
int /*<<< orphan*/ printf(char *);
void display_wakeup_header(void) {
  charrep('-', 44);
  printf("\n");
  printf("| Wakeup |  #  |       Name      |  Count  |\n");
}


x86 assembly (clang, -O0):
<display_wakeup_header>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
mov    $0x2c,%esi
call   1040 <charrep@plt>
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_wakeup_header>:
push   %rax
mov    $0x2d,%edi
mov    $0x2c,%esi
call   1050 <charrep@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeaf(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [46 x i8] c"| Wakeup | # | Name | Count |\0A\00"
define void @display_wakeup_header() {
%1 = call i32 @charrep(i8 signext 45, i32 44)
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"| Wakeup | # | Name | Count |\00"
define void @display_wakeup_header() {
%1 = tail call i32 @charrep(i8 signext 45, i32 44)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintMsg(char *, char *);
char *ReplaceExtension(char const *, char *);
int /*<<< orphan*/ UtilFree(char *);
scalar_t__ remove(char *);
void DeleteGwaFile(const char *base_wad_name) {
  char *gwa_file = ReplaceExtension(base_wad_name, "gwa");
  if (remove(gwa_file) == 0)
    PrintMsg("Deleted GWA file: %s\n", gwa_file);
  UtilFree(gwa_file);
}


x86 assembly (clang, -O0):
<DeleteGwaFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <ReplaceExtension@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
jne    1183 <DeleteGwaFile+0x43>
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <PrintMsg@plt>
mov    -0x10(%rbp),%rdi
call   1050 <UtilFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeleteGwaFile>:
push   %rbx
lea    0xeb8(%rip),%rsi
call   1060 <ReplaceExtension@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <remove@plt>
test   %rax,%rax
jne    116c <DeleteGwaFile+0x2c>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <PrintMsg@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <UtilFree@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"gwa\00"
@.str.1 = [22 x i8] c"Deleted GWA file: %s\0A\00"
define void @DeleteGwaFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @ReplaceExtension(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @remove(i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @PrintMsg(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %3
%14 = call i32 @UtilFree(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"gwa\00"
@.str.1 = [22 x i8] c"Deleted GWA file: %s\0A\00"
define void @DeleteGwaFile(i8* %0) {
%2 = tail call i8* @ReplaceExtension(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @remove(i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @PrintMsg(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @UtilFree(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fsqrts(int s, int d) {
  assem_debug("fsqrts d%d,s%d", d, s);
  output_w32(0xeeb10ac0 | ((d & 14) << 11) | ((d & 1) << 22) | ((s & 14) >> 1) |
             ((s & 1) << 5));
}


x86 assembly (clang, -O0):
<emit_fsqrts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0xe,%edi
shl    $0xb,%edi
or     $0xeeb10ac0,%edi
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x16,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0xe,%eax
sar    $0x1,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fsqrts>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%edx
call   1030 <assem_debug@plt>
mov    %ebx,%eax
and    $0xe,%eax
shl    $0xb,%eax
and    $0x1,%ebx
shl    $0x16,%ebx
mov    %ebp,%ecx
shr    %ecx
and    $0x7,%ecx
shl    $0x5,%ebp
movzbl %bpl,%edi
or     %ecx,%edi
or     %ebx,%edi
or     %eax,%edi
or     $0xeeb10ac0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fsqrts d%d,s%d\00"
define void @emit_fsqrts(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 14
%10 = shl i32 %9, 11
%11 = or i32 -290387264, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 22
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 14
%18 = ashr i32 %17, 1
%19 = or i32 %15, %18
%20 = load i32, i32* %3
%21 = and i32 %20, 1
%22 = shl i32 %21, 5
%23 = or i32 %19, %22
%24 = call i32 @output_w32(i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fsqrts d%d,s%d\00"
define void @emit_fsqrts(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 11
%5 = and i32 %4, 28672
%6 = shl i32 %1, 22
%7 = and i32 %6, 4194304
%8 = lshr i32 %0, 1
%9 = and i32 %8, 7
%10 = shl i32 %0, 5
%11 = and i32 %10, 32
%12 = or i32 %9, %11
%13 = or i32 %12, %7
%14 = or i32 %13, %5
%15 = or i32 %14, -290387264
%16 = tail call i32 @output_w32(i32 %15)
ret void
}
/* Variables and functions */
int VIM_HIF_GetReg8(int);
unsigned short VIM_JPEG_LineGetWidth(void) {
  unsigned short dWidth;
  dWidth = VIM_HIF_GetReg8((0x0C00 + 0x005));
  dWidth |= (VIM_HIF_GetReg8((0x0C00 + 0x004)) << 8);
  return dWidth;
}


x86 assembly (clang, -O0):
<VIM_JPEG_LineGetWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc05,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %ax,-0x2(%rbp)
mov    $0xc04,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %eax,%ecx
shl    $0x8,%ecx
movzwl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_LineGetWidth>:
push   %rbx
mov    $0xc05,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %eax,%ebx
mov    $0xc04,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @VIM_JPEG_LineGetWidth() {
%1 = alloca i16
%2 = call i32 @VIM_HIF_GetReg8(i32 3077)
%3 = trunc i32 %2 to i16
store i16 %3, i16* %1
%4 = call i32 @VIM_HIF_GetReg8(i32 3076)
%5 = shl i32 %4, 8
%6 = load i16, i16* %1
%7 = zext i16 %6 to i32
%8 = or i32 %7, %5
%9 = trunc i32 %8 to i16
store i16 %9, i16* %1
%10 = load i16, i16* %1
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @VIM_JPEG_LineGetWidth() {
%1 = tail call i32 @VIM_HIF_GetReg8(i32 3077)
%2 = tail call i32 @VIM_HIF_GetReg8(i32 3076)
%3 = shl i32 %2, 8
%4 = or i32 %3, %1
%5 = trunc i32 %4 to i16
ret i16 %5
}
void callEcho(int carg, void **pargs) {
  printf("%s", pargs[1]);
  printf("\n");
}


x86 assembly (clang, -O0):
<callEcho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callEcho>:
push   %rax
mov    0x8(%rsi),%rsi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @callEcho(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void shell() { system("/bin/sh"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define void @shell() {
%1 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define void @shell() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x45() {
  Assert_real((isxdigit(69)),
              "/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_isxdigit.c",
              350, ("isxdigit should be 1 for E"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x45>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x15e,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x45>:
push   %rax
mov    $0x45,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x15e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for E\00"
define void @t_isxdigit_0x45() {
%1 = call i32 @isxdigit(i32 69)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for E\00"
define void @t_isxdigit_0x45() {
%1 = tail call i32 @isxdigit(i32 69)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int sdr_bladerf_file_flush(void *dev) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sdr_bladerf_file_flush(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ array();
void main() { array(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @array()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEC8(int /*<<< orphan*/);
int /*<<< orphan*/ SA1Direct(int);
void OpC6M1(void) { DEC8(SA1Direct(3)); }


x86 assembly (clang, -O0):
<OpC6M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
call   1040 <DEC8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpC6M1>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <DEC8@plt>

LLVM IR (-O0):
define void @OpC6M1() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @DEC8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpC6M1() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @DEC8(i32 %1)
ret void
}
ret() {
  while (1)
    return 2;
}


x86 assembly (clang, -O0):
<ret>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <ret+0x9>
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ret() {
br label %1
1: ; preds = %0
ret i32 2
}

LLVM IR (-O2):
define i32 @ret() {
ret i32 2
}
int test_imm_33int64_highword_reg(long long val) {
  return ((val >> 32) & (0x33 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_33int64_highword_reg>:
movabs $0x3300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_33int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 51
%6 = icmp ne i64 %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_33int64_highword_reg(i64 %0) {
%2 = and i64 %0, 219043332096
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct _mgmt_tempadd_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _mgmt_tempadd_req *);
void mgmt_tempadd_req_free(struct _mgmt_tempadd_req *ptr) { osapi_free(ptr); }


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

x86 assembly (clang, -O2):
<mgmt_tempadd_req_free>:
jmp    1030 <osapi_free@plt>

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

LLVM IR (-O2):
%struct._mgmt_tempadd_req = type { i32 }
define void @mgmt_tempadd_req_free(%struct._mgmt_tempadd_req* %0) {
%2 = tail call i32 @osapi_free(%struct._mgmt_tempadd_req* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fish001();
int /*<<< orphan*/ Fish002();
int /*<<< orphan*/ Fish003();
int /*<<< orphan*/ Fish004();
int /*<<< orphan*/ Fish005();
int /*<<< orphan*/ Fish006();
int /*<<< orphan*/ Fish007();
int /*<<< orphan*/ Fish008();
int /*<<< orphan*/ Fish009();
void Fish_7(void) {
  Fish009();
  Fish001();
  Fish007();
  Fish005();
  Fish002();
  Fish008();
  Fish003();
  Fish004();
  Fish006();
}


x86 assembly (clang, -O0):
<Fish_7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <Fish009@plt>
mov    $0x0,%al
call   1050 <Fish001@plt>
mov    $0x0,%al
call   1060 <Fish007@plt>
mov    $0x0,%al
call   1030 <Fish005@plt>
mov    $0x0,%al
call   1080 <Fish002@plt>
mov    $0x0,%al
call   10b0 <Fish008@plt>
mov    $0x0,%al
call   1040 <Fish003@plt>
mov    $0x0,%al
call   10a0 <Fish004@plt>
mov    $0x0,%al
call   1090 <Fish006@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fish_7>:
push   %rax
xor    %eax,%eax
call   1070 <Fish009@plt>
xor    %eax,%eax
call   1050 <Fish001@plt>
xor    %eax,%eax
call   1060 <Fish007@plt>
xor    %eax,%eax
call   1030 <Fish005@plt>
xor    %eax,%eax
call   1080 <Fish002@plt>
xor    %eax,%eax
call   10b0 <Fish008@plt>
xor    %eax,%eax
call   1040 <Fish003@plt>
xor    %eax,%eax
call   10a0 <Fish004@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <Fish006@plt>

LLVM IR (-O0):
define void @Fish_7() {
%1 = call i32 (...) @Fish009()
%2 = call i32 (...) @Fish001()
%3 = call i32 (...) @Fish007()
%4 = call i32 (...) @Fish005()
%5 = call i32 (...) @Fish002()
%6 = call i32 (...) @Fish008()
%7 = call i32 (...) @Fish003()
%8 = call i32 (...) @Fish004()
%9 = call i32 (...) @Fish006()
ret void
}

LLVM IR (-O2):
define void @Fish_7() {
%1 = tail call i32 (...) @Fish009()
%2 = tail call i32 (...) @Fish001()
%3 = tail call i32 (...) @Fish007()
%4 = tail call i32 (...) @Fish005()
%5 = tail call i32 (...) @Fish002()
%6 = tail call i32 (...) @Fish008()
%7 = tail call i32 (...) @Fish003()
%8 = tail call i32 (...) @Fish004()
%9 = tail call i32 (...) @Fish006()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char getchar();
int /*<<< orphan*/ stderr;
bool ok2overwrite(void) {
  fprintf(stderr, "file exist, over-write it? [y|n]\n");
  char ans = getchar();
  return ans == 'y' ? true : false;
}


x86 assembly (clang, -O0):
<ok2overwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x79,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok2overwrite>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %ecx,%ecx
cmp    $0x79,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"file exist, over-write it? [y|n]\0A\00"
define i32 @ok2overwrite() {
%1 = alloca i8
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %1
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 121
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"file exist, over-write it? [y|n]\0A\00"
define i32 @ok2overwrite() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 121
%5 = zext i1 %4 to i32
ret i32 %5
}
char *clean_device_name(char *name) {
  char *p = name;
  while (*p && *p != '\n' && *p != '\r' && *p != '\"')
    p++;
  *p = '\0';
  return name;
}


x86 assembly (clang, -O0):
<clean_device_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     115f <clean_device_name+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     115f <clean_device_name+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x11(%rbp)
je     115f <clean_device_name+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <clean_device_name+0x6f>
jmp    1180 <clean_device_name+0x80>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <clean_device_name+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_device_name>:
mov    %rdi,%rax
movabs $0x400002401,%rdx
mov    %rdi,%rcx
jmp    1124 <clean_device_name+0x24>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rcx
movzbl (%rcx),%esi
cmp    $0x22,%rsi
ja     1120 <clean_device_name+0x20>
bt     %rsi,%rdx
jae    1120 <clean_device_name+0x20>
movb   $0x0,(%rcx)
ret

LLVM IR (-O0):
define i8* @clean_device_name(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 = %27, %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 %25
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %25
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 13
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 34
br label %25
25: ; preds = %20, %15, %10, %5
%26 = phi i1 [ false, %15 ], [ false, %10 ], [ false, %5 ], [ %24, %20 ]
br i1 %26, label %27, label %30
27: ; preds = %25
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %5
30: ; preds = %25
%31 = load i8*, i8** %3
store i8 0, i8* %31
%32 = load i8*, i8** %2
ret i8* %32
}

LLVM IR (-O2):
define i8* @clean_device_name(i8* returned %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
i8 13, label %7
i8 34, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
store i8 0, i8* %3
ret i8* %0
}
int test_imm_AFuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xAF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_AFuint64_lowword_mem>:
testb  $0xaf,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_AFuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 175
%6 = icmp ne i64 %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_AFuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 175
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exec_shl(int, int, int);
void test_shl(void) {
  int i;
  for (i = 0; i < 32; i++)
    exec_shl(0x21ad3d34, 0x12345678, i);
  for (i = 0; i < 32; i++)
    exec_shl(0x813f3421, 0x82345678, i);
}


x86 assembly (clang, -O0):
<test_shl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1149 <test_shl+0x39>
mov    -0x4(%rbp),%edx
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
call   1030 <exec_shl@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_shl+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    117a <test_shl+0x6a>
mov    -0x4(%rbp),%edx
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
call   1030 <exec_shl@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <test_shl+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_shl>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
mov    %ebx,%edx
call   1030 <exec_shl@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <test_shl+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
mov    %ebx,%edx
call   1030 <exec_shl@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <test_shl+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_shl() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @exec_shl(i32 565001524, i32 305419896, i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 0, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @exec_shl(i32 -2126564319, i32 -2110499208, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @test_shl() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @exec_shl(i32 565001524, i32 305419896, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @exec_shl(i32 -2126564319, i32 -2110499208, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
unsigned lob_bnd_size(unsigned n, unsigned m) {
  return m + 3 * n * (2 * m + 1);
}


x86 assembly (clang, -O0):
<lob_bnd_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x3,-0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
shl    $0x1,%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lob_bnd_size>:
lea    (%rsi,%rsi,1),%eax
add    $0x1,%eax
imul   %edi,%eax
lea    (%rax,%rax,2),%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @lob_bnd_size(i32 %0, i32 %1) {
%3 = mul i32 %0, 3
%4 = shl i32 %1, 1
%5 = or i32 %4, 1
%6 = mul i32 %3, %5
%7 = add i32 %6, %1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void close_file(FILE *f) {
  if (fclose(f)) {
    fprintf(stderr, "Error closing stream: %s\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<close_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     1199 <close_file+0x59>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xe7a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_file>:
push   %rbx
call   1030 <fclose@plt>
test   %rax,%rax
jne    114d <close_file+0xd>
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Error closing stream: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @close_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @fclose(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Error closing stream: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @close_file(i32* nocapture %0) {
%2 = tail call i64 @fclose(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdin;
int vfwscanf(int /*<<< orphan*/, int /*<<< orphan*/ const *,
             int /*<<< orphan*/);
int vwscanf(const wchar_t *fmt, va_list ap) { return vfwscanf(stdin, fmt, ap); }


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

x86 assembly (clang, -O2):
<vwscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfwscanf@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @vwscanf(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdin
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @vfwscanf(i32 %5, i32* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @vwscanf(i32* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @vfwscanf(i32 %3, i32* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *poi_strcat(char *src1, char *src2) {
  int srclen1 = strlen(src1), srclen2 = strlen(src2);
  char *dest;
  dest = (char *)malloc(sizeof(char) * (srclen1 + srclen2));
  strcpy(dest, src1);
  strcat(dest, src2);
  return dest;
}


x86 assembly (clang, -O0):
<poi_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poi_strcat>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %eax,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @poi_strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = mul i64 1, %15
%17 = trunc i64 %16 to i32
%18 = call i64 @malloc(i32 %17)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %7
%20 = load i8*, i8** %7
%21 = load i8*, i8** %3
%22 = call i32 @strcpy(i8* %20, i8* %21)
%23 = load i8*, i8** %7
%24 = load i8*, i8** %4
%25 = call i32 @strcat(i8* %23, i8* %24)
%26 = load i8*, i8** %7
ret i8* %26
}

LLVM IR (-O2):
define i8* @poi_strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, %3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
void d2i_PROXY_CERT_INFO_EXTENSION(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PROXY_CERT_INFO_EXTENSION() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _get_pgmptr(char **);
char const *strrchr(char *, char);
const char *_getprogname() {
  char *pgmptr = NULL;
  _get_pgmptr(&pgmptr);
  return strrchr(pgmptr, '\\') + 1;
}


x86 assembly (clang, -O0):
<_getprogname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <_get_pgmptr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getprogname>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1040 <_get_pgmptr@plt>
mov    (%rsp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @_getprogname() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i32 @_get_pgmptr(i8** %1)
%3 = load i8*, i8** %1
%4 = call i8* @strrchr(i8* %3, i8 signext 92)
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}

LLVM IR (-O2):
define i8* @_getprogname() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = call i32 @_get_pgmptr(i8** %1)
%4 = load i8*, i8** %1
%5 = call i8* @strrchr(i8* dereferenceable(1) %4, i8 signext 92)
%6 = getelementptr inbounds i8, i8* %5, i64 1
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void sayHello() { printf("hello %s", "C"); }


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

x86 assembly (clang, -O2):
<sayHello>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"hello %s\00"
@.str.1 = [2 x i8] c"C\00"
define void @sayHello() {
%1 = call i32 @printf(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))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"hello %s\00"
@.str.1 = [2 x i8] c"C\00"
define void @sayHello() {
%1 = tail call i32 @printf(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))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void udp_set_srcport(uint8_t *p_udp, uint16_t port) {
  p_udp[0] = (port & 0xff00) >> 8;
  p_udp[1] = (port & 0xff);
}


x86 assembly (clang, -O0):
<udp_set_srcport>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_set_srcport>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @udp_set_srcport(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 65280
%7 = ashr i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @udp_set_srcport(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
void McASPRxSerActivate(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x80)))) = 0xFFFF;
  (*((volatile unsigned int *)(baseAddr + (0x44)))) |= (0x00000004u);
  while (((*((volatile unsigned int *)(baseAddr + (0x44)))) & (0x00000004u)) !=
         (0x00000004u))
    ;
}


x86 assembly (clang, -O0):
<McASPRxSerActivate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%eax
mov    %eax,%eax
movl   $0xffff,(%rax)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x4,%eax
cmp    $0x4,%eax
je     1141 <McASPRxSerActivate+0x41>
jmp    1126 <McASPRxSerActivate+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPRxSerActivate>:
lea    0x80(%rdi),%eax
movl   $0xffff,(%rax)
add    $0x44,%edi
orl    $0x4,(%rdi)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
testl  $0x4,(%rdi)
je     1120 <McASPRxSerActivate+0x20>
ret

LLVM IR (-O0):
define void @McASPRxSerActivate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 128
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 65535, i32* %6
%7 = load i32, i32* %2
%8 = add i32 %7, 68
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, 4
store volatile i32 %12, i32* %10
br label %13
13: ; preds = %21, %1
%14 = load i32, i32* %2
%15 = add i32 %14, 68
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = and i32 %18, 4
%20 = icmp ne i32 %19, 4
br i1 %20, label %21, label %22
21: ; preds = %13
br label %13
22: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @McASPRxSerActivate(i32 %0) {
%2 = add i32 %0, 128
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 65535, i32* %4
%5 = add i32 %0, 68
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, 4
store volatile i32 %9, i32* %7
br label %10
10: ; preds = %10, %1
%11 = load volatile i32, i32* %7
%12 = and i32 %11, 4
%13 = icmp eq i32 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
ret void
}
int sys_getsockname(tcp)
struct tcb *tcp;
{
  return sys_accept(tcp);
}


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @sys_getsockname(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @sys_accept to i32 (%struct.tcb*, ...)*)(%struct.tcb* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_getsockname(%struct.tcb* %0) {
%2 = tail call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @sys_accept to i32 (%struct.tcb*, ...)*)(%struct.tcb* %0)
ret i32 %2
}
void pathcon_nm5_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm5_decref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage:  %s [-a] [-f file] [stream|dgram] socket-name\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"usage: %s [-a] [-f file] [stream|dgram] socket-name\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 ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"usage: %s [-a] [-f file] [stream|dgram] socket-name\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ base64_cleanup();
void interface_cleanup() { base64_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @interface_cleanup() {
%1 = tail call i32 (...) @base64_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ end_test_skip_file_and_function();
int /*<<< orphan*/ skip1_test_skip_file_and_function();
int /*<<< orphan*/ test_skip();
void test_skip_file_and_function(void) {
  test_skip();
  skip1_test_skip_file_and_function();
  end_test_skip_file_and_function();
}


x86 assembly (clang, -O0):
<test_skip_file_and_function>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_skip@plt>
mov    $0x0,%al
call   1030 <skip1_test_skip_file_and_function@plt>
mov    $0x0,%al
call   1040 <end_test_skip_file_and_function@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_skip_file_and_function>:
push   %rax
xor    %eax,%eax
call   1050 <test_skip@plt>
xor    %eax,%eax
call   1030 <skip1_test_skip_file_and_function@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <end_test_skip_file_and_function@plt>

LLVM IR (-O0):
define void @test_skip_file_and_function() {
%1 = call i32 (...) @test_skip()
%2 = call i32 (...) @skip1_test_skip_file_and_function()
%3 = call i32 (...) @end_test_skip_file_and_function()
ret void
}

LLVM IR (-O2):
define void @test_skip_file_and_function() {
%1 = tail call i32 (...) @test_skip()
%2 = tail call i32 (...) @skip1_test_skip_file_and_function()
%3 = tail call i32 (...) @end_test_skip_file_and_function()
ret void
}
unsigned int registerIRQ(unsigned int irq_number) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @registerIRQ(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int /*<<< orphan*/ uint32_t;
struct timeval {
  unsigned long long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
extern uint32_t oosmos_GetFreeRunningUS(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  const uint64_t US = tv.tv_sec * 1000000ULL + tv.tv_usec;
  return (uint32_t)US;
}


x86 assembly (clang, -O0):
<oosmos_GetFreeRunningUS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oosmos_GetFreeRunningUS>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%eax
add    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @oosmos_GetFreeRunningUS() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @oosmos_GetFreeRunningUS() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}