xunge/DecIR huggingface dataset:
/* Variables and functions */
int dup2(int, int);
int /*<<< orphan*/ err_sys(char *);
void Dup2(int fd1, int fd2) {
  if (dup2(fd1, fd2) == -1)
    err_sys("dup2 error");
}


x86 assembly (clang, -O0):
<Dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    114e <Dup2+0x2e>
lea    0xeb7(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dup2>:
push   %rax
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
je     112d <Dup2+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"dup2 error\00"
define void @Dup2(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
void UART_SoilMoisture_Decagon_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @UART_SoilMoisture_Decagon_RestoreConfig() {
ret void
}
int test_imm_39int16_reg(short val) {
  return ((val) & (0x39 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_39int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 57
%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_39int16_reg(i16 signext %0) {
%2 = and i16 %0, 57
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fk524m(double *, double *, double *, double *);
void fk524(double *ra, double *dec) {
  double rapm;
  double decpm;
  rapm = (double)0.0;
  decpm = (double)0.0;
  fk524m(ra, dec, &rapm, &decpm);
  return;
}


x86 assembly (clang, -O0):
<fk524>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <fk524m@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fk524>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <fk524m@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @fk524(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
%7 = load double*, double** %3
%8 = load double*, double** %4
%9 = call i32 @fk524m(double* %7, double* %8, double* %5, double* %6)
ret void
}

LLVM IR (-O2):
define void @fk524(double* %0, double* %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
%7 = call i32 @fk524m(double* %0, double* %1, double* %3, double* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memtrack_free(void *, char *, char *, int);
void _rk_tree_free(void *p) {
  memtrack_free(p, "p",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/master-g/Landlord/refs/"
                "heads/bleeding/src/ruiko_algorithm.c",
                272);
}


x86 assembly (clang, -O0):
<_rk_tree_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed4(%rip),%rdx
mov    $0x110,%ecx
call   1030 <memtrack_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rk_tree_free>:
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rdx
mov    $0x110,%ecx
jmp    1030 <memtrack_free@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"p\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/master-g/Landlord/refs/heads/bleeding/src/ruiko_algorithm.c\00"
define void @_rk_tree_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memtrack_free(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 272)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"p\00"
@.str.1 = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/master-g/Landlord/refs/heads/bleeding/src/ruiko_algorithm.c\00"
define void @_rk_tree_free(i8* %0) {
%2 = tail call i32 @memtrack_free(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.1, i64 0, i64 0), i32 272)
ret void
}
int main(void) {
  int var = 0;
  do {
    ++var;
  } while (var < 10);
  do
    ++var;
  while (var < 20);
  return var;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1112 <main+0x12>
jmp    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jl     112a <main+0x2a>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void _cleanup_free(const void *p) { free(*(char **)p); }


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

x86 assembly (clang, -O2):
<_cleanup_free>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_cleanup_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
int test_imm_08int32_reg(int val) { return ((val) & (0x08 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_08int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_08int32_reg(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("\nusage: help {CMD_NAME}\n\n"); }


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"\0Ausage: help {CMD_NAME}\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ addToDate(int /*<<< orphan*/, char, int);
time_t addToDateH(time_t ts) { return addToDate(ts, 'h', 1); }


x86 assembly (clang, -O0):
<addToDateH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x68,%esi
mov    $0x1,%edx
call   1030 <addToDate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addToDateH>:
mov    $0x68,%esi
mov    $0x1,%edx
jmp    1030 <addToDate@plt>

LLVM IR (-O0):
define i32 @addToDateH(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @addToDate(i32 %3, i8 signext 104, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @addToDateH(i32 %0) {
%2 = tail call i32 @addToDate(i32 %0, i8 signext 104, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int svc_socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/, int);
int svctcp_socket(u_long number, int reuse) {
  return svc_socket(number, SOCK_STREAM, IPPROTO_TCP, reuse);
}


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

x86 assembly (clang, -O2):
<svctcp_socket>:
mov    %esi,%ecx
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
jmp    1030 <svc_socket@plt>

LLVM IR (-O0):
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
define i32 @svctcp_socket(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @SOCK_STREAM
%7 = load i32, i32* @IPPROTO_TCP
%8 = load i32, i32* %4
%9 = call i32 @svc_socket(i32 %5, i32 %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
define i32 @svctcp_socket(i32 %0, i32 %1) {
%3 = load i32, i32* @SOCK_STREAM
%4 = load i32, i32* @IPPROTO_TCP
%5 = tail call i32 @svc_socket(i32 %0, i32 %3, i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
char UART0_GetChar();
int /*<<< orphan*/ UART0_Port_Init();
int /*<<< orphan*/ UART0_PutChar(char);
int /*<<< orphan*/ UART0_SendString(char *);
int /*<<< orphan*/ UART0_Set_BaudRate();
int /*<<< orphan*/ UART0_Set_Format();
int main() {
  char data;
  UART0_Port_Init();
  UART0_Set_BaudRate();
  UART0_Set_Format();
  UART0_SendString("\n\rHello World!\n\r");
  while (1) {
    data = UART0_GetChar();
    UART0_PutChar(data);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <UART0_Port_Init@plt>
mov    $0x0,%al
call   1060 <UART0_Set_BaudRate@plt>
mov    $0x0,%al
call   1070 <UART0_Set_Format@plt>
lea    0xe75(%rip),%rdi
call   1050 <UART0_SendString@plt>
mov    $0x0,%al
call   1080 <UART0_GetChar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <UART0_PutChar@plt>
jmp    1190 <main+0x30>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <UART0_Port_Init@plt>
xor    %eax,%eax
call   1060 <UART0_Set_BaudRate@plt>
xor    %eax,%eax
call   1070 <UART0_Set_Format@plt>
lea    0xe83(%rip),%rdi
call   1050 <UART0_SendString@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <UART0_GetChar@plt>
movsbl %al,%edi
call   1030 <UART0_PutChar@plt>
jmp    1190 <main+0x30>

LLVM IR (-O0):
@.str = [17 x i8] c"\0A\0DHello World!\0A\0D\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (...) @UART0_Port_Init()
%4 = call i32 (...) @UART0_Set_BaudRate()
%5 = call i32 (...) @UART0_Set_Format()
%6 = call i32 @UART0_SendString(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
%8 = call signext i8 (...) @UART0_GetChar()
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = call i32 @UART0_PutChar(i8 signext %9)
br label %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A\0DHello World!\0A\0D\00"
define i32 @main() {
%1 = tail call i32 (...) @UART0_Port_Init()
%2 = tail call i32 (...) @UART0_Set_BaudRate()
%3 = tail call i32 (...) @UART0_Set_Format()
%4 = tail call i32 @UART0_SendString(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %5, %0
%6 = tail call signext i8 (...) @UART0_GetChar()
%7 = tail call i32 @UART0_PutChar(i8 signext %6)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void exit2R() { error("\nRF-SRC:  The application will now exit.\n"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"\0ARF-SRC: The application will now exit.\0A\00"
define void @exit2R() {
%1 = call i32 @error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0ARF-SRC: The application will now exit.\0A\00"
define void @exit2R() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
void repeat_inportsl(int port, void *addr, int cnt) {
  __asm__ volatile("cld \n"
                   "rep insl"
                   : "=D"(addr), "=c"(cnt)
                   : "d"(port), "0"(addr), "1"(cnt)
                   : "memory", "cc");
}


x86 assembly (clang, -O0):
<repeat_inportsl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
cld
rep insl (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeat_inportsl>:
mov    %edx,%ecx
mov    %edi,%edx
mov    %rsi,%rdi
cld
rep insl (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @repeat_inportsl(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call { i8*, i32 } asm sideeffect "cld \0Arep insl", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %7, i8* %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @repeat_inportsl(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld \0Arep insl", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
double ut2jd();
double ut2mjd() { return (ut2jd() - 2400000.5); }


x86 assembly (clang, -O0):
<ut2mjd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ut2jd@plt>
movsd  0xedd(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut2mjd>:
push   %rax
xor    %eax,%eax
call   1030 <ut2jd@plt>
addsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ut2mjd() {
%1 = call double (...) @ut2jd()
%2 = fsub double %1, 0x41424F8040000000
ret double %2
}

LLVM IR (-O2):
define double @ut2mjd() {
%1 = tail call double (...) @ut2jd()
%2 = fadd double %1, 0xC1424F8040000000
ret double %2
}
/* Type definitions */
struct intf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ARPOP_REQUEST;
int /*<<< orphan*/ arp_packet_send(int, struct intf *, int /*<<< orphan*/, int);
void arp_probe(int as, struct intf *intf) {
  arp_packet_send(as, intf, ARPOP_REQUEST, 1);
}


x86 assembly (clang, -O0):
<arp_probe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%ecx
call   1030 <arp_packet_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arp_probe>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%ecx
jmp    1030 <arp_packet_send@plt>

LLVM IR (-O0):
%struct.intf = type { i32 }
@ARPOP_REQUEST = global i32 0
define void @arp_probe(i32 %0, %struct.intf* %1) {
%3 = alloca i32
%4 = alloca %struct.intf*
store i32 %0, i32* %3
store %struct.intf* %1, %struct.intf** %4
%5 = load i32, i32* %3
%6 = load %struct.intf*, %struct.intf** %4
%7 = load i32, i32* @ARPOP_REQUEST
%8 = call i32 @arp_packet_send(i32 %5, %struct.intf* %6, i32 %7, i32 1)
ret void
}

LLVM IR (-O2):
%struct.intf = type { i32 }
@ARPOP_REQUEST = global i32 0
define void @arp_probe(i32 %0, %struct.intf* %1) {
%3 = load i32, i32* @ARPOP_REQUEST
%4 = tail call i32 @arp_packet_send(i32 %0, %struct.intf* %1, i32 %3, i32 1)
ret void
}
/* Variables and functions */
int is_sorted(int *, int);
int /*<<< orphan*/ merge(int *, int /*<<< orphan*/, int *, int);
int test_A_empty() {
  int a[] = {0, 0, 0, 0};
  int b[] = {2, 4, 6, 8};
  merge(a, 0, b, 4);
  return is_sorted(a, 4);
}


x86 assembly (clang, -O0):
<test_A_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    0xeb1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
xor    %esi,%esi
mov    $0x4,%ecx
call   1050 <merge@plt>
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <is_sorted@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_A_empty>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rsp,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%ecx
call   1040 <merge@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <is_sorted@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_A_empty.b = [4 x i32] [i32 2, i32 4, i32 6, i32 8]
define i32 @test_A_empty() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @merge(i32* %5, i32 0, i32* %6, i32 4)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%9 = call i32 @is_sorted(i32* %8, i32 4)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_A_empty.b = [4 x i32] [i32 2, i32 4, i32 6, i32 8]
define i32 @test_A_empty() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @merge(i32* %5, i32 0, i32* %6, i32 4)
%8 = call i32 @is_sorted(i32* %5, i32 4)
ret i32 %8
}
void array_dummy_delete(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @array_dummy_delete(i8* nocapture %0) {
ret void
}
double foo(double x) { return ((x * 5) + 1) - (x * 5); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xeea(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mulsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 5.000000e+00, double 1.000000e+00)
%5 = load double, double* %2
%6 = fneg double %5
%7 = call double @llvm.fmuladd.f64(double %6, double 5.000000e+00, double %4)
ret double %7
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 5.000000e+00, double 1.000000e+00)
%3 = fneg double %0
%4 = tail call double @llvm.fmuladd.f64(double %3, double 5.000000e+00, double %2)
ret double %4
}
/* Variables and functions */
int pure_getopt_internal(int, char *const *, char const *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *, int);
int pure_getopt(int nargc, char *const *nargv, const char *options) {
  return pure_getopt_internal(nargc, nargv, options, NULL, NULL, 0x01);
}


x86 assembly (clang, -O0):
<pure_getopt>:
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),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x1,%r9d
mov    %r8,%rcx
call   1030 <pure_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pure_getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
jmp    1030 <pure_getopt_internal@plt>

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

LLVM IR (-O2):
define i32 @pure_getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @pure_getopt_internal(i32 %0, i8** %1, i8* %2, i32* null, i32* null, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void close_win(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @close_win() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int print_usage() {
  printf(" Usage: asp_d2mce [options]\n");
  printf(" Option:\n");
  printf(" \t[ -s <vector size> ] (default: %d)\n", 1024);
  printf(" \t[ -n <number of nodes> ] (default: %d)\n", 1);
  return 1;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x400,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c" Usage: asp_d2mce [options]\0A\00"
@.str.1 = [10 x i8] c" Option:\0A\00"
@.str.2 = [38 x i8] c" \09[ -s <vector size> ] (default: %d)\0A\00"
@.str.3 = [42 x i8] c" \09[ -n <number of nodes> ] (default: %d)\0A\00"
define i32 @print_usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 1
}

LLVM IR (-O2):
@.str.2 = [38 x i8] c" \09[ -s <vector size> ] (default: %d)\0A\00"
@.str.3 = [42 x i8] c" \09[ -n <number of nodes> ] (default: %d)\0A\00"
@str = [28 x i8] c" Usage: asp_d2mce [options]\00"
@str.4 = [9 x i8] c" Option:\00"
define i32 @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 1
}
short *fun_07(short *x, short *y, int z, int *zz) {
  *zz = ((x[1] & x[2]) == 0) + z;
  return &x[3];
}


x86 assembly (clang, -O0):
<fun_07>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x2(%rax),%eax
mov    -0x8(%rbp),%rcx
movswl 0x4(%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
add    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x6,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_07>:
movzwl 0x4(%rdi),%eax
and    0x2(%rdi),%ax
cmp    $0x1,%ax
adc    $0x0,%edx
mov    %edx,(%rcx)
lea    0x6(%rdi),%rax
ret

LLVM IR (-O0):
define i16* @fun_07(i16* %0, i16* %1, i32 %2, i32* %3) {
%5 = alloca i16*
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i32*
store i16* %0, i16** %5
store i16* %1, i16** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i16*, i16** %5
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = load i16*, i16** %5
%14 = getelementptr inbounds i16, i16* %13, i64 2
%15 = load i16, i16* %14
%16 = sext i16 %15 to i32
%17 = and i32 %12, %16
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
%22 = load i32*, i32** %8
store i32 %21, i32* %22
%23 = load i16*, i16** %5
%24 = getelementptr inbounds i16, i16* %23, i64 3
ret i16* %24
}

LLVM IR (-O2):
define i16* @fun_07(i16* %0, i16* nocapture readnone %1, i32 %2, i32* nocapture writeonly %3) {
%5 = getelementptr inbounds i16, i16* %0, i64 1
%6 = load i16, i16* %5
%7 = getelementptr inbounds i16, i16* %0, i64 2
%8 = load i16, i16* %7
%9 = and i16 %8, %6
%10 = icmp eq i16 %9, 0
%11 = zext i1 %10 to i32
%12 = add nsw i32 %11, %2
store i32 %12, i32* %3
%13 = getelementptr inbounds i16, i16* %0, i64 3
ret i16* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int validarQuantidadeDeVezes(int vezes) {
  if (vezes < 1 || vezes > 1000) {
    printf("\t\033[31mErro: A quantidade de senhas a serem geradas e "
           "invalida.\n\tA quantidade de vezes valida vai de 1 ate "
           "1000.\033[0m\n\n");
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<validarQuantidadeDeVezes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1132 <validarQuantidadeDeVezes+0x22>
cmpl   $0x3e8,-0x8(%rbp)
jle    114a <validarQuantidadeDeVezes+0x3a>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1151 <validarQuantidadeDeVezes+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validarQuantidadeDeVezes>:
add    $0xfffffc17,%edi
xor    %eax,%eax
cmp    $0xfffffc17,%edi
ja     1136 <validarQuantidadeDeVezes+0x26>
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [118 x i8] c"\09\1B[31mErro: A quantidade de senhas a serem geradas e invalida.\0A\09A quantidade de vezes valida vai de 1 ate 1000.\1B[0m\0A\0A\00"
define i32 @validarQuantidadeDeVezes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 1000
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %12
11: ; preds = %6
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@str = [117 x i8] c"\09\1B[31mErro: A quantidade de senhas a serem geradas e invalida.\0A\09A quantidade de vezes valida vai de 1 ate 1000.\1B[0m\0A\00"
define i32 @validarQuantidadeDeVezes(i32 %0) {
%2 = add i32 %0, -1001
%3 = icmp ult i32 %2, -1000
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
unsigned long TimerCapture3Get(unsigned long ulBase) {

  ;
  return (*((volatile unsigned long *)(ulBase + 0x0000003C)));
}


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

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

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

LLVM IR (-O2):
define i64 @TimerCapture3Get(i64 %0) {
%2 = add i64 %0, 60
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int Test(char *Addr) {
  Addr = malloc(sizeof(char) * 10);
  strcpy(Addr, "Bocom\n");
  printf("%s", Addr);
  return 0;
}


x86 assembly (clang, -O0):
<Test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Bocom\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @Test(i8* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t I2CSlaveDataGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000808))));
}


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

x86 assembly (clang, -O2):
<I2CSlaveDataGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x808(%rax),%rax
ret

LLVM IR (-O0):
define i64 @I2CSlaveDataGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 2056
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @I2CSlaveDataGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 2056
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int is_ip(char *address) {
  struct sockaddr_in sa;
  int result = inet_pton(AF_INET, address, &(sa.sin_addr));
  return result != 0;
}


x86 assembly (clang, -O0):
<is_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <inet_pton@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ip>:
push   %rax
mov    %rdi,%rsi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
call   1030 <inet_pton@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define i32 @is_ip(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i32, i32* @AF_INET
%6 = load i8*, i8** %2
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%8 = call i32 @inet_pton(i32 %5, i8* %6, i32* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define i32 @is_ip(i8* %0) {
%2 = alloca %struct.sockaddr_in
%3 = bitcast %struct.sockaddr_in* %2 to i8*
%4 = load i32, i32* @AF_INET
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%6 = call i32 @inet_pton(i32 %4, i8* %0, i32* %5)
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main() {
  int i;
  for (i = 1; i <= 25; i = i + 1) {
    printf("%d ", i);
    if (i % 5 == 0) {
      printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x19,-0x4(%rbp)
jg     116f <main+0x5f>
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115c <main+0x4c>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1161 <main+0x51>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xecd(%rip),%r14
jmp    1148 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x1a,%ebx
je     1178 <main+0x58>
movzbl %bl,%r15d
imul   $0xcd,%r15d,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%ebp
neg    %ebp
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %bpl,%r15b
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @main() {
br label %1
1: ; preds = %0, %9
%2 = phi i32 [ 1, %0 ], [ %10, %9 ]
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = trunc i32 %2 to i8
%5 = urem i8 %4, 5
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @putchar(i32 10)
br label %9
9: ; preds = %1, %7
%10 = add nuw nsw i32 %2, 1
%11 = icmp eq i32 %10, 26
br i1 %11, label %12, label %1
12: ; preds = %9
ret void
}
/* Type definitions */
typedef void *pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *pthread_self();
int /*<<< orphan*/ sleep(int);
void *job2(void *arg) {
  pthread_t pid = pthread_self();
  sleep(1);
  printf("job2: print %p\n", arg);
  printf("job2: pthread_self: %lu\n", pid);
  sleep(1);
  pthread_exit(NULL);
  return arg;
}


x86 assembly (clang, -O0):
<job2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x8(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<job2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %rax,%r14
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
xor    %edi,%edi
call   1040 <pthread_exit@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"job2: print %p\0A\00"
@.str.1 = [25 x i8] c"job2: pthread_self: %lu\0A\00"
define i8* @job2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* (...) @pthread_self()
store i8* %4, i8** %3
%5 = call i32 @sleep(i32 1)
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 @sleep(i32 1)
%11 = call i32 @pthread_exit(i32* null)
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"job2: print %p\0A\00"
@.str.1 = [25 x i8] c"job2: pthread_self: %lu\0A\00"
define i8* @job2(i8* returned %0) {
%2 = tail call i8* (...) @pthread_self()
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 @pthread_exit(i32* null)
ret i8* %0
}
void set_point2create(int *pc, int *face, int val) {
  int i;
  for (i = 0; i < 4; i++) {
    pc[face[i]] = val;
  }
}


x86 assembly (clang, -O0):
<set_point2create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    1144 <set_point2create+0x44>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rsi
movslq (%rcx,%rsi,4),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <set_point2create+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_point2create>:
movslq (%rsi),%rax
mov    %edx,(%rdi,%rax,4)
movslq 0x4(%rsi),%rax
mov    %edx,(%rdi,%rax,4)
movslq 0x8(%rsi),%rax
mov    %edx,(%rdi,%rax,4)
movslq 0xc(%rsi),%rax
mov    %edx,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @set_point2create(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %2, i32* %6
%7 = getelementptr inbounds i32, i32* %1, i64 1
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %2, i32* %10
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store i32 %2, i32* %14
%15 = getelementptr inbounds i32, i32* %1, i64 3
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %0, i64 %17
store i32 %2, i32* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_print(char const *);
int _configctl_error(char const *progname, int ret) {
  error_print(progname);
  return ret;
}


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

x86 assembly (clang, -O2):
<_configctl_error>:
push   %rbx
mov    %esi,%ebx
call   1030 <error_print@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_configctl_error(i8* %0, i32 returned %1) {
%3 = tail call i32 @error_print(i8* %0)
ret i32 %1
}
/* Variables and functions */
float pow10f(float);
float test3f(float x) { return pow10f(x); }


x86 assembly (clang, -O0):
<test3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <pow10f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3f>:
jmp    1030 <pow10f@plt>

LLVM IR (-O0):
define float @test3f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @pow10f(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test3f(float %0) {
%2 = tail call float @pow10f(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ WaitCo(long);
void Suspend() { (void)WaitCo(0l); }


x86 assembly (clang, -O0):
<Suspend>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <WaitCo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Suspend>:
xor    %edi,%edi
jmp    1030 <WaitCo@plt>

LLVM IR (-O0):
define void @Suspend() {
%1 = call i32 @WaitCo(i64 0)
ret void
}

LLVM IR (-O2):
define void @Suspend() {
%1 = tail call i32 @WaitCo(i64 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("cl_egl.h standalone test PASSED.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"cl_egl.h standalone test PASSED.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"cl_egl.h standalone test PASSED.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 0
}