xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
long pvGetFrameOrientation(char byBoardNum) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvGetFrameOrientation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i64 @pvGetFrameOrientation(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i64 @pvGetFrameOrientation(i8 signext %0) {
%2 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void main() {
  int x = 2, y = 3, z = 4;
  printf("x=%d,y=%d\n", x, y);
  printf("z=%d\n", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"x=%d,y=%d\0A\00"
@.str.1 = [6 x i8] c"z=%d\0A\00"
define void @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2, i32 3)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 4)
ret void
}
int test_imm_ACint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xAC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ACint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 738734374912
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float sqrtf(int /*<<< orphan*/);
int /*<<< orphan*/ stdlib_strided_svarianceyc(int /*<<< orphan*/ const,
                                              float const, float const *,
                                              int /*<<< orphan*/ const);
float stdlib_strided_sstdevyc(const int64_t N, const float correction,
                              const float *X, const int64_t stride) {
  return sqrtf(stdlib_strided_svarianceyc(N, correction, X, stride));
}


x86 assembly (clang, -O0):
<stdlib_strided_sstdevyc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdlib_strided_svarianceyc@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @stdlib_strided_sstdevyc(i32 %0, float %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float*
%8 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store float* %2, float** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load float, float* %6
%11 = load float*, float** %7
%12 = load i32, i32* %8
%13 = call i32 @stdlib_strided_svarianceyc(i32 %9, float %10, float* %11, i32 %12)
%14 = call float @sqrtf(i32 %13)
ret float %14
}

LLVM IR (-O2):
define float @stdlib_strided_sstdevyc(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call i32 @stdlib_strided_svarianceyc(i32 %0, float %1, float* %2, i32 %3)
%6 = tail call float @sqrtf(i32 %5)
ret float %6
}
void SysCtlLDOSet(unsigned long ulVoltage) {

  ;
  (*((volatile unsigned long *)(0x400FE034))) = ulVoltage;
}


x86 assembly (clang, -O0):
<SysCtlLDOSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fe034,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlLDOSet>:
mov    %rdi,0x400fe034
40
ret

LLVM IR (-O0):
define void @SysCtlLDOSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074782260 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlLDOSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074782260 to i64*)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x0;
  int y0;
  int /*<<< orphan*/ cmd;
};
typedef TYPE_1__ osd_cmd_t;

/* Variables and functions */
int /*<<< orphan*/ OSD_MoveWindow;
int /*<<< orphan*/ OSD_SEND_CMD;
int ioctl(int, int /*<<< orphan*/, TYPE_1__ *);
int OSDMoveWindow(int dev, int x, int y) {
  osd_cmd_t dc;
  dc.cmd = OSD_MoveWindow;
  dc.x0 = x;
  dc.y0 = y;
  return ioctl(dev, OSD_SEND_CMD, &dc);
}


