xunge/DecIR huggingface dataset:
unsigned short VDP_getPaletteColor(unsigned short index) {
  volatile unsigned short *pw;
  volatile unsigned long *pl;
  unsigned short addr;
  pw = (unsigned short *)0xC00000;
  pl = (unsigned long *)0xC00004;
  addr = index * 2;
  *pl = ((0x0000 + ((addr)&0x3FFF)) << 16) + (((addr) >> 14) | 0x20);
  return *pw;
}


x86 assembly (clang, -O0):
<VDP_getPaletteColor>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xc00000,%eax
mov    %rax,-0x10(%rbp)
mov    $0xc00004,%eax
mov    %rax,-0x18(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
and    $0x3fff,%eax
add    $0x0,%eax
shl    $0x10,%eax
movzwl -0x1a(%rbp),%ecx
sar    $0xe,%ecx
or     $0x20,%ecx
add    %ecx,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_getPaletteColor>:
lea    (%rdi,%rdi,1),%eax
shl    $0x11,%edi
shr    $0xe,%eax
or     %edi,%eax
and    $0x3ffe0003,%eax
or     $0x20,%eax
mov    %rax,0xc00004
movzwl 0xc00000,%eax
ret

LLVM IR (-O0):
define zeroext i16 @VDP_getPaletteColor(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16*
%4 = alloca i64*
%5 = alloca i16
store i16 %0, i16* %2
store i16* inttoptr (i64 12582912 to i16*), i16** %3
store i64* inttoptr (i64 12582916 to i64*), i64** %4
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = mul nsw i32 %7, 2
%9 = trunc i32 %8 to i16
store i16 %9, i16* %5
%10 = load i16, i16* %5
%11 = zext i16 %10 to i32
%12 = and i32 %11, 16383
%13 = add nsw i32 0, %12
%14 = shl i32 %13, 16
%15 = load i16, i16* %5
%16 = zext i16 %15 to i32
%17 = ashr i32 %16, 14
%18 = or i32 %17, 32
%19 = add nsw i32 %14, %18
%20 = sext i32 %19 to i64
%21 = load i64*, i64** %4
store volatile i64 %20, i64* %21
%22 = load i16*, i16** %3
%23 = load volatile i16, i16* %22
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @VDP_getPaletteColor(i16 zeroext %0) {
%2 = shl i16 %0, 1
%3 = zext i16 %2 to i32
%4 = shl nuw i32 %3, 16
%5 = and i32 %4, 1073610752
%6 = lshr i32 %3, 14
%7 = or i32 %6, %5
%8 = or i32 %7, 32
%9 = zext i32 %8 to i64
store volatile i64 %9, i64* inttoptr (i64 12582916 to i64*)
%10 = load volatile i16, i16* inttoptr (i64 12582912 to i16*)
ret i16 %10
}
double ms2Kmh(const double valueMs) { return valueMs * 3.6; }


x86 assembly (clang, -O0):
<ms2Kmh>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms2Kmh>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ms2Kmh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.600000e+00
ret double %4
}

LLVM IR (-O2):
define double @ms2Kmh(double %0) {
%2 = fmul double %0, 3.600000e+00
ret double %2
}
int pwm_configure(struct pwm_device *pwm, struct pw8058_pwm_config *pwm_conf) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pwm_device = type opaque
%struct.pw8058_pwm_config = type opaque
define i32 @pwm_configure(%struct.pwm_device* %0, %struct.pw8058_pwm_config* %1) {
%3 = alloca %struct.pwm_device*
%4 = alloca %struct.pw8058_pwm_config*
store %struct.pwm_device* %0, %struct.pwm_device** %3
store %struct.pw8058_pwm_config* %1, %struct.pw8058_pwm_config** %4
ret i32 0
}

LLVM IR (-O2):
%struct.pwm_device = type opaque
%struct.pw8058_pwm_config = type opaque
define i32 @pwm_configure(%struct.pwm_device* nocapture readnone %0, %struct.pw8058_pwm_config* nocapture readnone %1) {
ret i32 0
}
int eid_vwr_check_data_validity(const void *photo, int plen,
                                const void *photohash, int hashlen,
                                const void *datafile, int datfilelen,
                                const void *datasig, int datsiglen,
                                const void *addrfile, int addfilelen,
                                const void *addrsig, int addsiglen,
                                const void *rrncert, int certlen) {
  return 1;
}


x86 assembly (clang, -O0):
<eid_vwr_check_data_validity>:
push   %rbp
mov    %rsp,%rbp
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @eid_vwr_check_data_validity(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5, i8* %6, i32 %7, i8* %8, i32 %9, i8* %10, i32 %11, i8* %12, i32 %13) {
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i32
%23 = alloca i8*
%24 = alloca i32
%25 = alloca i8*
%26 = alloca i32
%27 = alloca i8*
%28 = alloca i32
store i8* %0, i8** %15
store i32 %1, i32* %16
store i8* %2, i8** %17
store i32 %3, i32* %18
store i8* %4, i8** %19
store i32 %5, i32* %20
store i8* %6, i8** %21
store i32 %7, i32* %22
store i8* %8, i8** %23
store i32 %9, i32* %24
store i8* %10, i8** %25
store i32 %11, i32* %26
store i8* %12, i8** %27
store i32 %13, i32* %28
ret i32 1
}

LLVM IR (-O2):
define i32 @eid_vwr_check_data_validity(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i32 %5, i8* nocapture readnone %6, i32 %7, i8* nocapture readnone %8, i32 %9, i8* nocapture readnone %10, i32 %11, i8* nocapture readnone %12, i32 %13) {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t modbusWLE(uint8_t *p, uint16_t val) {
  *p = val & 0xff;
  *(p + 1) = val >> 8;
  return val;
}


x86 assembly (clang, -O0):
<modbusWLE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbusWLE>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
mov    %esi,%ecx
sar    $0x8,%ecx
mov    %ecx,0x4(%rdi)
ret

LLVM IR (-O0):
define i32 @modbusWLE(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 = and i32 %5, 255
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @modbusWLE(i32* nocapture writeonly %0, i32 returned %1) {
%3 = and i32 %1, 255
store i32 %3, i32* %0
%4 = ashr i32 %1, 8
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret i32 %1
}
void specks_set_fspeed(struct stuff *st, double newspeed) {}


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

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

LLVM IR (-O0):
%struct.stuff = type opaque
define void @specks_set_fspeed(%struct.stuff* %0, double %1) {
%3 = alloca %struct.stuff*
%4 = alloca double
store %struct.stuff* %0, %struct.stuff** %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
%struct.stuff = type opaque
define void @specks_set_fspeed(%struct.stuff* nocapture %0, double %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: launch_bt [<mode>]. mode=0 (none), 1 (inc_icount), 2 "
         "(shadowmem)\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [73 x i8] c"Usage: launch_bt [<mode>]. mode=0 (none), 1 (inc_icount), 2 (shadowmem)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [72 x i8] c"Usage: launch_bt [<mode>]. mode=0 (none), 1 (inc_icount), 2 (shadowmem)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
long long f(long long a, long long b) { return ((a + b) << 32) >> 32; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
shl    $0x20,%rax
sar    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
add    %edi,%esi
movslq %esi,%rax
ret

LLVM IR (-O0):
define i64 @f(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
%8 = shl i64 %7, 32
%9 = ashr i64 %8, 32
ret i64 %9
}

LLVM IR (-O2):
define i64 @f(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ grt_null_access_error();
void grt_sigsegv_handler(int signo, siginfo_t *info, void *ptr) {
  grt_null_access_error();
}


x86 assembly (clang, -O0):
<grt_sigsegv_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <grt_null_access_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @grt_sigsegv_handler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 (...) @grt_null_access_error()
ret void
}

LLVM IR (-O2):
define void @grt_sigsegv_handler(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @grt_null_access_error()
ret void
}
int test_imm_F4uint32_reg(unsigned int val) {
  return ((val) & (0xF4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F4uint32_reg(i32 %0) {
%2 = and i32 %0, 244
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int extra(char c) {
  if (c == ' ') {
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<extra>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1123 <extra+0x23>
movl   $0x0,-0x4(%rbp)
jmp    112a <extra+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extra>:
xor    %eax,%eax
cmp    $0x20,%dil
setne  %al
ret

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

LLVM IR (-O2):
define i32 @extra(i8 signext %0) {
%2 = icmp ne i8 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void store4(uint8_t *buf, int value) {
  buf[0] = value >> 24;
  buf[1] = value >> 16;
  buf[2] = value >> 8;
  buf[3] = value;
}


x86 assembly (clang, -O0):
<store4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store4>:
mov    %esi,%eax
sar    $0x18,%eax
mov    %eax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @store4(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 = ashr i32 %5, 24
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @store4(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
store i32 %3, i32* %0
%4 = ashr i32 %1, 16
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
%6 = ashr i32 %1, 8
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help(void) {
  printf("[OPTIONS... {COMMAND ...\n\n"
         "   -h --help            Show this help\n"
         "   -v --version         Show package version\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [111 x i8] c"[OPTIONS... {COMMAND ...\0A\0A -h --help Show this help\0A -v --version Show package version\0A\00"
define i32 @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [110 x i8] c"[OPTIONS... {COMMAND ...\0A\0A -h --help Show this help\0A -v --version Show package version\00"
define i32 @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([110 x i8], [110 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *clipper_note_on() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @clipper_note_on() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @clipper_note_on() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
scalar_t__ syscall(int /*<<< orphan*/);
int tid(void) { return (int)syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<tid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @tid() {
%1 = load i32, i32* @SYS_gettid
%2 = call i64 @syscall(i32 %1)
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @tid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i64 @syscall(i32 %1)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int main() {
  int arg1 = 26;
  int shl = 0;
  __asm__("shll $0x2, %%eax;" : "=a"(shl) : "a"(arg1));
  return shl;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1a,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 26, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "shll $$0x2, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "shll $$0x2, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 26)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ PicoFrameStartMode4();
int /*<<< orphan*/ PicoLineMode4(int);
void PicoFrameDrawOnlyMS(void) {
  int lines_vis = 192;
  int y;
  PicoFrameStartMode4();
  for (y = 0; y < lines_vis; y++)
    PicoLineMode4(y);
}


x86 assembly (clang, -O0):
<PicoFrameDrawOnlyMS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <PicoFrameStartMode4@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <PicoFrameDrawOnlyMS+0x3f>
mov    -0x8(%rbp),%edi
call   1030 <PicoLineMode4@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <PicoFrameDrawOnlyMS+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PicoFrameDrawOnlyMS>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <PicoFrameStartMode4@plt>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <PicoLineMode4@plt>
add    $0x1,%ebx
cmp    $0xc0,%ebx
jne    1130 <PicoFrameDrawOnlyMS+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @PicoFrameDrawOnlyMS() {
%1 = alloca i32
%2 = alloca i32
store i32 192, i32* %1
%3 = call i32 (...) @PicoFrameStartMode4()
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @PicoLineMode4(i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @PicoFrameDrawOnlyMS() {
%1 = tail call i32 (...) @PicoFrameStartMode4()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @PicoLineMode4(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 192
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bye() { printf("bye :)\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"bye :)\00"
define void @bye() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_printf(char *, char *, int, char);
int /*<<< orphan*/ printf(char *, char *, int, char);
int main() {
  char str[] = "Hello";
  char c;
  int i;
  c = '!';
  i = 100;
  ft_printf("%s world.\n%d %% same %c\n", str, i, c);
  printf("%s world.\n%d %% same %c\n", str, i, c);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
movb   $0x21,-0xb(%rbp)
movl   $0x64,-0x10(%rbp)
lea    -0xa(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xeaa(%rip),%rdi
movsbl -0xb(%rbp),%ecx
call   1040 <ft_printf@plt>
lea    -0xa(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xe93(%rip),%rdi
movsbl -0xb(%rbp),%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movw   $0x6f,0x4(%rsp)
movl   $0x6c6c6548,(%rsp)
lea    0xecd(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x64,%edx
mov    $0x21,%ecx
call   1040 <ft_printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x64,%edx
mov    $0x21,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str = [6 x i8] c"Hello\00"
@.str = [25 x i8] c"%s world.\0A%d %% same %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i8]* %2 to i8*
store i8 33, i8* %3
store i32 100, i32* %4
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* %4
%8 = load i8, i8* %3
%9 = call i32 @ft_printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7, i8 signext %8)
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* %4
%12 = load i8, i8* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8 signext %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [6 x i8] c"Hello\00"
@.str = [25 x i8] c"%s world.\0A%d %% same %c\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @ft_printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %2, i32 100, i8 signext 33)
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %2, i32 100, i8 signext 33)
ret i32 0
}
int emac1_ifinucastpkts_set(unsigned int dev_id,
                            union emac1_ifinucastpkts_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac1_ifinucastpkts_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac1_ifinucastpkts_u = type opaque
define i32 @emac1_ifinucastpkts_set(i32 %0, %union.emac1_ifinucastpkts_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_ifinucastpkts_u*
store i32 %0, i32* %3
store %union.emac1_ifinucastpkts_u* %1, %union.emac1_ifinucastpkts_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_ifinucastpkts_u = type opaque
define i32 @emac1_ifinucastpkts_set(i32 %0, %union.emac1_ifinucastpkts_u* nocapture readnone %1) {
ret i32 1
}
int test_imm_63uint32_reg(unsigned int val) {
  return ((val) & (0x63 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_63uint32_reg(i32 %0) {
%2 = and i32 %0, 99
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int _sys_strlen(char s[]) {
  int i = 0;
  while (s[i] != '\0') {
    ++i;
  }
  return i;
}


x86 assembly (clang, -O0):
<_sys_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <_sys_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <_sys_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sys_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <_sys_strlen+0x10>
ret

LLVM IR (-O0):
define i32 @_sys_strlen(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 = sext 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 %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @_sys_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct termios *);
void *termios_KillTermios(struct termios *p) {
  free(p);
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.termios = type { i32 }
define i8* @termios_KillTermios(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = call i32 @free(%struct.termios* %3)
ret i8* null
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define noalias i8* @termios_KillTermios(%struct.termios* nocapture %0) {
%2 = tail call i32 @free(%struct.termios* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
unsigned int sleep(unsigned int seconds) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "sleep");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xeea(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"sleep\00"
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @assert(i32 0)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"sleep\00"
define i32 @sleep(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Type definitions */
struct sift_keypoint_std {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf_keypoint_std(int /*<<< orphan*/ *,
                                        struct sift_keypoint_std const *, int);
void sift_write_to_file(const char *filename, const struct sift_keypoint_std *k,
                        int n) {
  FILE *file = fopen(filename, "w");
  fprintf_keypoint_std(file, k, n);
  fclose(file);
}


x86 assembly (clang, -O0):
<sift_write_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <fprintf_keypoint_std@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sift_write_to_file>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <fprintf_keypoint_std@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
%struct.sift_keypoint_std = type { i32 }
@.str = [2 x i8] c"w\00"
define void @sift_write_to_file(i8* %0, %struct.sift_keypoint_std* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.sift_keypoint_std*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store %struct.sift_keypoint_std* %1, %struct.sift_keypoint_std** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = load %struct.sift_keypoint_std*, %struct.sift_keypoint_std** %5
%12 = load i32, i32* %6
%13 = call i32 @fprintf_keypoint_std(i32* %10, %struct.sift_keypoint_std* %11, i32 %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
%struct.sift_keypoint_std = type { i32 }
@.str = [2 x i8] c"w\00"
define void @sift_write_to_file(i8* nocapture %0, %struct.sift_keypoint_std* %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fprintf_keypoint_std(i32* %4, %struct.sift_keypoint_std* %1, i32 %2)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
int next(int x) { return x + (x & (-x)); }


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    %edx,%edx
sub    -0x4(%rbp),%edx
and    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @next(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = add nsw i32 %3, %0
ret i32 %4
}
int popup_ignore_func(const struct cmd_info *ci) { return 1; }


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

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

LLVM IR (-O0):
%struct.cmd_info = type opaque
define i32 @popup_ignore_func(%struct.cmd_info* %0) {
%2 = alloca %struct.cmd_info*
store %struct.cmd_info* %0, %struct.cmd_info** %2
ret i32 1
}

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @popup_ignore_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
unsigned char *aes192ecb_encrypt(unsigned char *, size_t *,
                                 unsigned char const *, size_t,
                                 unsigned char const *, unsigned char const *);
unsigned char *crypt_encrypt_aes192ecb(unsigned char *out, size_t *out_len,
                                       const unsigned char *in, size_t in_len,
                                       const unsigned char *nonce,
                                       const unsigned char *key) {
  return aes192ecb_encrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_encrypt_aes192ecb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <aes192ecb_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_encrypt_aes192ecb>:
jmp    1030 <aes192ecb_encrypt@plt>

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

LLVM IR (-O2):
define i8* @crypt_encrypt_aes192ecb(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @aes192ecb_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
int gt_ht_ul_cmp(unsigned long a, unsigned long b) {
  return (int)(a > b) - (int)(a < b);
}


x86 assembly (clang, -O0):
<gt_ht_ul_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
cmp    -0x10(%rbp),%rcx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_ht_ul_cmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @gt_ht_ul_cmp(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
%8 = zext i1 %7 to i32
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @gt_ht_ul_cmp(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = zext i1 %3 to i32
%5 = icmp ult i64 %0, %1
%6 = sext i1 %5 to i32
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int foo(int);
int main(int argc, char **argv) { return foo(argc); }


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)
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <foo@plt>

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 = call i32 @foo(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0)
ret i32 %3
}
/* Variables and functions */
int VOLUME_MOD_TO_GB(int);
int VOLUME_MOD_TO_GB_CH3(int v) {
  int vol = VOLUME_MOD_TO_GB(v);
  switch (vol) {
  case 0:
  case 1:
  case 2:
  case 3:
    return 0;
  case 4:
  case 5:
  case 6:
  case 7:
    return 3;
  case 8:
  case 9:
  case 10:
  case 11:
    return 2;
  default:
  case 12:
  case 13:
  case 14:
  case 15:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<VOLUME_MOD_TO_GB_CH3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <VOLUME_MOD_TO_GB@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0xf,%rax
ja     116f <VOLUME_MOD_TO_GB_CH3+0x5f>
mov    -0x18(%rbp),%rax
lea    0xebe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    117b <VOLUME_MOD_TO_GB_CH3+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    117b <VOLUME_MOD_TO_GB_CH3+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    117b <VOLUME_MOD_TO_GB_CH3+0x6b>
jmp    1174 <VOLUME_MOD_TO_GB_CH3+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VOLUME_MOD_TO_GB_CH3>:
push   %rax
call   1030 <VOLUME_MOD_TO_GB@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xb,%ecx
ja     112f <VOLUME_MOD_TO_GB_CH3+0x1f>
movslq %ecx,%rax
lea    0xed4(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @VOLUME_MOD_TO_GB_CH3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @VOLUME_MOD_TO_GB(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
switch i32 %7, label %11 [
i32 0, label %8
i32 1, label %8
i32 2, label %8
i32 3, label %8
i32 4, label %9
i32 5, label %9
i32 6, label %9
i32 7, label %9
i32 8, label %10
i32 9, label %10
i32 10, label %10
i32 11, label %10
i32 12, label %12
i32 13, label %12
i32 14, label %12
i32 15, label %12
]
8: ; preds = %1, %1, %1, %1
store i32 0, i32* %2
br label %13
9: ; preds = %1, %1, %1, %1
store i32 3, i32* %2
br label %13
10: ; preds = %1, %1, %1, %1
store i32 2, i32* %2
br label %13
11: ; preds = %1
br label %12
12: ; preds = %1, %1, %1, %1, %11
store i32 1, i32* %2
br label %13
13: ; preds = %12, %10, %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.VOLUME_MOD_TO_GB_CH3 = [12 x i32] [i32 0, i32 0, i32 0, i32 0, i32 3, i32 3, i32 3, i32 3, i32 2, i32 2, i32 2, i32 2]
define i32 @VOLUME_MOD_TO_GB_CH3(i32 %0) {
%2 = tail call i32 @VOLUME_MOD_TO_GB(i32 %0)
%3 = icmp ult i32 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.VOLUME_MOD_TO_GB_CH3, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
char const *m_stristrn(char const *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ m_strlen(char const *);
const char *m_stristr(const char *haystack, const char *needle) {
  return m_stristrn(haystack, needle, m_strlen(needle));
}


x86 assembly (clang, -O0):
<m_stristr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <m_strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <m_stristrn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_stristr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <m_strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <m_stristrn@plt>

LLVM IR (-O0):
define i8* @m_stristr(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** %4
%7 = load i8*, i8** %4
%8 = call i32 @m_strlen(i8* %7)
%9 = call i8* @m_stristrn(i8* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @m_stristr(i8* %0, i8* %1) {
%3 = tail call i32 @m_strlen(i8* %1)
%4 = tail call i8* @m_stristrn(i8* %0, i8* %1, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void str_free(char *s) { free(s); }


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

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

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

LLVM IR (-O2):
define void @str_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int UINT64_C(int);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t now(void) {
  struct timespec ts = {0, 0};
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * UINT64_C(1000000000) + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x3b9aca00,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
cltq
add    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <clock_gettime@plt>
movslq (%rsp),%rbx
mov    $0x3b9aca00,%edi
call   1030 <UINT64_C@plt>
cltq
imul   %rbx,%rax
add    0x8(%rsp),%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64, i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @UINT64_C(i32 1000000000)
%8 = mul nsw i32 %6, %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64, i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @UINT64_C(i32 1000000000)
%8 = mul nsw i32 %7, %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %11, %9
ret i64 %12
}
int test_imm_14int8_mem(signed char *val) {
  return ((*val) & (-0x14 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_14int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -20
%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_14int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -20
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x37() {
  Assert_real((ispunct(55) == 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_ispunct.c",
              280, ("ispunct should be 0 for 7"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x37>:
push   %rax
mov    $0x37,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x118,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for 7\00"
define void @t_ispunct_0x37() {
%1 = tail call i64 @ispunct(i32 55)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void spiralSetName() {}


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

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

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

LLVM IR (-O2):
define void @spiralSetName() {
ret void
}
void foo(char *a, char *b, char *c, char *d) {}


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

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

LLVM IR (-O0):
define void @foo(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
void _M2_wallh_finish(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_wallh_finish(i32 %0, i8** nocapture %1) {
ret void
}