xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ i2c_smbus_write_word_data(int, unsigned char, unsigned short);
int i2cWriteWord(int i2cAdapter, unsigned char address, unsigned short word) {
  if (i2c_smbus_write_word_data(i2cAdapter, address, word)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<i2cWriteWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %sil,%cl
mov    %edi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x9(%rbp),%al
movzbl %al,%esi
movzwl -0xc(%rbp),%edx
call   1030 <i2c_smbus_write_word_data@plt>
cmp    $0x0,%rax
je     1150 <i2cWriteWord+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <i2cWriteWord+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2cWriteWord>:
push   %rax
call   1030 <i2c_smbus_write_word_data@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i2cWriteWord(i32 %0, i8 zeroext %1, i16 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i16
store i32 %0, i32* %5
store i8 %1, i8* %6
store i16 %2, i16* %7
%8 = load i32, i32* %5
%9 = load i8, i8* %6
%10 = load i16, i16* %7
%11 = call i64 @i2c_smbus_write_word_data(i32 %8, i8 zeroext %9, i16 zeroext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 -1, i32* %4
br label %15
14: ; preds = %3
store i32 0, i32* %4
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @i2cWriteWord(i32 %0, i8 zeroext %1, i16 zeroext %2) {
%4 = tail call i64 @i2c_smbus_write_word_data(i32 %0, i8 zeroext %1, i16 zeroext %2)
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
void Strcpy3(char *t, char *s) {
  while (*s = *t) {
    s++;
    t++;
  }
}


x86 assembly (clang, -O0):
<Strcpy3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     113d <Strcpy3+0x3d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <Strcpy3+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strcpy3>:
mov    (%rdi),%al
mov    %al,(%rsi)
test   %al,%al
je     111f <Strcpy3+0x1f>
mov    $0x1,%eax
nopl   (%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <Strcpy3+0x10>
ret

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

LLVM IR (-O2):
define void @Strcpy3(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %1, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset_flag(int);
int /*<<< orphan*/ set_flag(int);
void op0x37(void) {
  set_flag(0x10);
  reset_flag(0x40);
  reset_flag(0x20);
}


x86 assembly (clang, -O0):
<op0x37>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1040 <set_flag@plt>
mov    $0x40,%edi
call   1030 <reset_flag@plt>
mov    $0x20,%edi
call   1030 <reset_flag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op0x37>:
push   %rax
mov    $0x10,%edi
call   1040 <set_flag@plt>
mov    $0x40,%edi
call   1030 <reset_flag@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <reset_flag@plt>

LLVM IR (-O0):
define void @op0x37() {
%1 = call i32 @set_flag(i32 16)
%2 = call i32 @reset_flag(i32 64)
%3 = call i32 @reset_flag(i32 32)
ret void
}

LLVM IR (-O2):
define void @op0x37() {
%1 = tail call i32 @set_flag(i32 16)
%2 = tail call i32 @reset_flag(i32 64)
%3 = tail call i32 @reset_flag(i32 32)
ret void
}
void digitalWrite(int pin, int value) {
  (void)pin;
  (void)value;
}


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

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

LLVM IR (-O0):
define void @digitalWrite(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
ret void
}

LLVM IR (-O2):
define void @digitalWrite(i32 %0, i32 %1) {
ret void
}
void deargify(argv) char ***argv;
{ return; }


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

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

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

LLVM IR (-O2):
define void @deargify(i8*** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AssertFailure(char *, int);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
unsigned long UARTRxErrorGet(unsigned long ulBase) {
  {
    if (!(UARTBaseValid(ulBase))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          1678);
    }
  };
  return ((*((volatile unsigned long *)(ulBase + 0x00000004))) & 0x0000000F);
}


x86 assembly (clang, -O0):
<UARTRxErrorGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    114f <UARTRxErrorGet+0x2f>
lea    0xebb(%rip),%rdi
mov    $0x68e,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rax
and    $0xf,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRxErrorGet>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    113e <UARTRxErrorGet+0x1e>
lea    0xecc(%rip),%rdi
mov    $0x68e,%esi
call   1030 <AssertFailure@plt>
mov    0x4(%rbx),%rax
and    $0xf,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define i64 @UARTRxErrorGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 1678)
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = add i64 %9, 4
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 15
ret i64 %13
}

LLVM IR (-O2):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define i64 @UARTRxErrorGet(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 1678)
br label %6
6: ; preds = %4, %1
%7 = add i64 %0, 4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 15
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main(int, char **);
void _start(int argc, char *argv[]) {
  int res;
  res = main(argc, argv);
  exit(res);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @_start(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @main(i32 %6, i8** %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
define void @_start(i32 %0, i8** %1) {
%3 = tail call i32 @main(i32 %0, i8** %1)
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int send(int, void *, int, int /*<<< orphan*/);
int fwd_ipc_sendmsg(int fd, void *buf, int len) {
  return send(fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<fwd_ipc_sendmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwd_ipc_sendmsg>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

LLVM IR (-O0):
define i32 @fwd_ipc_sendmsg(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 i32 @send(i32 %7, i8* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fwd_ipc_sendmsg(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int /*<<< orphan*/);
int /*<<< orphan*/ IntUnregister(int /*<<< orphan*/);
int /*<<< orphan*/ _GPIOIntNumberGet(int /*<<< orphan*/);
void GPIOIntUnregister(uint32_t ui32Port) {
  uint32_t ui32Int;
  ;
  ui32Int = _GPIOIntNumberGet(ui32Port);
  ;
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<GPIOIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_GPIOIntNumberGet@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOIntUnregister>:
push   %rbx
call   1030 <_GPIOIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @GPIOIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_GPIOIntNumberGet(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @IntDisable(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @IntUnregister(i32 %8)
ret void
}

LLVM IR (-O2):
define void @GPIOIntUnregister(i32 %0) {
%2 = tail call i32 @_GPIOIntNumberGet(i32 %0)
%3 = tail call i32 @IntDisable(i32 %2)
%4 = tail call i32 @IntUnregister(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void printVector(const int *v, const int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d ", v[i]);
  }
}


x86 assembly (clang, -O0):
<printVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printVector+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printVector+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVector>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printVector+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printVector+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printVector(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int main_visibility_checkweak() { return 1; }


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

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

LLVM IR (-O0):
define i32 @main_visibility_checkweak() {
ret i32 1
}

LLVM IR (-O2):
define i32 @main_visibility_checkweak() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ send_cmd(int, float);
void turn_all_off() {
  send_cmd(0, 'f');
  for (int i = 1; i <= (5); ++i)
    send_cmd(i, 'F');
}


x86 assembly (clang, -O0):
<turn_all_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
movss  0xede(%rip),%xmm0
call   1030 <send_cmd@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jg     1156 <turn_all_off+0x46>
mov    -0x4(%rbp),%edi
movss  0xec1(%rip),%xmm0
call   1030 <send_cmd@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <turn_all_off+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_all_off>:
push   %rax
movss  0xee7(%rip),%xmm0
xor    %edi,%edi
call   1030 <send_cmd@plt>
movss  0xedc(%rip),%xmm0
mov    $0x1,%edi
call   1030 <send_cmd@plt>
mov    $0x2,%edi
movss  0xec5(%rip),%xmm0
call   1030 <send_cmd@plt>
mov    $0x3,%edi
movss  0xeb3(%rip),%xmm0
call   1030 <send_cmd@plt>
mov    $0x4,%edi
movss  0xea1(%rip),%xmm0
call   1030 <send_cmd@plt>
mov    $0x5,%edi
movss  0xe8f(%rip),%xmm0
pop    %rax
jmp    1030 <send_cmd@plt>

LLVM IR (-O0):
define void @turn_all_off() {
%1 = alloca i32
%2 = call i32 @send_cmd(i32 0, float 1.020000e+02)
store i32 1, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 5
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @send_cmd(i32 %7, float 7.000000e+01)
br label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @turn_all_off() {
%1 = tail call i32 @send_cmd(i32 0, float 1.020000e+02)
%2 = tail call i32 @send_cmd(i32 1, float 7.000000e+01)
%3 = tail call i32 @send_cmd(i32 2, float 7.000000e+01)
%4 = tail call i32 @send_cmd(i32 3, float 7.000000e+01)
%5 = tail call i32 @send_cmd(i32 4, float 7.000000e+01)
%6 = tail call i32 @send_cmd(i32 5, float 7.000000e+01)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int main() {
  bar(1);
  bar(2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 1)
%2 = tail call i32 @bar(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
void my_putstr(char *str) {
  register unsigned int i;
  i = 0;
  while (str[i] != '\0')
    my_putchar(str[i++]);
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1156 <my_putstr+0x46>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <my_putchar@plt>
jmp    1123 <my_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <my_putstr+0x35>
mov    %rdi,%rbx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <my_putchar@plt>
mov    %ebp,%eax
movzbl (%rbx,%rax,1),%eax
add    $0x1,%ebp
test   %al,%al
jne    1130 <my_putstr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @my_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add i32 %6, 1
%8 = tail call i32 @my_putchar(i8 signext %5)
%9 = zext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
int /*<<< orphan*/ xerr(char const *);
void xerr2(const char *a, const char *b) {
  write(2, a, strlen(a));
  write(2, ": ", 2);
  xerr(b);
}


x86 assembly (clang, -O0):
<xerr2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x2,%edx
lea    0xe93(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x10(%rbp),%rdi
call   1050 <xerr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xerr2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xeab(%rip),%rsi
mov    $0x2,%edi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <xerr@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
define void @xerr2(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 2, i8* %0, i32 %3)
%5 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = tail call i32 @xerr(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
char *strerror(int /*<<< orphan*/);
void unix_error(char *msg) {
  fprintf(stdout, "%s: %s\n", msg, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<unix_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unix_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e93(%rip),%rax
mov    (%rax),%ebp
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @unix_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @unix_error(i8* %0) {
%2 = load i32, i32* @stdout
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ se_dist(double const *, double const *, int const);
double sqrt(int /*<<< orphan*/);
double e_dist(const double *x, const double *y, const int n_dimensions) {
  return sqrt(se_dist(x, y, n_dimensions));
}


x86 assembly (clang, -O0):
<e_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <se_dist@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_dist>:
push   %rax
call   1030 <se_dist@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

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

LLVM IR (-O2):
define double @e_dist(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @se_dist(double* %0, double* %1, i32 %2)
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ storage_test();
int main(int argc, char **argv) { storage_test(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @storage_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @storage_test()
ret i32 0
}
void VLDDisableModule(HMODULE) {}


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

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

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

LLVM IR (-O2):
define void @VLDDisableModule(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetFontWidth105(unsigned long);
void setfontwidth(unsigned long w) { SetFontWidth105(w); }


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

x86 assembly (clang, -O2):
<setfontwidth>:
jmp    1030 <SetFontWidth105@plt>

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

LLVM IR (-O2):
define void @setfontwidth(i64 %0) {
%2 = tail call i32 @SetFontWidth105(i64 %0)
ret void
}
char **tostr(char c, char **s, int totimes, int vtimes, int *k) {
  s[*k][totimes - vtimes] = c;
  return s;
}


x86 assembly (clang, -O0):
<tostr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x14(%rbp),%ecx
sub    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tostr>:
mov    %rsi,%rax
movslq (%r8),%rsi
mov    (%rax,%rsi,8),%rsi
sub    %ecx,%edx
movslq %edx,%rcx
mov    %dil,(%rsi,%rcx,1)
ret

LLVM IR (-O0):
define i8** @tostr(i8 signext %0, i8** %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i8
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i8 %0, i8* %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i8, i8* %6
%12 = load i8**, i8*** %7
%13 = load i32*, i32** %10
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %12, i64 %15
%17 = load i8*, i8** %16
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = sub nsw i32 %18, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %17, i64 %21
store i8 %11, i8* %22
%23 = load i8**, i8*** %7
ret i8** %23
}

LLVM IR (-O2):
define i8** @tostr(i8 signext %0, i8** returned %1, i32 %2, i32 %3, i32* nocapture %4) {
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = sub nsw i32 %2, %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %0, i8* %12
ret i8** %1
}
int cpu_has_pkeys(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @cpu_has_pkeys() {
ret i32 1
}

LLVM IR (-O2):
define i32 @cpu_has_pkeys() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
struct _Locale_ctype {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ towupper(int /*<<< orphan*/);
wint_t _WLocale_toupper(struct _Locale_ctype *lctype, wint_t wc) {
  return towupper(wc);
}


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

x86 assembly (clang, -O2):
<_WLocale_toupper>:
mov    %esi,%edi
jmp    1030 <towupper@plt>

LLVM IR (-O0):
%struct._Locale_ctype = type { i32 }
define i32 @_WLocale_toupper(%struct._Locale_ctype* %0, i32 %1) {
%3 = alloca %struct._Locale_ctype*
%4 = alloca i32
store %struct._Locale_ctype* %0, %struct._Locale_ctype** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @towupper(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct._Locale_ctype = type { i32 }
define i32 @_WLocale_toupper(%struct._Locale_ctype* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @towupper(i32 %1)
ret i32 %3
}
/* Type definitions */
struct udphdr {
  int /*<<< orphan*/ uh_sport;
};
typedef int /*<<< orphan*/ in_port_t;

/* Variables and functions */
in_port_t *udphdr_uh_sport(struct udphdr *udp) { return &udp->uh_sport; }


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

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

LLVM IR (-O0):
%struct.udphdr = type { i32 }
define i32* @udphdr_uh_sport(%struct.udphdr* %0) {
%2 = alloca %struct.udphdr*
store %struct.udphdr* %0, %struct.udphdr** %2
%3 = load %struct.udphdr*, %struct.udphdr** %2
%4 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %3, i32 0, i32 0
ret i32* %4
}

LLVM IR (-O2):
%struct.udphdr = type { i32 }
define i32* @udphdr_uh_sport(%struct.udphdr* readnone %0) {
%2 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %0, i64 0, i32 0
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int isakmp_validate_proto(u_int8_t proto) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @isakmp_validate_proto(i32 %0) {
ret i32 -1
}
zputhex(c) register int c;
{
  static char digits[] = "0123456789abcdef";
  sendline(digits[(c & 0xF0) >> 4]);
  sendline(digits[(c)&0xF]);
}


x86 assembly (clang, -O0):
<zputhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0x2f00(%rip),%rax
movsbl (%rax,%rcx,1),%edi
mov    $0x0,%al
call   1030 <sendline@plt>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2ee5(%rip),%rax
movsbl (%rax,%rcx,1),%edi
mov    $0x0,%al
call   1030 <sendline@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zputhex>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0xedb(%rip),%r14
movsbl (%rax,%r14,1),%edi
xor    %eax,%eax
call   1030 <sendline@plt>
and    $0xf,%ebx
movsbl (%rbx,%r14,1),%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <sendline@plt>

LLVM IR (-O0):
@zputhex.digits = internal global [17 x i8] c"0123456789abcdef\00"
define i32 @zputhex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 240
%6 = ashr i32 %5, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @sendline to i32 (i32, ...)*)(i32 %10)
%12 = load i32, i32* %3
%13 = and i32 %12, 15
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 (i32, ...) bitcast (i32 (...)* @sendline to i32 (i32, ...)*)(i32 %17)
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@zputhex.digits = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define i32 @zputhex(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @sendline to i32 (i32, ...)*)(i32 %7)
%9 = and i32 %0, 15
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @sendline to i32 (i32, ...)*)(i32 %13)
ret i32 undef
}
int subtract(int a, int b) {
  int c = 0;
  c = a - b;
  return c;
}


x86 assembly (clang, -O0):
<subtract>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @subtract(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
int comparator(const void *first, const void *second) {
  float a = *((int *)first), b = *((int *)second);
  int result = a - b;
  return (0 < result) - (result < 0);
}


x86 assembly (clang, -O0):
<comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x1c(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparator>:
cvtsi2ssl (%rdi),%xmm0
cvtsi2ssl (%rsi),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
sar    $0x1f,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comparator(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to float
store float %11, float* %5
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = sitofp i32 %14 to float
store float %15, float* %6
%16 = load float, float* %5
%17 = load float, float* %6
%18 = fsub float %16, %17
%19 = fptosi float %18 to i32
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = icmp slt i32 0, %20
%22 = zext i1 %21 to i32
%23 = load i32, i32* %7
%24 = icmp slt i32 %23, 0
%25 = zext i1 %24 to i32
%26 = sub nsw i32 %22, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to float
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to float
%9 = fsub float %5, %8
%10 = fptosi float %9 to i32
%11 = icmp sgt i32 %10, 0
%12 = zext i1 %11 to i32
%13 = ashr i32 %10, 31
%14 = add nsw i32 %13, %12
ret i32 %14
}
int main() {
  int c;
  int i;
  c = (24 * 6) * 6;
  if (c <= 10) {
    i = 0;
    while (i < 100) {
      i = i + 1;
    }
  } else {
    if (c <= 50) {
      i = 0;
      while (i < 101) {
        i = i + 1;
      }
    }
    if (c <= 100) {
      i = 0;
      while (i < 102) {
        i = i + 1;
      }
    } else {
      i = 0;
      while (i < 103) {
        i = i + 0;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x360,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1140 <main+0x40>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    113b <main+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    11c5 <main+0xc5>
cmpl   $0x32,-0x8(%rbp)
jg     116e <main+0x6e>
movl   $0x0,-0xc(%rbp)
cmpl   $0x65,-0xc(%rbp)
jge    1169 <main+0x69>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <main+0x51>
jmp    116e <main+0x6e>
cmpl   $0x64,-0x8(%rbp)
jg     119c <main+0x9c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x66,-0xc(%rbp)
jge    1197 <main+0x97>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117f <main+0x7f>
jmp    11c0 <main+0xc0>
movl   $0x0,-0xc(%rbp)
cmpl   $0x67,-0xc(%rbp)
jge    11bb <main+0xbb>
mov    -0xc(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0xc(%rbp)
jmp    11a3 <main+0xa3>
jmp    11c0 <main+0xc0>
jmp    11c5 <main+0xc5>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 864, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %14
6: ; preds = %0
store i32 0, i32* %3
br label %7
7: ; preds = %10, %6
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %7
13: ; preds = %7
br label %45
14: ; preds = %0
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 50
br i1 %16, label %17, label %25
17: ; preds = %14
store i32 0, i32* %3
br label %18
18: ; preds = %21, %17
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 101
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %18
24: ; preds = %18
br label %25
25: ; preds = %24, %14
%26 = load i32, i32* %2
%27 = icmp sle i32 %26, 100
br i1 %27, label %28, label %36
28: ; preds = %25
store i32 0, i32* %3
br label %29
29: ; preds = %32, %28
%30 = load i32, i32* %3
%31 = icmp slt i32 %30, 102
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %29
35: ; preds = %29
br label %44
36: ; preds = %25
store i32 0, i32* %3
br label %37
37: ; preds = %40, %36
%38 = load i32, i32* %3
%39 = icmp slt i32 %38, 103
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 0
store i32 %42, i32* %3
br label %37
43: ; preds = %37
br label %44
44: ; preds = %43, %35
br label %45
45: ; preds = %44, %13
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ create_null_path_ok(int *);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void malloc_then_call_create_null_path_then_deref_unconditionally_latent(
    int *p) {
  int *x = (int *)malloc(sizeof(int));
  if (p) {
    *p = 32;
  }
  create_null_path_ok(p);
  *p = 52;
  free(x);
}


x86 assembly (clang, -O0):
<malloc_then_call_create_null_path_then_deref_unconditionally_latent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115f <malloc_then_call_create_null_path_then_deref_unconditionally_latent+0x2f>
mov    -0x8(%rbp),%rax
movl   $0x20,(%rax)
mov    -0x8(%rbp),%rdi
call   1050 <create_null_path_ok@plt>
mov    -0x8(%rbp),%rax
movl   $0x34,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_then_call_create_null_path_then_deref_unconditionally_latent>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     114f <malloc_then_call_create_null_path_then_deref_unconditionally_latent+0x1f>
movl   $0x20,(%rbx)
mov    %rbx,%rdi
call   1050 <create_null_path_ok@plt>
movl   $0x34,(%rbx)
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @malloc_then_call_create_null_path_then_deref_unconditionally_latent(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32*, i32** %2
store i32 32, i32* %9
br label %10
10: ; preds = %8, %1
%11 = load i32*, i32** %2
%12 = call i32 @create_null_path_ok(i32* %11)
%13 = load i32*, i32** %2
store i32 52, i32* %13
%14 = load i32*, i32** %3
%15 = call i32 @free(i32* %14)
ret void
}

LLVM IR (-O2):
define void @malloc_then_call_create_null_path_then_deref_unconditionally_latent(i32* %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = icmp eq i32* %0, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 32, i32* %0
br label %5
5: ; preds = %4, %1
%6 = inttoptr i64 %2 to i32*
%7 = tail call i32 @create_null_path_ok(i32* %0)
store i32 52, i32* %0
%8 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x8f() {
  Assert_real((isbdigit(143) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              720, ("isbdigit should be 0 for 0x8f"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x8f>:
push   %rax
mov    $0x8f,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2d0,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x8f\00"
define void @t_isbdigit_0x8f() {
%1 = call i64 @isbdigit(i32 143)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 720, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x8f\00"
define void @t_isbdigit_0x8f() {
%1 = tail call i64 @isbdigit(i32 143)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 720, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ gsm_hex2int(char *, int);
char *pdu_get_smsc_len(char *body, char *smsc_len) {
  char *pBegin, *pEnd;
  pBegin = body;
  pEnd = pBegin + 2;
  *smsc_len = (char)gsm_hex2int(pBegin, 2);
  return pEnd;
}


x86 assembly (clang, -O0):
<pdu_get_smsc_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1030 <gsm_hex2int@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_get_smsc_len>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0x2(%rdi),%rbx
mov    $0x2,%esi
call   1030 <gsm_hex2int@plt>
mov    %al,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @pdu_get_smsc_len(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8* %9, i8** %6
%10 = load i8*, i8** %5
%11 = call i64 @gsm_hex2int(i8* %10, i32 2)
%12 = trunc i64 %11 to i8
%13 = load i8*, i8** %4
store i8 %12, i8* %13
%14 = load i8*, i8** %6
ret i8* %14
}

LLVM IR (-O2):
define i8* @pdu_get_smsc_len(i8* %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = tail call i64 @gsm_hex2int(i8* %0, i32 2)
%5 = trunc i64 %4 to i8
store i8 %5, i8* %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int isSupported(char *type) {
  if (!strcasecmp(type, "BITMAP"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1141 <isSupported+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isSupported+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSupported>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"BITMAP\00"
define i32 @isSupported(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
const char *db_check_total_report_sql(void) {
  static const char *query = "SELECT * FROM check_total";
  return query;
}


x86 assembly (clang, -O0):
<db_check_total_report_sql>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_check_total_report_sql>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@db_check_total_report_sql.query = internal global i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i32 0, i32 0)
@.str = [26 x i8] c"SELECT * FROM check_total\00"
define i8* @db_check_total_report_sql() {
%1 = load i8*, i8** @db_check_total_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [26 x i8] c"SELECT * FROM check_total\00"
define i8* @db_check_total_report_sql() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}