xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
void getCoefficients(int *a, int *b, int *c) {
  printf("\nFor a polynomial of the form y = ax^2 + bx + c");
  printf("\nEnter the coefficients a, b, and c: ");
  scanf("%d %d %d", a, b, c);
  return;
}


x86 assembly (clang, -O0):
<getCoefficients>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xef7(%rip),%rdi
call   1040 <scanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCoefficients>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"\0AFor a polynomial of the form y = ax^2 + bx + c\00"
@.str.1 = [38 x i8] c"\0AEnter the coefficients a, b, and c: \00"
@.str.2 = [9 x i8] c"%d %d %d\00"
define void @getCoefficients(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %9, i32* %10, i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"\0AFor a polynomial of the form y = ax^2 + bx + c\00"
@.str.1 = [38 x i8] c"\0AEnter the coefficients a, b, and c: \00"
@.str.2 = [9 x i8] c"%d %d %d\00"
define void @getCoefficients(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %0, i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bootloader_spiflash_eraseat(int, int, int);
__attribute__((section(".boot.text"))) void
bootloader_spiflash_erase4ksector(int spidev, uint32_t sectorid) {
  bootloader_spiflash_eraseat(spidev, sectorid << 12, 0x20);
}


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

x86 assembly (clang, -O2):
<bootloader_spiflash_erase4ksector>:
shl    $0xc,%esi
mov    $0x20,%edx
jmp    1030 <bootloader_spiflash_eraseat@plt>

LLVM IR (-O0):
define void @bootloader_spiflash_erase4ksector(i32 %0, i32 %1) section ".boot.text" {
%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 = shl i32 %6, 12
%8 = call i32 @bootloader_spiflash_eraseat(i32 %5, i32 %7, i32 32)
ret void
}

LLVM IR (-O2):
define void @bootloader_spiflash_erase4ksector(i32 %0, i32 %1) section ".boot.text" {
%3 = shl i32 %1, 12
%4 = tail call i32 @bootloader_spiflash_eraseat(i32 %0, i32 %3, i32 32)
ret void
}
/* Variables and functions */
int startTimer(int /*<<< orphan*/);
int checkTimer(int t) { return t - startTimer(0) <= 0; }


x86 assembly (clang, -O0):
<checkTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <startTimer@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
cmp    $0x0,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkTimer>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <startTimer@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setge  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @checkTimer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @startTimer(i32 0)
%5 = sub nsw i32 %3, %4
%6 = icmp sle i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @checkTimer(i32 %0) {
%2 = tail call i32 @startTimer(i32 0)
%3 = icmp sge i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* 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 /*<<< orphan*/ leds_OFF_all();
int /*<<< orphan*/ leds_init();
int main() {
  char data;
  leds_init();
  leds_OFF_all();
  UART0_Port_Init();
  UART0_Set_BaudRate();
  UART0_Set_Format();
  UART0_SendString("\n\rHello World!\n\r");
  while (1) {
    data = UART0_GetChar();
    UART0_PutChar(data);
  }
  leds_OFF_all();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <leds_init@plt>
xor    %eax,%eax
call   1080 <leds_OFF_all@plt>
xor    %eax,%eax
call   1040 <UART0_Port_Init@plt>
xor    %eax,%eax
call   1070 <UART0_Set_BaudRate@plt>
xor    %eax,%eax
call   1090 <UART0_Set_Format@plt>
lea    0xe55(%rip),%rdi
call   1050 <UART0_SendString@plt>
xor    %eax,%eax
call   10a0 <UART0_GetChar@plt>
movsbl %al,%edi
call   1030 <UART0_PutChar@plt>
jmp    11b0 <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 (...) @leds_init()
%4 = call i32 (...) @leds_OFF_all()
%5 = call i32 (...) @UART0_Port_Init()
%6 = call i32 (...) @UART0_Set_BaudRate()
%7 = call i32 (...) @UART0_Set_Format()
%8 = call i32 @UART0_SendString(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %0, %9
%10 = call signext i8 (...) @UART0_GetChar()
store i8 %10, i8* %2
%11 = load i8, i8* %2
%12 = call i32 @UART0_PutChar(i8 signext %11)
br label %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A\0DHello World!\0A\0D\00"
define i32 @main() {
%1 = tail call i32 (...) @leds_init()
%2 = tail call i32 (...) @leds_OFF_all()
%3 = tail call i32 (...) @UART0_Port_Init()
%4 = tail call i32 (...) @UART0_Set_BaudRate()
%5 = tail call i32 (...) @UART0_Set_Format()
%6 = tail call i32 @UART0_SendString(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %7, %0
%8 = tail call signext i8 (...) @UART0_GetChar()
%9 = tail call i32 @UART0_PutChar(i8 signext %8)
br label %7
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
double double_neg_inf() {
  union {
    double d;
    uint64_t i;
  } u;
  u.i = 0xFFF0000000000000;
  return u.d;
}


x86 assembly (clang, -O0):
<double_neg_inf>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_neg_inf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @double_neg_inf() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 0, i32* %2
%3 = bitcast %union.anon* %1 to double*
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @double_neg_inf() {
ret double 0.000000e+00
}
void _Z16_Jv_VerifyMethodP16_Jv_InterpMethod(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z16_Jv_VerifyMethodP16_Jv_InterpMethod() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void ddcl_ThreadExit() { pthread_exit(((void *)0)); }


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

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

LLVM IR (-O0):
define void @ddcl_ThreadExit() {
%1 = call i32 @pthread_exit(i8* null)
ret void
}

LLVM IR (-O2):
define void @ddcl_ThreadExit() {
%1 = tail call i32 @pthread_exit(i8* null)
ret void
}
unsigned int DRV_USB_GET_AVAILABLE_PORT_TYPE(unsigned char *pucPortType,
                                             unsigned int *pulPortNum,
                                             unsigned int ulPortMax) {
  return 0;
}


x86 assembly (clang, -O0):
<DRV_USB_GET_AVAILABLE_PORT_TYPE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @DRV_USB_GET_AVAILABLE_PORT_TYPE(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @DRV_USB_GET_AVAILABLE_PORT_TYPE(i8* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
ret i32 0
}
void yield(void) { asm volatile("nop\n\t"); }


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

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

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

LLVM IR (-O2):
define void @yield() {
tail call void asm sideeffect "nop\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *malloc(unsigned int);
void *cmalloc(int size) {
  char *s;
  if ((s = malloc((unsigned int)size)) == NULL)
    abort();
  return ((void *)s);
}


x86 assembly (clang, -O0):
<cmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1148 <cmalloc+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <cmalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @cmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @cmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int is_lack_of_memory(unsigned char *allocedMemory, int mallocRetry) {
  return (allocedMemory == NULL && mallocRetry < 4);
}


x86 assembly (clang, -O0):
<is_lack_of_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    1125 <is_lack_of_memory+0x25>
cmpl   $0x4,-0xc(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lack_of_memory>:
test   %rdi,%rdi
sete   %al
cmp    $0x4,%esi
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_lack_of_memory(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 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 4
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_lack_of_memory(i8* readnone %0, i32 %1) {
%3 = icmp eq i8* %0, null
%4 = icmp slt i32 %1, 4
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned *cpf_char_to_digits(const char *cpfChar, unsigned *digits) {
  const char *p = cpfChar;
  unsigned *d = digits;
  while (*p) {
    *d = *p - '0';
    ++p, ++d;
  }
  return digits;
}


x86 assembly (clang, -O0):
<cpf_char_to_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <cpf_char_to_digits+0x56>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x30,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <cpf_char_to_digits+0x1c>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpf_char_to_digits>:
mov    %rsi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <cpf_char_to_digits+0x26>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
add    $0xffffffd0,%ecx
mov    %ecx,(%rax,%rdx,4)
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <cpf_char_to_digits+0x10>
ret

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

LLVM IR (-O2):
define i32* @cpf_char_to_digits(i8* nocapture %0, i32* returned writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32* [ %12, %5 ], [ %1, %2 ]
%8 = phi i8* [ %11, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = add nsw i32 %9, -48
store i32 %10, i32* %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = getelementptr inbounds i32, i32* %7, i64 1
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret i32* %1
}
/* Type definitions */
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int umin(int, int);
void mpd_sanitize_lft(struct timespec *lft) {
  lft->tv_sec = (umin(lft->tv_sec, (0xffff << 2)) & (0xffff << 2));
  lft->tv_nsec = 0;
}


x86 assembly (clang, -O0):
<mpd_sanitize_lft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x3fffc,%esi
call   1030 <umin@plt>
mov    %eax,%ecx
and    $0x3fffc,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpd_sanitize_lft>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
mov    $0x3fffc,%esi
call   1030 <umin@plt>
and    $0x3fffc,%eax
mov    %eax,(%rbx)
movq   $0x0,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @mpd_sanitize_lft(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @umin(i32 %5, i32 262140)
%7 = and i32 %6, 262140
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
store i32 %7, i32* %9
%10 = load %struct.timespec*, %struct.timespec** %2
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
store i64 0, i64* %11
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @mpd_sanitize_lft(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @umin(i32 %3, i32 262140)
%5 = and i32 %4, 262140
store i32 %5, i32* %2
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i64 0, i64* %6
ret void
}
/* Variables and functions */
int board_led_1_get();
int /*<<< orphan*/ board_led_1_set(int);
void board_led_1_toggle() {
  bool old_level = board_led_1_get();
  bool new_level = !old_level;
  board_led_1_set(new_level);
}


x86 assembly (clang, -O0):
<board_led_1_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <board_led_1_get@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <board_led_1_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_led_1_toggle>:
push   %rax
xor    %eax,%eax
call   1030 <board_led_1_get@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1040 <board_led_1_set@plt>

LLVM IR (-O0):
define void @board_led_1_toggle() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @board_led_1_get()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @board_led_1_set(i32 %8)
ret void
}

LLVM IR (-O2):
define void @board_led_1_toggle() {
%1 = tail call i32 (...) @board_led_1_get()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @board_led_1_set(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ date_get_epoch(char *, char *);
int /*<<< orphan*/ difftime(int /*<<< orphan*/, int /*<<< orphan*/);
time_t date_compare(char *ps_date1, char *ps_date2, char *ps_format) {
  time_t t_epoch1, t_epoch2, d_diffsec;
  t_epoch1 = date_get_epoch(ps_date1, ps_format);
  t_epoch2 = date_get_epoch(ps_date2, ps_format);
  d_diffsec = difftime(t_epoch2, t_epoch1);
  return d_diffsec;
}


x86 assembly (clang, -O0):
<date_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <date_get_epoch@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <date_get_epoch@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <difftime@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_compare>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
call   1040 <date_get_epoch@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <date_get_epoch@plt>
mov    %eax,%edi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <difftime@plt>

LLVM IR (-O0):
define i32 @date_compare(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = call i32 @date_get_epoch(i8* %10, i8* %11)
store i32 %12, i32* %7
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @date_get_epoch(i8* %13, i8* %14)
store i32 %15, i32* %8
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = call i32 @difftime(i32 %16, i32 %17)
store i32 %18, i32* %9
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @date_compare(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @date_get_epoch(i8* %0, i8* %2)
%5 = tail call i32 @date_get_epoch(i8* %1, i8* %2)
%6 = tail call i32 @difftime(i32 %5, i32 %4)
ret i32 %6
}
/* Variables and functions */
float BMP180_readPressure();
float pow(double, double);
float BMP180_readSealevelPressure(float altitude_meters) {
  float pressure = BMP180_readPressure();
  return (int)(pressure / pow(1.0 - altitude_meters / 44330, 5.255));
}


x86 assembly (clang, -O0):
<BMP180_readSealevelPressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <BMP180_readPressure@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec0(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe94(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP180_readSealevelPressure>:
sub    $0x18,%rsp
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <BMP180_readPressure@plt>
movss  (%rsp),%xmm1
divss  0xec3(%rip),%xmm1
movaps %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  0xeb8(%rip),%xmm1
call   1040 <pow@plt>
movaps (%rsp),%xmm1
divss  %xmm0,%xmm1
cvttps2dq %xmm1,%xmm0
cvtdq2ps %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @BMP180_readSealevelPressure(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = call float (...) @BMP180_readPressure()
store float %4, float* %3
%5 = load float, float* %3
%6 = load float, float* %2
%7 = fdiv float %6, 4.433000e+04
%8 = fpext float %7 to double
%9 = fsub double 1.000000e+00, %8
%10 = call float @pow(double %9, double 5.255000e+00)
%11 = fdiv float %5, %10
%12 = fptosi float %11 to i32
%13 = sitofp i32 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @BMP180_readSealevelPressure(float %0) {
%2 = tail call float (...) @BMP180_readPressure()
%3 = fdiv float %0, 4.433000e+04
%4 = fpext float %3 to double
%5 = fsub double 1.000000e+00, %4
%6 = tail call float @pow(double %5, double 5.255000e+00)
%7 = fdiv float %2, %6
%8 = fptosi float %7 to i32
%9 = sitofp i32 %8 to float
ret float %9
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *get_hex(int number) {
  char *hex = (char *)malloc(256 * sizeof(char));
  sprintf(hex, "%X", number);
  return hex;
}


x86 assembly (clang, -O0):
<get_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x100,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hex>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x100,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%X\00"
define i8* @get_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 256)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%X\00"
define i8* @get_hex(i32 %0) {
%2 = tail call i64 @malloc(i32 256)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int EVP_EncryptFinal_ex(int /*<<< orphan*/ *, unsigned char *, int *);
int /*<<< orphan*/ EVP_EncryptInit_ex(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) {
  int i;
  i = EVP_EncryptFinal_ex(ctx, out, outl);
  EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, NULL);
  return i;
}


x86 assembly (clang, -O0):
<EVP_SealFinal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <EVP_EncryptFinal_ex@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rsi
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <EVP_EncryptInit_ex@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_SealFinal>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <EVP_EncryptFinal_ex@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <EVP_EncryptInit_ex@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @EVP_SealFinal(i32* %0, i8* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = call i32 @EVP_EncryptFinal_ex(i32* %8, i8* %9, i32* %10)
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = call i32 @EVP_EncryptInit_ex(i32* %12, i32* null, i32* null, i32* null, i32* null)
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @EVP_SealFinal(i32* %0, i8* %1, i32* %2) {
%4 = tail call i32 @EVP_EncryptFinal_ex(i32* %0, i8* %1, i32* %2)
%5 = tail call i32 @EVP_EncryptInit_ex(i32* %0, i32* null, i32* null, i32* null, i32* null)
ret i32 %4
}
void led_puts(const char *s) {}


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

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

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

LLVM IR (-O2):
define void @led_puts(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isspace(int);
char *nullify_space(char *str) {
  char *p;
  for (p = str; p != NULL && isspace((int)*p); p++)
    *p = '\0';
  return p;
}


x86 assembly (clang, -O0):
<nullify_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     114a <nullify_space+0x3a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115a <nullify_space+0x4a>
jmp    1172 <nullify_space+0x62>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <nullify_space+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullify_space>:
push   %rbx
test   %rdi,%rdi
je     1137 <nullify_space+0x27>
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopl   0x0(%rax)
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <nullify_space+0x29>
movb   $0x0,(%rbx)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <nullify_space+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @nullify_space(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 = %18, %1
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i64 @isspace(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %8, %5
%15 = phi i1 [ false, %5 ], [ %13, %8 ]
br i1 %15, label %16, label %21
16: ; preds = %14
%17 = load i8*, i8** %3
store i8 0, i8* %17
br label %18
18: ; preds = %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %5
21: ; preds = %14
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @nullify_space(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %3, %8
%9 = phi i8* [ %10, %8 ], [ %0, %3 ]
store i8 0, i8* %9
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i64 @isspace(i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %3, %1
%16 = phi i8* [ null, %1 ], [ %0, %3 ], [ %10, %8 ]
ret i8* %16
}
int pathcon_nm9_f0(const double **arg, double **res, int *iw, double *w,
                   int mem) {
  return 0;
}


x86 assembly (clang, -O0):
<pathcon_nm9_f0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pathcon_nm9_f0(double** nocapture readnone %0, double** nocapture readnone %1, i32* nocapture readnone %2, double* nocapture readnone %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isdigit(int);
void t_isdigit_0x35() {
  Assert_real((isdigit(53)),
              "/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",
              270, ("isdigit should be 1 for 5"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x35>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x10e,%edx
jmp    1030 <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 1 for 5\00"
define void @t_isdigit_0x35() {
%1 = call i32 @isdigit(i32 53)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 270, 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 1 for 5\00"
define void @t_isdigit_0x35() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int round_up(int num, int multiple) {
  if (multiple == 0)
    return num;
  int remain = num % multiple;
  if (remain == 0)
    return num;
  return num + multiple - remain;
}


x86 assembly (clang, -O0):
<round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <round_up+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <round_up+0x4a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    113e <round_up+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <round_up+0x4a>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up>:
test   %esi,%esi
je     1112 <round_up+0x12>
mov    %edi,%eax
cltd
idiv   %esi
add    %edi,%esi
sub    %edx,%esi
test   %edx,%edx
cmovne %esi,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @round_up(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = srem i32 %0, %1
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %1, %0
%8 = sub i32 %7, %5
%9 = select i1 %6, i32 %0, i32 %8
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ %0, %2 ]
ret i32 %11
}
void foo052(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo052(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World\n");
  return 13375465465465456;
}


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>
mov    $0x3bc64a70,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1002850928
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 1002850928
}
/* Variables and functions */
unsigned long rand();
long next_record_idx(long records_total) {
  unsigned long ret;
  ret = rand();
  ret <<= 24;
  ret ^= rand();
  ret %= records_total;
  return ret;
}


x86 assembly (clang, -O0):
<next_record_idx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_record_idx>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rbx
shl    $0x18,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
xor    %rbx,%rax
xor    %edx,%edx
div    %r14
mov    %rdx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @next_record_idx(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i64 (...) @rand()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = shl i64 %5, 24
store i64 %6, i64* %3
%7 = call i64 (...) @rand()
%8 = load i64, i64* %3
%9 = xor i64 %8, %7
store i64 %9, i64* %3
%10 = load i64, i64* %2
%11 = load i64, i64* %3
%12 = urem i64 %11, %10
store i64 %12, i64* %3
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @next_record_idx(i64 %0) {
%2 = tail call i64 (...) @rand()
%3 = shl i64 %2, 24
%4 = tail call i64 (...) @rand()
%5 = xor i64 %3, %4
%6 = urem i64 %5, %0
ret i64 %6
}
void rop3_133_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = ~T;
  stk3 = S | stk4;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_133_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 -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xe(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_133_0_0>:
mov    %edx,%eax
not    %al
or     %sil,%al
and    (%rdi),%al
xor    %dl,%al
not    %al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_133_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
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %10
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = load i8, i8* %9
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %8
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = xor i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = trunc i32 %36 to i8
store i8 %37, i8* %7
%38 = load i8, i8* %7
%39 = load i8*, i8** %4
store i8 %38, i8* %39
ret void
}

LLVM IR (-O2):
define void @rop3_133_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = or i8 %4, %1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
%8 = xor i8 %7, %2
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terminal_initialize();
int /*<<< orphan*/ terminal_writestring(char *);
void kernel_main() {
  terminal_initialize();
  terminal_writestring("Hello, kernel World!\n");
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <terminal_initialize@plt>
lea    0xece(%rip),%rdi
call   1030 <terminal_writestring@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %eax,%eax
call   1040 <terminal_initialize@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <terminal_writestring@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Hello, kernel World!\0A\00"
define void @kernel_main() {
%1 = call i32 (...) @terminal_initialize()
%2 = call i32 @terminal_writestring(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello, kernel World!\0A\00"
define void @kernel_main() {
%1 = tail call i32 (...) @terminal_initialize()
%2 = tail call i32 @terminal_writestring(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int memcmp(char *, char *, int);
int __test_different() {
  void;
  if ((memcmp("foo", "bar", 4)) == (1))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<__test_different>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x1,%eax
jne    1145 <__test_different+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <__test_different+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_different>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@.str.1 = [4 x i8] c"bar\00"
define i32 @__test_different() {
%1 = alloca i32
%2 = call i32 @memcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@.str.1 = [4 x i8] c"bar\00"
define i32 @__test_different() {
%1 = tail call i32 @memcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 4)
%2 = icmp ne i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ cmdAgent(int);
int main(int argc, char *argv[]) {
  int id = atoi(argv[1]);
  cmdAgent(id);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <cmdAgent@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <cmdAgent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @cmdAgent(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @cmdAgent(i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(char const);
unsigned int load_uint(char const *, unsigned int);
char *skip_leading_spaces(char const *);
const char *load_uint_check(const char *s, unsigned int *v, unsigned int max) {
  s = skip_leading_spaces(s);
  if (isdigit(*s)) {
    *v = load_uint(s, max);
    return NULL;
  }
  return s;
}


x86 assembly (clang, -O0):
<load_uint_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <skip_leading_spaces@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1187 <load_uint_check+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1050 <load_uint@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    118f <load_uint_check+0x5f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_uint_check>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
call   1040 <skip_leading_spaces@plt>
mov    %rax,%rbx
movsbl (%rax),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     115d <load_uint_check+0x2d>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <load_uint@plt>
mov    %eax,(%r14)
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @load_uint_check(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = call i8* @skip_leading_spaces(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = call i64 @isdigit(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i32, i32* %7
%17 = call i32 @load_uint(i8* %15, i32 %16)
%18 = load i32*, i32** %6
store i32 %17, i32* %18
store i8* null, i8** %4
br label %21
19: ; preds = %3
%20 = load i8*, i8** %5
store i8* %20, i8** %4
br label %21
21: ; preds = %19, %14
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @load_uint_check(i8* %0, i32* nocapture writeonly %1, i32 %2) {
%4 = tail call i8* @skip_leading_spaces(i8* %0)
%5 = load i8, i8* %4
%6 = tail call i64 @isdigit(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @load_uint(i8* %4, i32 %2)
store i32 %9, i32* %1
br label %10
10: ; preds = %3, %8
%11 = phi i8* [ null, %8 ], [ %4, %3 ]
ret i8* %11
}