x86 assembly (clang, -O0):
<OSDMoveWindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSDMoveWindow>:
sub    $0x18,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
mov    %esi,0x8(%rsp)
mov    %edx,0xc(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <ioctl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32 }
@OSD_MoveWindow = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDMoveWindow(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.TYPE_3__
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* @OSD_MoveWindow
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 2
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
store i32 %12, i32* %13
%14 = load i32, i32* %4
%15 = load i32, i32* @OSD_SEND_CMD
%16 = call i32 @ioctl(i32 %14, i32 %15, %struct.TYPE_3__* %7)
ret i32 %16
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32 }
@OSD_MoveWindow = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDMoveWindow(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.TYPE_3__
%5 = bitcast %struct.TYPE_3__* %4 to i8*
%6 = load i32, i32* @OSD_MoveWindow
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 2
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 0
store i32 %1, i32* %8
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 1
store i32 %2, i32* %9
%10 = load i32, i32* @OSD_SEND_CMD
%11 = call i32 @ioctl(i32 %0, i32 %10, %struct.TYPE_3__* %4)
ret i32 %11
}
int strcmp(char *s, char *t) {
  for (; *s == *t; s++, t++)
    if (*s == '\0')
      return 0;
  return *s - *t;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <strcmp+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <strcmp+0x73>
jmp    1143 <strcmp+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %34
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %29, %32
store i32 %33, i32* %3
br label %34
34: ; preds = %26, %19
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ i2c_start();
int /*<<< orphan*/ i2c_stop();
char i2c_write(char);
char ee24_is_busy(char control_byte) {
  i2c_start();
  char ack = i2c_write(control_byte);
  i2c_stop();
  return ack;
}


x86 assembly (clang, -O0):
<ee24_is_busy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1050 <i2c_start@plt>
movsbl -0x1(%rbp),%edi
call   1030 <i2c_write@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1040 <i2c_stop@plt>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ee24_is_busy>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <i2c_start@plt>
mov    %ebx,%edi
call   1030 <i2c_write@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <i2c_stop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @ee24_is_busy(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call i32 (...) @i2c_start()
%5 = load i8, i8* %2
%6 = call signext i8 @i2c_write(i8 signext %5)
store i8 %6, i8* %3
%7 = call i32 (...) @i2c_stop()
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @ee24_is_busy(i8 signext %0) {
%2 = tail call i32 (...) @i2c_start()
%3 = tail call signext i8 @i2c_write(i8 signext %0)
%4 = tail call i32 (...) @i2c_stop()
ret i8 %3
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t inb(uint16_t port) {
  uint8_t val;
  __asm__ __volatile__("inb %%dx, %%al" : "=a"(val) : "d"(port));
  return val;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inb %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inb(i32 %0) {
%2 = tail call i8* asm sideeffect "inb %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Msp430ClockP__Msp430ClockInit__defaultInitTimerB();
void Msp430ClockP__Msp430ClockInit__default__initTimerB(void) {
  Msp430ClockP__Msp430ClockInit__defaultInitTimerB();
}


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

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

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

LLVM IR (-O2):
define void @Msp430ClockP__Msp430ClockInit__default__initTimerB() {
%1 = tail call i32 (...) @Msp430ClockP__Msp430ClockInit__defaultInitTimerB()
ret void
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_sync(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_sync>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_sync(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
int test_imm_4Eint16_mem(short *val) {
  return ((*val) & (0x4E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Eint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 78
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timeval {
  long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long milli_time_i(void) {
  struct timeval tv;
  int h = gettimeofday(&tv, NULL);
  assert(!h);
  return (long long)tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<milli_time_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<milli_time_i>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @milli_time_i() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = mul nsw i64 %10, 1000000
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%13 = load i64, i64* %12
%14 = add nsw i64 %11, %13
ret i64 %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @milli_time_i() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%11 = load i64, i64* %10
%12 = add nsw i64 %9, %11
ret i64 %12
}
/* Variables and functions */
scalar_t__ fprintf(int /*<<< orphan*/, char *, int, char *, int);
int /*<<< orphan*/ stdout;
int main(void) {
  int ret = 0;
  while (1) {
    ret +=
        fprintf(stdout, "hello world: %d %%f %s %c\n", ret, "string", (int)'x');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xec7(%rip),%rsi
lea    0xedb(%rip),%rcx
mov    $0x78,%r8d
call   1030 <fprintf@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    0x2ebf(%rip),%r12
lea    0xed8(%rip),%r14
lea    0xeec(%rip),%r15
nop
mov    (%r12),%edi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %r15,%rcx
mov    $0x78,%r8d
call   1030 <fprintf@plt>
add    %ebx,%eax
mov    %eax,%ebx
jmp    1130 <main+0x20>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [27 x i8] c"hello world: %d %%f %s %c\0A\00"
@.str.1 = [7 x i8] c"string\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* @stdout
%5 = load i32, i32* %2
%6 = call i64 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 120)
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = add nsw i64 %8, %6
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
br label %3
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [27 x i8] c"hello world: %d %%f %s %c\0A\00"
@.str.1 = [7 x i8] c"string\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = load i32, i32* @stdout
%4 = tail call i64 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 120)
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
br label %1
}
/* Variables and functions */
int read(int /*<<< orphan*/, char **, int);
int readch() {
  char ch[3];
  int nread;
  nread = read(0, &ch, 3);
  return (nread == 1 ? ch[0] : ch[2]);
}


x86 assembly (clang, -O0):
<readch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rsi
xor    %edi,%edi
mov    $0x3,%edx
call   1030 <read@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <readch+0x31>
movsbl -0x3(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <readch+0x38>
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readch>:
push   %rbx
sub    $0x10,%rsp
lea    0xd(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
lea    0xf(%rsp),%rax
cmove  %rbx,%rax
movsbl (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readch() {
%1 = alloca [3 x i8]
%2 = alloca i32
%3 = bitcast [3 x i8]* %1 to i8**
%4 = call i32 @read(i32 0, i8** %3, i32 3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
br label %15
11: ; preds = %0
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
br label %15
15: ; preds = %11, %7
%16 = phi i32 [ %10, %7 ], [ %14, %11 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @readch() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = bitcast [3 x i8]* %1 to i8**
%4 = call i32 @read(i32 0, i8** %3, i32 3)
%5 = icmp eq i32 %4, 1
%6 = load i8, i8* %2
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
%8 = load i8, i8* %7
%9 = select i1 %5, i8 %6, i8 %8
%10 = sext i8 %9 to i32
ret i32 %10
}
int XSelectInput(void *display, int w, long valuemask) { return 0; }


x86 assembly (clang, -O0):
<XSelectInput>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @XSelectInput(i8* nocapture readnone %0, i32 %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *_hi_realloc(void *ptr, size_t size, const char *name, int line) {
  void *p;
  ;
  p = realloc(ptr, size);
  if (name == NULL && line == 1) {
  }
  return p;
}


x86 assembly (clang, -O0):
<_hi_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1152 <_hi_realloc+0x42>
cmpl   $0x1,-0x1c(%rbp)
jne    1152 <_hi_realloc+0x42>
jmp    1152 <_hi_realloc+0x42>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hi_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @_hi_realloc(i8* nocapture %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %5
}
void EVP_DecryptFinal_ex(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_DecryptFinal_ex() {
ret void
}
char *midstr1(astr, start)
char *astr;
int start;
{
  static char tempstr[255];
  char *startptr;
  strcpy(tempstr, astr);
  startptr = (char *)((long)(tempstr) + start - 1);
  return startptr;
}


x86 assembly (clang, -O0):
<midstr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f16(%rip),%rdi
call   1030 <strcpy@plt>
movslq -0xc(%rbp),%rcx
lea    0x2f06(%rip),%rax
add    %rcx,%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midstr1>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0x2f20(%rip),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
movslq %ebx,%rax
add    %r14,%rax
add    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@midstr1.tempstr = internal global [255 x i8] zeroinitializer
define i8* @midstr1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i8* @strcpy(i8* getelementptr inbounds ([255 x i8], [255 x i8]* @midstr1.tempstr, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = add nsw i64 ptrtoint ([255 x i8]* @midstr1.tempstr to i64), %9
%11 = sub nsw i64 %10, 1
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@midstr1.tempstr = internal global [255 x i8] zeroinitializer
define i8* @midstr1(i8* nocapture %0, i32 %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) getelementptr inbounds ([255 x i8], [255 x i8]* @midstr1.tempstr, i64 0, i64 0), i8* dereferenceable(1) %0)
%4 = sext i32 %1 to i64
%5 = add i64 %4, add (i64 ptrtoint ([255 x i8]* @midstr1.tempstr to i64), i64 -1)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
void *malloc(size_t size) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @malloc(i64 %0) {
ret i8* undef
}
/* Variables and functions */
unsigned char *gen_reach_char(unsigned char *, char);
unsigned char *gen_reach_space(unsigned char *string) {
  return gen_reach_char(string, ' ');
}


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

x86 assembly (clang, -O2):
<gen_reach_space>:
mov    $0x20,%esi
jmp    1030 <gen_reach_char@plt>

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

LLVM IR (-O2):
define i8* @gen_reach_space(i8* %0) {
%2 = tail call i8* @gen_reach_char(i8* %0, i8 signext 32)
ret i8* %2
}
void __attribute__((visibility("default")))
__monstartup(unsigned long low, unsigned long high) {}


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

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

LLVM IR (-O0):
define void @__monstartup(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @__monstartup(i64 %0, i64 %1) {
ret void
}
/* Variables and functions */
scalar_t__ send_command_to_variable_server(int, char *);
int pause(int socket) {
  if (send_command_to_variable_server(socket, "trick.var_pause()") < 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <send_command_to_variable_server@plt>
cmp    $0x0,%rax
jge    1140 <pause+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <pause+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <send_command_to_variable_server@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"trick.var_pause()\00"
define i32 @pause(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @send_command_to_variable_server(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
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 = [18 x i8] c"trick.var_pause()\00"
define i32 @pause(i32 %0) {
%2 = tail call i64 @send_command_to_variable_server(i32 %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
int test_imm_47uint16_reg(unsigned short val) {
  return ((val) & (-0x47 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_47uint16_reg>:
test   $0xffb9,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_47uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -71
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ func(char **);
int main(int argc, char *argv[]) {
  if (argc == 2) {
    func(argv);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1139 <main+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    1122 <main+0x12>
push   %rax
mov    %rsi,%rdi
call   1030 <func@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @func(i8** %1)
br label %6
6: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ble_enable_pin_set_high();
int /*<<< orphan*/ ble_enable_pin_set_low();
int /*<<< orphan*/ ble_wakeup_pin_set_high();
int /*<<< orphan*/ ble_wakeup_pin_set_low();
int /*<<< orphan*/ delay_ms(int);
void ble_reset(void) {
  ble_enable_pin_set_high();
  ble_wakeup_pin_set_high();
  delay_ms((50));
  ble_enable_pin_set_low();
  ble_wakeup_pin_set_low();
  delay_ms((50));
  ble_enable_pin_set_high();
  ble_wakeup_pin_set_high();
  delay_ms((50));
}


x86 assembly (clang, -O0):
<ble_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <ble_enable_pin_set_high@plt>
mov    $0x0,%al
call   1030 <ble_wakeup_pin_set_high@plt>
mov    $0x32,%edi
call   1070 <delay_ms@plt>
mov    $0x0,%al
call   1040 <ble_enable_pin_set_low@plt>
mov    $0x0,%al
call   1050 <ble_wakeup_pin_set_low@plt>
mov    $0x32,%edi
call   1070 <delay_ms@plt>
mov    $0x0,%al
call   1060 <ble_enable_pin_set_high@plt>
mov    $0x0,%al
call   1030 <ble_wakeup_pin_set_high@plt>
mov    $0x32,%edi
call   1070 <delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ble_reset>:
push   %rax
xor    %eax,%eax
call   1060 <ble_enable_pin_set_high@plt>
xor    %eax,%eax
call   1030 <ble_wakeup_pin_set_high@plt>
mov    $0x32,%edi
call   1070 <delay_ms@plt>
xor    %eax,%eax
call   1040 <ble_enable_pin_set_low@plt>
xor    %eax,%eax
call   1050 <ble_wakeup_pin_set_low@plt>
mov    $0x32,%edi
call   1070 <delay_ms@plt>
xor    %eax,%eax
call   1060 <ble_enable_pin_set_high@plt>
xor    %eax,%eax
call   1030 <ble_wakeup_pin_set_high@plt>
mov    $0x32,%edi
pop    %rax
jmp    1070 <delay_ms@plt>

LLVM IR (-O0):
define void @ble_reset() {
%1 = call i32 (...) @ble_enable_pin_set_high()
%2 = call i32 (...) @ble_wakeup_pin_set_high()
%3 = call i32 @delay_ms(i32 50)
%4 = call i32 (...) @ble_enable_pin_set_low()
%5 = call i32 (...) @ble_wakeup_pin_set_low()
%6 = call i32 @delay_ms(i32 50)
%7 = call i32 (...) @ble_enable_pin_set_high()
%8 = call i32 (...) @ble_wakeup_pin_set_high()
%9 = call i32 @delay_ms(i32 50)
ret void
}

LLVM IR (-O2):
define void @ble_reset() {
%1 = tail call i32 (...) @ble_enable_pin_set_high()
%2 = tail call i32 (...) @ble_wakeup_pin_set_high()
%3 = tail call i32 @delay_ms(i32 50)
%4 = tail call i32 (...) @ble_enable_pin_set_low()
%5 = tail call i32 (...) @ble_wakeup_pin_set_low()
%6 = tail call i32 @delay_ms(i32 50)
%7 = tail call i32 (...) @ble_enable_pin_set_high()
%8 = tail call i32 (...) @ble_wakeup_pin_set_high()
%9 = tail call i32 @delay_ms(i32 50)
ret void
}
/* Variables and functions */
unsigned char msg_send2(int, unsigned char, unsigned char);
unsigned char ANT_RequestMessage(unsigned char chan, unsigned char mesg) {
  return msg_send2(0x4d, chan, mesg);
}


x86 assembly (clang, -O0):
<ANT_RequestMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x4d,%edi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
call   1030 <msg_send2@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANT_RequestMessage>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x4d,%edi
jmp    1030 <msg_send2@plt>

LLVM IR (-O0):
define zeroext i8 @ANT_RequestMessage(i8 zeroext %0, i8 zeroext %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* %4
%7 = call zeroext i8 @msg_send2(i32 77, i8 zeroext %5, i8 zeroext %6)
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @ANT_RequestMessage(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call zeroext i8 @msg_send2(i32 77, i8 zeroext %0, i8 zeroext %1)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ print_num(int);
void put_num(int n) {
  print_num(n);
  print(" ");
}


x86 assembly (clang, -O0):
<put_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <print_num@plt>
lea    0xec6(%rip),%rdi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_num>:
push   %rax
call   1040 <print_num@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @put_num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @print_num(i32 %3)
%5 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @put_num(i32 %0) {
%2 = tail call i32 @print_num(i32 %0)
%3 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void yield(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<yield>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yield>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.yield = [6 x i8] c"yield\00"
define void @yield() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.yield, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.yield = [6 x i8] c"yield\00"
define void @yield() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.yield, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ julian_yyyy_mm_dd_to_julian(char *);
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
char *timlib_yyyy_mm_dd_to_julian(char *yyyy_mm_dd) {
  static char julian_string[16];
  sprintf(julian_string, "%.1lf", julian_yyyy_mm_dd_to_julian(yyyy_mm_dd));
  return julian_string;
}


x86 assembly (clang, -O0):
<timlib_yyyy_mm_dd_to_julian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <julian_yyyy_mm_dd_to_julian@plt>
mov    %eax,%edx
lea    0x2f02(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2eef(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_yyyy_mm_dd_to_julian>:
push   %rbx
call   1030 <julian_yyyy_mm_dd_to_julian@plt>
lea    0x2f13(%rip),%rbx
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@timlib_yyyy_mm_dd_to_julian.julian_string = internal global [16 x i8] zeroinitializer
@.str = [6 x i8] c"%.1lf\00"
define i8* @timlib_yyyy_mm_dd_to_julian(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @julian_yyyy_mm_dd_to_julian(i8* %3)
%5 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @timlib_yyyy_mm_dd_to_julian.julian_string, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @timlib_yyyy_mm_dd_to_julian.julian_string, i64 0, i64 0)
}

LLVM IR (-O2):
@timlib_yyyy_mm_dd_to_julian.julian_string = internal global [16 x i8] zeroinitializer
@.str = [6 x i8] c"%.1lf\00"
define i8* @timlib_yyyy_mm_dd_to_julian(i8* %0) {
%2 = tail call i32 @julian_yyyy_mm_dd_to_julian(i8* %0)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @timlib_yyyy_mm_dd_to_julian.julian_string, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @timlib_yyyy_mm_dd_to_julian.julian_string, i64 0, i64 0)
}
/* Type definitions */
struct re_registers {
  int dummy;
};
struct re_pattern_buffer {
  int dummy;
};

/* Variables and functions */
int byte_re_match_2_internal(struct re_pattern_buffer *, void *,
                             int /*<<< orphan*/, char const *, int, int,
                             struct re_registers *, int);
int re_match(struct re_pattern_buffer *bufp, const char *string, int size,
             int pos, struct re_registers *regs) {
  int result;
  result = byte_re_match_2_internal(bufp, (void *)0, 0, string, size, pos, regs,
                                    size);
  return result;
}


x86 assembly (clang, -O0):
<re_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x20(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
xor    %edx,%edx
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <byte_re_match_2_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_match>:
push   %rax
mov    %r8,%rax
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
xor    %esi,%esi
xor    %edx,%edx
push   %r8
push   %rax
call   1030 <byte_re_match_2_internal@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type { i32 }
%struct.re_registers = type { i32 }
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = alloca %struct.re_pattern_buffer*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.re_registers*
%11 = alloca i32
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.re_registers* %4, %struct.re_registers** %10
%12 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load %struct.re_registers*, %struct.re_registers** %10
%17 = load i32, i32* %8
%18 = call i32 @byte_re_match_2_internal(%struct.re_pattern_buffer* %12, i8* null, i32 0, i8* %13, i32 %14, i32 %15, %struct.re_registers* %16, i32 %17)
store i32 %18, i32* %11
%19 = load i32, i32* %11
ret i32 %19
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type { i32 }
%struct.re_registers = type { i32 }
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = tail call i32 @byte_re_match_2_internal(%struct.re_pattern_buffer* %0, i8* null, i32 0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4, i32 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, float, float);
int main() {
  float cost = 12.99;
  float percent = 80.0;
  printf("This copy of \"%s\" sells for $%5.2f.\n"
         "That is %.0f%% of list.\n",
         "War and Peace", cost, percent);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xebe(%rip),%rdi
lea    0xef4(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
lea    0xf26(%rip),%rsi
movss  0xed9(%rip),%xmm0
movss  0xed5(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [61 x i8] c"This copy of \22%s\22 sells for $%5.2f.\0AThat is %.0f%% of list.\0A\00"
@.str.1 = [14 x i8] c"War and Peace\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0x4029FAE140000000, float* %2
store float 8.000000e+01, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), float %4, float %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"This copy of \22%s\22 sells for $%5.2f.\0AThat is %.0f%% of list.\0A\00"
@.str.1 = [14 x i8] c"War and Peace\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), float 0x4029FAE140000000, float 8.000000e+01)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *const, char *);
int /*<<< orphan*/ getchar();
void wait_for(FILE *const fp, int lessmode) {
  if (lessmode) {
    fflush(fp);
    getchar();
  } else
    fprintf(fp, "\n");
  fprintf(fp, "\n");
}


x86 assembly (clang, -O0):
<wait_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115e <wait_for+0x2e>
mov    -0x8(%rbp),%rdi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
jmp    116e <wait_for+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
je     1149 <wait_for+0x19>
mov    %rbx,%rdi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
jmp    1156 <wait_for+0x26>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @wait_for(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @fflush(i32* %0)
%6 = tail call i32 (...) @getchar()
br label %9
7: ; preds = %2
%8 = tail call i32 @fputc(i32 10, i32* %0)
br label %9
9: ; preds = %7, %4
%10 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}