xunge/DecIR huggingface dataset:
int test_imm_C5uint16_mem(unsigned short *val) {
  return ((*val) & (-0xC5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C5uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -197
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int /*<<< orphan*/ sleep1(int);
int main() {
  sleep1(3);
  pause();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep1(i32 3)
%2 = tail call i32 (...) @pause()
ret i32 0
}
int char_type(char c) {
  switch (c) {
  case 44:
  case 32:
  case 58:
  case 47:
    return 0;
  case 34:
    return 1;
  case 127:
    return 2;
  case 13:
    return 3;
  }
  return 4;
}


x86 assembly (clang, -O0):
<char_type>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xd,%eax
je     11a9 <char_type+0xa9>
jmp    111f <char_type+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1185 <char_type+0x85>
jmp    1130 <char_type+0x30>
mov    -0xc(%rbp),%eax
sub    $0x22,%eax
je     1191 <char_type+0x91>
jmp    1141 <char_type+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2c,%eax
je     1185 <char_type+0x85>
jmp    1152 <char_type+0x52>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1185 <char_type+0x85>
jmp    1163 <char_type+0x63>
mov    -0xc(%rbp),%eax
sub    $0x3a,%eax
je     1185 <char_type+0x85>
jmp    1174 <char_type+0x74>
mov    -0xc(%rbp),%eax
sub    $0x7f,%eax
je     119d <char_type+0x9d>
jmp    11b5 <char_type+0xb5>
movl   $0x0,-0x4(%rbp)
jmp    11bc <char_type+0xbc>
movl   $0x1,-0x4(%rbp)
jmp    11bc <char_type+0xbc>
movl   $0x2,-0x4(%rbp)
jmp    11bc <char_type+0xbc>
movl   $0x3,-0x4(%rbp)
jmp    11bc <char_type+0xbc>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_type>:
cmp    $0x3a,%edi
ja     112c <char_type+0x2c>
xor    %eax,%eax
mov    %edi,%ecx
movabs $0x400900100000000,%rdx
bt     %rcx,%rdx
jae    111a <char_type+0x1a>
ret
cmp    $0xd,%rcx
je     113d <char_type+0x3d>
cmp    $0x22,%rcx
jne    112c <char_type+0x2c>
mov    $0x1,%eax
ret
cmp    $0x7f,%edi
jne    1137 <char_type+0x37>
mov    $0x2,%eax
ret
mov    $0x4,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @char_type(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 44, label %6
i32 32, label %6
i32 58, label %6
i32 47, label %6
i32 34, label %7
i32 127, label %8
i32 13, label %9
]
6: ; preds = %1, %1, %1, %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
store i32 2, i32* %2
br label %11
9: ; preds = %1
store i32 3, i32* %2
br label %11
10: ; preds = %1
store i32 4, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @char_type(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 44, label %7
i32 32, label %7
i32 58, label %7
i32 47, label %7
i32 34, label %3
i32 127, label %4
i32 13, label %5
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %1, %1, %6, %5, %4, %3
%8 = phi i32 [ 4, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
char *history_readline_eol(char const *, char);
char *history_readline(const char *prompt) {
  return history_readline_eol(prompt, '\0');
}


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

x86 assembly (clang, -O2):
<history_readline>:
xor    %esi,%esi
jmp    1030 <history_readline_eol@plt>

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

LLVM IR (-O2):
define i8* @history_readline(i8* %0) {
%2 = tail call i8* @history_readline_eol(i8* %0, i8 signext 0)
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
char *Strdup(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, scalar_t__, scalar_t__,
                            scalar_t__, scalar_t__);
char *response206(off_t length, off_t position) {
  char response[256];
  snprintf(response, 256,
           "HTTP/1.1 206 All Right\r\n"
           "Content-Type: */*\r\n"
           "Server: WDLS/1.0.0(Unix)\r\n"
           "Content-Length: %ld\r\n"
           "Content-Range: bytes %ld-%ld/%ld\r\n"
           "Connection: Close\r\n\r\n",
           length, position, length - 1, length);
  return Strdup(response);
}


x86 assembly (clang, -O0):
<response206>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x8(%rbp),%r9
sub    $0x1,%r9
mov    -0x8(%rbp),%rax
mov    $0x100,%esi
lea    0xea6(%rip),%rdx
mov    %rax,(%rsp)
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <Strdup@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<response206>:
push   %rbx
sub    $0x110,%rsp
mov    %rsi,%r8
mov    %rdi,%rcx
lea    -0x1(%rdi),%r9
mov    %rdi,(%rsp)
lea    0xec3(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <Strdup@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [146 x i8] c"HTTP/1.1 206 All Right\0D\0AContent-Type: */*\0D\0AServer: WDLS/1.0.0(Unix)\0D\0AContent-Length: %ld\0D\0AContent-Range: bytes %ld-%ld/%ld\0D\0AConnection: Close\0D\0A\0D\0A\00"
define i8* @response206(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca [256 x i8]
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = sub nsw i64 %9, 1
%11 = load i64, i64* %3
%12 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %8, i64 %10, i64 %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%14 = call i8* @Strdup(i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [146 x i8] c"HTTP/1.1 206 All Right\0D\0AContent-Type: */*\0D\0AServer: WDLS/1.0.0(Unix)\0D\0AContent-Length: %ld\0D\0AContent-Range: bytes %ld-%ld/%ld\0D\0AConnection: Close\0D\0A\0D\0A\00"
define i8* @response206(i64 %0, i64 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = add nsw i64 %0, -1
%6 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i64 %5, i64 %0)
%7 = call i8* @Strdup(i8* %4)
ret i8* %7
}
void BSP_PWC_SetTimer4WakeSrc(void) { return; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @touchbuttonsInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ters_ucgen_ciz(int);
int /*<<< orphan*/ ucgen_ciz(int);
int main() {
  ucgen_ciz(4);
  ters_ucgen_ciz(3);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ucgen_ciz(i32 4)
%2 = tail call i32 @ters_ucgen_ciz(i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lr_output_message(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
ConvertIntegerToString() {
  char String[500];
  int integerVariable = 1234567;
  sprintf(String, "%d", integerVariable);
  lr_output_message("New string is [%s]", String);
  return 0;
}


x86 assembly (clang, -O0):
<ConvertIntegerToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x12d687,-0x204(%rbp)
lea    -0x200(%rbp),%rdi
mov    -0x204(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x200(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <lr_output_message@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertIntegerToString>:
push   %rbx
sub    $0x200,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x12d687,%edx
call   1040 <sprintf@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <lr_output_message@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [19 x i8] c"New string is [%s]\00"
define i32 @ConvertIntegerToString() {
%1 = alloca [500 x i8]
%2 = alloca i32
store i32 1234567, i32* %2
%3 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* %2
%5 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%7 = call i32 @lr_output_message(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [19 x i8] c"New string is [%s]\00"
define i32 @ConvertIntegerToString() {
%1 = alloca [500 x i8]
%2 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1234567)
%4 = call i32 @lr_output_message(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x47() {
  Assert_real((isdigit(71) == 0),
              "/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_isdigit.c",
              360, ("isdigit should be 0 for G"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x47>:
push   %rbp
mov    %rsp,%rbp
mov    $0x47,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x168,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x47>:
push   %rax
mov    $0x47,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x168,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for G\00"
define void @t_isdigit_0x47() {
%1 = call i64 @isdigit(i32 71)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for G\00"
define void @t_isdigit_0x47() {
%1 = tail call i64 @isdigit(i32 71)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void LCDIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000064))) = ui32IntFlags;
}


x86 assembly (clang, -O0):
<LCDIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x64(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIntDisable>:
mov    %rsi,0x64(%rdi)
ret

LLVM IR (-O0):
define void @LCDIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 100
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @LCDIntDisable(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 100
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
void gpx_rd_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @gpx_rd_deinit() {
ret void
}
void module_dummy_loadargs(const char *args) {
  (void)args;
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<module_dummy_loadargs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <module_dummy_loadargs+0xd>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @module_dummy_loadargs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
br label %4
4: ; preds = %1
br label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @module_dummy_loadargs(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint_least16_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t endian_16hi8(uint_least16_t word) { return (uint8_t)(word >> 8); }


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

x86 assembly (clang, -O2):
<endian_16hi8>:
mov    %edi,%eax
sar    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @endian_16hi8(i32 %0) {
%2 = ashr i32 %0, 8
ret i32 %2
}
void *mk_tile_ptr(int x, int y) { return (void *)(((long)x << 32) | y); }


x86 assembly (clang, -O0):
<mk_tile_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x20,%rax
movslq -0x8(%rbp),%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_tile_ptr>:
shl    $0x20,%rdi
movslq %esi,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i8* @mk_tile_ptr(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 = sext i32 %5 to i64
%7 = shl i64 %6, 32
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = or i64 %7, %9
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @mk_tile_ptr(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = shl nuw i64 %3, 32
%5 = sext i32 %1 to i64
%6 = or i64 %4, %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
void ARGBUnattenuateRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBUnattenuateRow_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroy_wpa_psk(char *psk) { free(psk); }


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

x86 assembly (clang, -O2):
<destroy_wpa_psk>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_wpa_psk(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
_Noreturn void abort(void) {
  puts("abort: not implemented");
  exit(1);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [23 x i8] c"abort: not implemented\00"
define void @abort() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"abort: not implemented\00"
define void @abort() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
tail call void @exit(i32 1)
unreachable
}
void rop3_26_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S & T;
  stk2 = *D | stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_26_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_26_0_0>:
and    %edx,%esi
or     (%rdi),%sil
xor    %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_26_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = load i8*, i8** %4
store i8 %29, i8* %30
ret void
}

LLVM IR (-O2):
define void @rop3_26_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %6, %2
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int a20_test(int);
int a20_test_long(void) { return a20_test(2097152); }


x86 assembly (clang, -O0):
<a20_test_long>:
push   %rbp
mov    %rsp,%rbp
mov    $0x200000,%edi
call   1030 <a20_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a20_test_long>:
mov    $0x200000,%edi
jmp    1030 <a20_test@plt>

LLVM IR (-O0):
define i32 @a20_test_long() {
%1 = call i32 @a20_test(i32 2097152)
ret i32 %1
}

LLVM IR (-O2):
define i32 @a20_test_long() {
%1 = tail call i32 @a20_test(i32 2097152)
ret i32 %1
}
void outl(unsigned int value, unsigned short int port) {
  __asm__ __volatile__("outl %0,%w1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outl(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
ret void
}
int main(void) {
  int x = {{0, 1}};
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%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
store i32 0, i32* %2
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
size_t hash_node_bin(size_t bins, size_t keyhash) {
  return keyhash & (bins - 1);
}


x86 assembly (clang, -O0):
<hash_node_bin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_node_bin>:
lea    -0x1(%rdi),%rax
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @hash_node_bin(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub i64 %6, 1
%8 = and i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @hash_node_bin(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = and i64 %3, %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ RunAllTests();
int /*<<< orphan*/ setup();
int main(void) {
  setup();
  RunAllTests();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup()
%2 = tail call i32 (...) @RunAllTests()
ret i32 0
}
void I2CSlaveIntClear(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000018))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntClear>:
movq   $0x1,0x18(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 24
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntClear(i64 %0) {
%2 = add i64 %0, 24
%3 = inttoptr i64 %2 to i64*
store volatile i64 1, i64* %3
ret void
}
int test_imm_28uint8_reg(unsigned char val) {
  return ((val) & (0x28 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_28uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 40
%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_28uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 40
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct file_operations {
  int dummy;
};

/* Variables and functions */
int __register_chrdev(unsigned int, int /*<<< orphan*/, int, char const *,
                      struct file_operations const *);
__attribute__((always_)) int
register_chrdev(unsigned int major, const char *name,
                const struct file_operations *fops) {
  return __register_chrdev(major, 0, 256, name, fops);
}


x86 assembly (clang, -O0):
<register_chrdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <__register_chrdev@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_chrdev>:
mov    %rdx,%r8
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0x100,%edx
jmp    1030 <__register_chrdev@plt>

LLVM IR (-O0):
%struct.file_operations = type { i32 }
define i32 @register_chrdev(i32 %0, i8* %1, %struct.file_operations* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.file_operations*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.file_operations* %2, %struct.file_operations** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load %struct.file_operations*, %struct.file_operations** %6
%10 = call i32 @__register_chrdev(i32 %7, i32 0, i32 256, i8* %8, %struct.file_operations* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.file_operations = type { i32 }
define i32 @register_chrdev(i32 %0, i8* %1, %struct.file_operations* %2) {
%4 = tail call i32 @__register_chrdev(i32 %0, i32 0, i32 256, i8* %1, %struct.file_operations* %2)
ret i32 %4
}
__attribute__((__constructor__)) void w5100_socket_init(void) {}


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @w5100_socket_init, i8* null }]
define void @w5100_socket_init() {
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @w5100_socket_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sockShutdown();
void atcmdPQ(void) {
  sockShutdown();
  exit(0);
}


x86 assembly (clang, -O0):
<atcmdPQ>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sockShutdown@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<atcmdPQ>:
push   %rax
xor    %eax,%eax
call   1030 <sockShutdown@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @atcmdPQ() {
%1 = call i32 (...) @sockShutdown()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @atcmdPQ() {
%1 = tail call i32 (...) @sockShutdown()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int rho_ruby_is_hash(unsigned long val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rho_ruby_is_hash(i64 %0) {
ret i32 0
}
/* Variables and functions */
double ephAngleRed(double);
double ephHourAngle(double theta0, double lon, double alpha) {
  return ephAngleRed(theta0 - lon - alpha);
}


x86 assembly (clang, -O0):
<ephHourAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <ephAngleRed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ephHourAngle>:
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
jmp    1030 <ephAngleRed@plt>

LLVM IR (-O0):
define double @ephHourAngle(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = fsub double %9, %10
%12 = call double @ephAngleRed(double %11)
ret double %12
}

LLVM IR (-O2):
define double @ephHourAngle(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fsub double %4, %2
%6 = tail call double @ephAngleRed(double %5)
ret double %6
}
int test_imm_63int8_reg(signed char val) {
  return ((val) & (0x63 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_63int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 99
%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_63int8_reg(i8 signext %0) {
%2 = and i8 %0, 99
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int);
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void clr_vars(int fd) {
  if (ioctl(fd, _IO('q', 1)) == -1)
    perror("query_apps ioclt clr");
}


x86 assembly (clang, -O0):
<clr_vars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x71,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    116f <clr_vars+0x3f>
lea    0xe96(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_vars>:
push   %rbx
mov    %edi,%ebx
mov    $0x71,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
je     1152 <clr_vars+0x22>
pop    %rbx
ret
lea    0xea7(%rip),%rdi
pop    %rbx
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"query_apps ioclt clr\00"
define void @clr_vars(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 signext 113, i32 1)
%5 = call i32 @ioctl(i32 %3, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"query_apps ioclt clr\00"
define void @clr_vars(i32 %0) {
%2 = tail call i32 @_IO(i8 signext 113, i32 1)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
void alarm(int signum) { return; }


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

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

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

LLVM IR (-O2):
define void @alarm(i32 %0) {
ret void
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
size_t INT_MAX;
int syscall(int, int, struct dirent *, size_t);
int getdents(int fd, struct dirent *buf, size_t len) {
  if (len > INT_MAX)
    len = INT_MAX;
  return syscall(141, fd, buf, len);
}


x86 assembly (clang, -O0):
<getdents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2eba(%rip),%rcx
cmp    (%rcx),%rax
jbe    1145 <getdents+0x35>
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x8d,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdents>:
mov    %rsi,%rax
mov    %edi,%esi
mov    0x2ecc(%rip),%rcx
mov    (%rcx),%rcx
cmp    %rdx,%rcx
cmovae %rdx,%rcx
mov    $0x8d,%edi
mov    %rax,%rdx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
@INT_MAX = global i64 0
define i32 @getdents(i32 %0, %struct.dirent* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.dirent*
%6 = alloca i64
store i32 %0, i32* %4
store %struct.dirent* %1, %struct.dirent** %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* @INT_MAX
%9 = icmp ugt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* @INT_MAX
store i64 %11, i64* %6
br label %12
12: ; preds = %10, %3
%13 = load i32, i32* %4
%14 = load %struct.dirent*, %struct.dirent** %5
%15 = load i64, i64* %6
%16 = call i32 @syscall(i32 141, i32 %13, %struct.dirent* %14, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@INT_MAX = global i64 0
define i32 @getdents(i32 %0, %struct.dirent* %1, i64 %2) {
%4 = load i64, i64* @INT_MAX
%5 = icmp ult i64 %4, %2
%6 = select i1 %5, i64 %4, i64 %2
%7 = tail call i32 @syscall(i32 141, i32 %0, %struct.dirent* %1, i64 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ euclid_pythagorean_triple(int, int, long *, long *, long *);
long get_leg(int m, int n) {
  long sides[3];
  if (!euclid_pythagorean_triple(m, n, sides, sides + 1, sides + 2))
    return 0;
  return sides[2];
}


x86 assembly (clang, -O0):
<get_leg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
lea    -0x30(%rbp),%rdx
lea    -0x30(%rbp),%rcx
add    $0x8,%rcx
lea    -0x30(%rbp),%r8
add    $0x10,%r8
call   1030 <euclid_pythagorean_triple@plt>
cmp    $0x0,%eax
jne    1153 <get_leg+0x43>
movq   $0x0,-0x8(%rbp)
jmp    115b <get_leg+0x4b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_leg>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    %rsp,%rdx
call   1030 <euclid_pythagorean_triple@plt>
test   %eax,%eax
je     1134 <get_leg+0x24>
mov    0x10(%rsp),%rax
add    $0x18,%rsp
ret
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i64 @get_leg(i32 %0, i32 %1) {
%3 = alloca [3 x i64]
%4 = bitcast [3 x i64]* %3 to i8*
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 0
%6 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 1
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 2
%8 = call i32 @euclid_pythagorean_triple(i32 %0, i32 %1, i64* %5, i64* %6, i64* %7)
%9 = icmp eq i32 %8, 0
%10 = load i64, i64* %7
%11 = select i1 %9, i64 0, i64 %10
ret i64 %11
}
unsigned long SIO1readBaud32(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1readBaud32() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1readBaud32() {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ DH;

/* Variables and functions */
int /*<<< orphan*/ DH_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *DH_new();
int /*<<< orphan*/ int_dh_param_copy(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int);
DH *DHparams_dup(DH *dh) {
  DH *ret;
  ret = DH_new();
  if (!ret)
    return NULL;
  if (!int_dh_param_copy(ret, dh, -1)) {
    DH_free(ret);
    return NULL;
  }
  return ret;
}


x86 assembly (clang, -O0):
<DHparams_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <DH_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115f <DHparams_dup+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1198 <DHparams_dup+0x68>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edx
call   1040 <int_dh_param_copy@plt>
cmp    $0x0,%eax
jne    1190 <DHparams_dup+0x60>
mov    -0x18(%rbp),%rdi
call   1050 <DH_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1198 <DHparams_dup+0x68>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DHparams_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <DH_new@plt>
test   %rax,%rax
je     1162 <DHparams_dup+0x32>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0xffffffff,%edx
call   1040 <int_dh_param_copy@plt>
test   %eax,%eax
jne    1164 <DHparams_dup+0x34>
mov    %rbx,%rdi
call   1050 <DH_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @DHparams_dup(i32* %0) {
%2 = tail call i32* (...) @DH_new()
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @int_dh_param_copy(i32* %2, i32* %0, i32 -1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @DH_free(i32* %2)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32* [ null, %7 ], [ null, %1 ], [ %2, %4 ]
ret i32* %10
}
/* Variables and functions */
char *_pico_strlwr(char *str) {
  char *cp;
  for (cp = str; *cp; ++cp) {
    if ('A' <= *cp && *cp <= 'Z') {
      *cp += ('a' - 'A');
    }
  }
  return str;
}


x86 assembly (clang, -O0):
<_pico_strlwr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <_pico_strlwr+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     114d <_pico_strlwr+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114d <_pico_strlwr+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
jmp    1152 <_pico_strlwr+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_pico_strlwr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pico_strlwr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <_pico_strlwr+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <_pico_strlwr+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <_pico_strlwr+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <_pico_strlwr+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <_pico_strlwr+0x10>
ret

LLVM IR (-O0):
define i8* @_pico_strlwr(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 = %26, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %29
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 65, %12
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 32
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
br label %25
25: ; preds = %19, %14, %9
br label %26
26: ; preds = %25
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
%30 = load i8*, i8** %2
ret i8* %30
}

LLVM IR (-O2):
define i8* @_pico_strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
void cnl(int pn) { brc(pn, 'E'); }


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

x86 assembly (clang, -O2):
<cnl>:
mov    $0x45,%esi
jmp    1030 <brc@plt>

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

LLVM IR (-O2):
define void @cnl(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 69)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cRosOutStreamGet();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void printNSpaces(int n_spaces) {
  int spc_ind;
  for (spc_ind = 0; spc_ind < n_spaces; spc_ind++)
    fprintf(cRosOutStreamGet(), " ");
}


x86 assembly (clang, -O0):
<printNSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1161 <printNSpaces+0x41>
mov    $0x0,%al
call   1030 <cRosOutStreamGet@plt>
mov    %eax,%edi
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <printNSpaces+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNSpaces>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1156 <printNSpaces+0x36>
mov    %edi,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <cRosOutStreamGet@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
add    $0xffffffff,%ebx
jne    1140 <printNSpaces+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @printNSpaces(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = call i32 (...) @cRosOutStreamGet()
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @printNSpaces(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @cRosOutStreamGet()
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
int fun315() { return 315; }


x86 assembly (clang, -O0):
<fun315>:
push   %rbp
mov    %rsp,%rbp
mov    $0x13b,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun315() {
ret i32 315
}

LLVM IR (-O2):
define i32 @fun315() {
ret i32 315
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ExportedFunction() { printf("This function is exported\n"); }


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"This function is exported\00"
define void @ExportedFunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}