xunge/DecIR huggingface dataset:
/* Type definitions */
struct sqlConnection {
  int dummy;
};
typedef int /*<<< orphan*/ query;

/* Variables and functions */
char *sqlQuickString(struct sqlConnection *, char *);
int /*<<< orphan*/ sqlSafef(char *, int, char *, int);
char *visiGeneBodyPart(struct sqlConnection *conn, int id) {
  char query[256];
  sqlSafef(query, sizeof(query),
           "select bodyPart.name from image,specimen,bodyPart "
           "where image.id = %d "
           "and image.specimen = specimen.id "
           "and specimen.bodyPart = bodyPart.id",
           id);
  return sqlQuickString(conn, query);
}


x86 assembly (clang, -O0):
<visiGeneBodyPart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x100,%esi
lea    0xeb8(%rip),%rdx
call   1040 <sqlSafef@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <sqlQuickString@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneBodyPart>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xeca(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1040 <sqlSafef@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <sqlQuickString@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [139 x i8] c"select bodyPart.name from image,specimen,bodyPart where image.id = %d and image.specimen = specimen.id and specimen.bodyPart = bodyPart.id\00"
define i8* @visiGeneBodyPart(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
%5 = alloca [256 x i8]
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sqlSafef(i8* %6, i32 256, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i8* @sqlQuickString(%struct.sqlConnection* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [139 x i8] c"select bodyPart.name from image,specimen,bodyPart where image.id = %d and image.specimen = specimen.id and specimen.bodyPart = bodyPart.id\00"
define i8* @visiGeneBodyPart(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sqlSafef(i8* %4, i32 256, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i8* @sqlQuickString(%struct.sqlConnection* %0, i8* %4)
ret i8* %6
}
void ff_hevc_v_loop_filter_luma_8_avx() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_v_loop_filter_luma_8_avx() {
ret void
}
char get_top_paren() {
  extern int paren_stack_top;
  extern char paren_stack[];
  if (paren_stack_top == 0) {
    return ' ';
  } else {
    return paren_stack[paren_stack_top - 1];
  }
}


x86 assembly (clang, -O0):
<get_top_paren>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
cmpl   $0x0,(%rax)
jne    111d <get_top_paren+0x1d>
movb   $0x20,-0x1(%rbp)
jmp    1139 <get_top_paren+0x39>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
movslq %eax,%rcx
mov    0x2ebd(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_top_paren>:
mov    0x2ed1(%rip),%rax
movslq (%rax),%rax
test   %rax,%rax
je     111b <get_top_paren+0x1b>
mov    0x2eda(%rip),%rcx
mov    -0x1(%rax,%rcx,1),%al
ret
mov    $0x20,%al
ret

LLVM IR (-O0):
@paren_stack_top = external global i32
@paren_stack = external global [0 x i8]
define signext i8 @get_top_paren() {
%1 = alloca i8
%2 = load i32, i32* @paren_stack_top
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8 32, i8* %1
br label %11
5: ; preds = %0
%6 = load i32, i32* @paren_stack_top
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [0 x i8], [0 x i8]* @paren_stack, i64 0, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %1
br label %11
11: ; preds = %5, %4
%12 = load i8, i8* %1
ret i8 %12
}

LLVM IR (-O2):
@paren_stack_top = external global i32
@paren_stack = external global [0 x i8]
define signext i8 @get_top_paren() {
%1 = load i32, i32* @paren_stack_top
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @paren_stack, i64 0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %0, %3
%9 = phi i8 [ %7, %3 ], [ 32, %0 ]
ret i8 %9
}
int test_imm_95int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x95 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_95int64_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, 149
%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_95int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 639950127104
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double f4(void) { return 0; }


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

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

LLVM IR (-O0):
define double @f4() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @f4() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ Delay_ms(int);
int /*<<< orphan*/ UART1_Init(int);
void init_serial_comm() {
  UART1_Init(115200);
  Delay_ms(200);
}


x86 assembly (clang, -O0):
<init_serial_comm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c200,%edi
call   1030 <UART1_Init@plt>
mov    $0xc8,%edi
call   1040 <Delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_serial_comm>:
push   %rax
mov    $0x1c200,%edi
call   1030 <UART1_Init@plt>
mov    $0xc8,%edi
pop    %rax
jmp    1040 <Delay_ms@plt>

LLVM IR (-O0):
define void @init_serial_comm() {
%1 = call i32 @UART1_Init(i32 115200)
%2 = call i32 @Delay_ms(i32 200)
ret void
}

LLVM IR (-O2):
define void @init_serial_comm() {
%1 = tail call i32 @UART1_Init(i32 115200)
%2 = tail call i32 @Delay_ms(i32 200)
ret void
}
/* Variables and functions */
scalar_t__ unknown1();
int unknown2();
int main() {
  int k = 1;
  int w = 1;
  while (unknown1()) {
    int z = unknown2();
    if (z > 5)
      w++;
    k += w;
  }
  if (k <= 0) {
    goto ERROR;
  ERROR:;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0x0,%al
call   1030 <unknown1@plt>
cmp    $0x0,%rax
je     1179 <main+0x59>
mov    $0x0,%al
call   1040 <unknown2@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jle    116b <main+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
cmpl   $0x0,-0x8(%rbp)
jg     118d <main+0x6d>
jmp    1188 <main+0x68>
jmp    118d <main+0x6d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <unknown1@plt>
test   %rax,%rax
je     1145 <main+0x25>
xor    %eax,%eax
call   1040 <unknown2@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %15, %0
%6 = call i64 (...) @unknown1()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = call i32 (...) @unknown2()
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 5
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %8
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = add nsw i32 %17, %16
store i32 %18, i32* %2
br label %5
19: ; preds = %5
%20 = load i32, i32* %2
%21 = icmp sle i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23, %19
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @unknown1()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @unknown2()
%5 = tail call i64 (...) @unknown1()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_event_source_get_time(void *s, uint64_t *usec) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_event_source_get_time>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_source_get_time(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_source_get_time(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int is_protocol_valid(int protocol) {
  int ret = 0;
  switch (protocol) {
  case 1:
  case 2:
  case 8:
  case 32:
  case 40:
    ret = 1;
    break;
  default:
    printf("ERR: Invalid Protocol: %d\n", protocol);
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<is_protocol_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     116c <is_protocol_valid+0x5c>
jmp    1139 <is_protocol_valid+0x29>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
je     116c <is_protocol_valid+0x5c>
jmp    114a <is_protocol_valid+0x3a>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     116c <is_protocol_valid+0x5c>
jmp    115b <is_protocol_valid+0x4b>
mov    -0xc(%rbp),%eax
sub    $0x28,%eax
jne    1178 <is_protocol_valid+0x68>
jmp    116c <is_protocol_valid+0x5c>
movl   $0x1,-0x8(%rbp)
jmp    1187 <is_protocol_valid+0x77>
mov    -0x4(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_protocol_valid>:
mov    %edi,%esi
cmp    $0x28,%edi
ja     112f <is_protocol_valid+0x1f>
mov    $0x1,%eax
mov    %esi,%ecx
movabs $0x10100000106,%rdx
bt     %rcx,%rdx
jae    112f <is_protocol_valid+0x1f>
ret
push   %rax
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"ERR: Invalid Protocol: %d\0A\00"
define i32 @is_protocol_valid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 1, label %5
i32 2, label %5
i32 8, label %5
i32 32, label %5
i32 40, label %5
]
5: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [27 x i8] c"ERR: Invalid Protocol: %d\0A\00"
define i32 @is_protocol_valid(i32 %0) {
switch i32 %0, label %2 [
i32 1, label %4
i32 2, label %4
i32 8, label %4
i32 32, label %4
i32 40, label %4
]
2: ; preds = %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %4
4: ; preds = %1, %1, %1, %1, %1, %2
%5 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
int cinterp(double a, int bg, int fg) {
  int result;
  result = (int)((1 - a) * bg + a * fg + 0.5);
  if (result < 0)
    result = 0;
  if (result > 255)
    result = 255;
  return result;
}


x86 assembly (clang, -O0):
<cinterp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movsd  0xef1(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
cvtsi2sdl -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115b <cinterp+0x5b>
movl   $0x0,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
jle    116f <cinterp+0x6f>
movl   $0xff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cinterp>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
cvtsi2sd %edi,%xmm2
mulsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
addsd  0xedd(%rip),%xmm1
cvttsd2si %xmm1,%eax
xor    %ecx,%ecx
test   %eax,%eax
cmovns %eax,%ecx
cmp    $0xff,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cinterp(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load double, double* %4
%9 = fsub double 1.000000e+00, %8
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = load double, double* %4
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to double
%15 = fmul double %12, %14
%16 = call double @llvm.fmuladd.f64(double %9, double %11, double %15)
%17 = fadd double %16, 5.000000e-01
%18 = fptosi double %17 to i32
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %3
store i32 0, i32* %7
br label %22
22: ; preds = %21, %3
%23 = load i32, i32* %7
%24 = icmp sgt i32 %23, 255
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 255, i32* %7
br label %26
26: ; preds = %25, %22
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @cinterp(double %0, i32 %1, i32 %2) {
%4 = fsub double 1.000000e+00, %0
%5 = sitofp i32 %1 to double
%6 = sitofp i32 %2 to double
%7 = fmul double %6, %0
%8 = tail call double @llvm.fmuladd.f64(double %4, double %5, double %7)
%9 = fadd double %8, 5.000000e-01
%10 = fptosi double %9 to i32
%11 = icmp sgt i32 %10, 0
%12 = select i1 %11, i32 %10, i32 0
%13 = icmp ult i32 %12, 255
%14 = select i1 %13, i32 %12, i32 255
ret i32 %14
}
int is_shard(unsigned a[1]) {
  if ((a[0] & 0x7F800000) == 0x7F800000)
    return 1;
  if ((a[0] & 0x7F800000) == 0 && (a[0] & 0x7FFFFFFF) != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_shard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x7f800000,%eax
cmp    $0x7f800000,%eax
jne    112a <is_shard+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1165 <is_shard+0x65>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x7f800000,%eax
cmp    $0x0,%eax
jne    115e <is_shard+0x5e>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x7fffffff,%eax
cmp    $0x0,%eax
je     115e <is_shard+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <is_shard+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_shard>:
mov    (%rdi),%ecx
mov    %ecx,%edx
and    $0x7f800000,%edx
mov    $0x1,%eax
cmp    $0x7f800000,%edx
je     1123 <is_shard+0x23>
test   %edx,%edx
jne    1124 <is_shard+0x24>
test   $0x7fffffff,%ecx
je     1124 <is_shard+0x24>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_shard(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = and i32 %6, 2139095040
%8 = icmp eq i32 %7, 2139095040
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %24
10: ; preds = %1
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = and i32 %13, 2139095040
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %10
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = and i32 %19, 2147483647
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 1, i32* %2
br label %24
23: ; preds = %16, %10
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22, %9
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_shard(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 2139095040
switch i32 %3, label %7 [
i32 2139095040, label %8
i32 0, label %4
]
4: ; preds = %1
%5 = and i32 %2, 2147483647
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1, %4
br label %8
8: ; preds = %4, %1, %7
%9 = phi i32 [ 0, %7 ], [ 1, %1 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
unsigned long nibble_sort_word(unsigned long);
void nibble_sort_bloom(unsigned long *buf) {
  int i;
  for (i = 0; i < 1024; i++) {
    buf[i] = nibble_sort_word(buf[i]);
  }
}


x86 assembly (clang, -O0):
<nibble_sort_bloom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    115e <nibble_sort_bloom+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <nibble_sort_word@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <nibble_sort_bloom+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_bloom>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <nibble_sort_word@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1120 <nibble_sort_bloom+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @nibble_sort_bloom(i64* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i64, i64* %0, i64 %3
%5 = load i64, i64* %4
%6 = tail call i64 @nibble_sort_word(i64 %5)
store i64 %6, i64* %4
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 1024
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
int yas_mma8452q_read_reg_byte(int);
int /*<<< orphan*/ yas_mma8452q_write_reg_byte(int, int);
int yas_mma8452q_power_down(void) {
  yas_mma8452q_write_reg_byte(
      0x0f, ((yas_mma8452q_read_reg_byte(0x0f) & ~0x10) | ((0) << 4)));
  yas_mma8452q_write_reg_byte(
      0x2a, ((yas_mma8452q_read_reg_byte(0x2a) & ~0x01) | ((0) << 0)));
  return (0);
}


x86 assembly (clang, -O0):
<yas_mma8452q_power_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1040 <yas_mma8452q_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffffef,%esi
or     $0x0,%esi
mov    $0xf,%edi
call   1030 <yas_mma8452q_write_reg_byte@plt>
mov    $0x2a,%edi
call   1040 <yas_mma8452q_read_reg_byte@plt>
mov    %eax,%esi
and    $0xfffffffe,%esi
or     $0x0,%esi
mov    $0x2a,%edi
call   1030 <yas_mma8452q_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_mma8452q_power_down>:
push   %rax
mov    $0xf,%edi
call   1040 <yas_mma8452q_read_reg_byte@plt>
and    $0xffffffef,%eax
mov    $0xf,%edi
mov    %eax,%esi
call   1030 <yas_mma8452q_write_reg_byte@plt>
mov    $0x2a,%edi
call   1040 <yas_mma8452q_read_reg_byte@plt>
and    $0xfffffffe,%eax
mov    $0x2a,%edi
mov    %eax,%esi
call   1030 <yas_mma8452q_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_mma8452q_power_down() {
%1 = call i32 @yas_mma8452q_read_reg_byte(i32 15)
%2 = and i32 %1, -17
%3 = or i32 %2, 0
%4 = call i32 @yas_mma8452q_write_reg_byte(i32 15, i32 %3)
%5 = call i32 @yas_mma8452q_read_reg_byte(i32 42)
%6 = and i32 %5, -2
%7 = or i32 %6, 0
%8 = call i32 @yas_mma8452q_write_reg_byte(i32 42, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_mma8452q_power_down() {
%1 = tail call i32 @yas_mma8452q_read_reg_byte(i32 15)
%2 = and i32 %1, -17
%3 = tail call i32 @yas_mma8452q_write_reg_byte(i32 15, i32 %2)
%4 = tail call i32 @yas_mma8452q_read_reg_byte(i32 42)
%5 = and i32 %4, -2
%6 = tail call i32 @yas_mma8452q_write_reg_byte(i32 42, i32 %5)
ret i32 0
}
int computeFFTsize16(int dataSize) {
  int mod = dataSize / 16;
  int rem = dataSize % 16;
  return (mod * 16) + ((rem > 0) ? 16 : 0);
}


x86 assembly (clang, -O0):
<computeFFTsize16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    -0xc(%rbp),%esi
xor    %ecx,%ecx
mov    $0x10,%edx
cmp    $0x0,%esi
cmovg  %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeFFTsize16>:
lea    0xf(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xfffffff0,%ecx
xor    %eax,%eax
test   $0x8000000f,%edi
setg   %al
shl    $0x4,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @computeFFTsize16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 16
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 16
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 16
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 16, i32 0
%15 = add nsw i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @computeFFTsize16(i32 %0) {
%2 = sdiv i32 %0, 16
%3 = shl nsw i32 %2, 4
%4 = and i32 %0, -2147483633
%5 = icmp sgt i32 %4, 0
%6 = select i1 %5, i32 16, i32 0
%7 = add nsw i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ function();
int /*<<< orphan*/ printf(char *, int);
int sub(int, int);
int main() {
  function();
  printf("%d\n", add(1, 2));
  printf("%d\n", sub(5, 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <function@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1060 <sub@plt>
mov    %eax,%esi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <function@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
lea    0xea2(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1060 <sub@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 (...) @function()
%2 = call i32 @add(i32 1, i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @sub(i32 5, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @function()
%2 = tail call i32 @add(i32 1, i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sub(i32 5, i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void base_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<base_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):
<base_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @base_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 @base_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_0Dint64_midword_reg(long long val) {
  return ((val >> 16) & (0x0D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Dint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 13
%6 = icmp ne i64 %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_0Dint64_midword_reg(i64 %0) {
%2 = and i64 %0, 851968
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test2() {
  int i;
  int b[10];
  int *p = b;
  for (i = 0; i < 10; i++)
    *p++ = i;
  return 0;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    113f <test2+0x3f>
mov    -0x4(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x38(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1113 <test2+0x13>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ list_recursive(char *);
int main(int argc, char **argv) {
  list_recursive(argc > 1 ? argv[1] : "/");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1141 <main+0x31>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <main+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <main+0x41>
mov    -0x18(%rbp),%rdi
call   1030 <list_recursive@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     111c <main+0xc>
mov    0x8(%rsi),%rdi
jmp    1123 <main+0x13>
lea    0xedd(%rip),%rdi
call   1030 <list_recursive@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
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 sgt i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %8
%14 = phi i8* [ %11, %8 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %12 ]
%15 = call i32 @list_recursive(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @list_recursive(i8* %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_be16(int, int /*<<< orphan*/ *);
void __put_unaligned_be32(uint32_t val, uint8_t *p) {
  __put_unaligned_be16(val >> 16, p);
  __put_unaligned_be16(val, p + 2);
}


x86 assembly (clang, -O0):
<__put_unaligned_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
mov    -0x10(%rbp),%rsi
call   1030 <__put_unaligned_be16@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <__put_unaligned_be16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_be32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
call   1030 <__put_unaligned_be16@plt>
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_be16@plt>

LLVM IR (-O0):
define void @__put_unaligned_be32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 16
%7 = load i32*, i32** %4
%8 = call i32 @__put_unaligned_be16(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = call i32 @__put_unaligned_be16(i32 %9, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_be32(i32 %0, i32* %1) {
%3 = ashr i32 %0, 16
%4 = tail call i32 @__put_unaligned_be16(i32 %3, i32* %1)
%5 = getelementptr inbounds i32, i32* %1, i64 2
%6 = tail call i32 @__put_unaligned_be16(i32 %0, i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FileExists(char *);
int /*<<< orphan*/ eFree(char *);
char *popString();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basFileExists() {
  char *fname;
  fname = popString();
  pushNumber(FileExists(fname));
  eFree(fname);
}


x86 assembly (clang, -O0):
<basFileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <popString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <FileExists@plt>
mov    %eax,%edi
call   1050 <pushNumber@plt>
mov    -0x8(%rbp),%rdi
call   1030 <eFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basFileExists>:
push   %rbx
xor    %eax,%eax
call   1040 <popString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <FileExists@plt>
mov    %eax,%edi
call   1050 <pushNumber@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <eFree@plt>

LLVM IR (-O0):
define void @basFileExists() {
%1 = alloca i8*
%2 = call i8* (...) @popString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @FileExists(i8* %3)
%5 = call i32 @pushNumber(i32 %4)
%6 = load i8*, i8** %1
%7 = call i32 @eFree(i8* %6)
ret void
}

LLVM IR (-O2):
define void @basFileExists() {
%1 = tail call i8* (...) @popString()
%2 = tail call i32 @FileExists(i8* %1)
%3 = tail call i32 @pushNumber(i32 %2)
%4 = tail call i32 @eFree(i8* %1)
ret void
}
void power_info_eeprom_9287(struct edump *edump) {}


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

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

LLVM IR (-O0):
%struct.edump = type opaque
define void @power_info_eeprom_9287(%struct.edump* %0) {
%2 = alloca %struct.edump*
store %struct.edump* %0, %struct.edump** %2
ret void
}

LLVM IR (-O2):
%struct.edump = type opaque
define void @power_info_eeprom_9287(%struct.edump* nocapture %0) {
ret void
}
load_map() {}


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

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

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

LLVM IR (-O2):
define i32 @load_map() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ mem_remap_top(int);
void mem_remap_top_384k() { mem_remap_top(384); }


x86 assembly (clang, -O0):
<mem_remap_top_384k>:
push   %rbp
mov    %rsp,%rbp
mov    $0x180,%edi
call   1030 <mem_remap_top@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_remap_top_384k>:
mov    $0x180,%edi
jmp    1030 <mem_remap_top@plt>

LLVM IR (-O0):
define void @mem_remap_top_384k() {
%1 = call i32 @mem_remap_top(i32 384)
ret void
}

LLVM IR (-O2):
define void @mem_remap_top_384k() {
%1 = tail call i32 @mem_remap_top(i32 384)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xb7() {
  Assert_real((isprint(183) == 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_isprint.c",
              920, ("isprint should be 0 for 0xb7"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xb7>:
push   %rax
mov    $0xb7,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x398,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb7\00"
define void @t_isprint_0xb7() {
%1 = call i64 @isprint(i32 183)
%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 920, i8* getelementptr inbounds ([29 x i8], [29 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb7\00"
define void @t_isprint_0xb7() {
%1 = tail call i64 @isprint(i32 183)
%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 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void write_nothingh() {}


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

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

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

LLVM IR (-O2):
define void @write_nothingh() {
ret void
}
int test_enqueueing() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @test_enqueueing() {
ret i32 1
}
/* Variables and functions */
int foo();
int main(int argc, char *argv[]) { return foo(); }


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    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
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 = call i32 (...) @foo()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char const *);
void test_assert(int value, const char *msg) {
  if (value == 0) {
    printf("      ASSERT: %s\n  FAIL\n------ test end ------\n\n", msg);
    abort();
  } else {
    printf("      OK: %s\n", msg);
  }
}


x86 assembly (clang, -O0):
<test_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1150 <test_assert+0x30>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert>:
test   %edi,%edi
je     1130 <test_assert+0x10>
lea    0xf06(%rip),%rdi
jmp    1040 <printf@plt>
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [49 x i8] c" ASSERT: %s\0A FAIL\0A------ test end ------\0A\0A\00"
@.str.1 = [14 x i8] c" OK: %s\0A\00"
define void @test_assert(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c" ASSERT: %s\0A FAIL\0A------ test end ------\0A\0A\00"
@.str.1 = [14 x i8] c" OK: %s\0A\00"
define void @test_assert(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safe_free(void *in_ppT) {
  if (in_ppT != NULL) {
    free(*(void **)in_ppT);
    *(void **)in_ppT = NULL;
  }
}


x86 assembly (clang, -O0):
<safe_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <safe_free+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_free>:
test   %rdi,%rdi
je     1129 <safe_free+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @safe_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = call i32 @free(i8* %8)
%10 = load i8*, i8** %2
%11 = bitcast i8* %10 to i8**
store i8* null, i8** %11
br label %12
12: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @safe_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = tail call i32 @free(i8* %5)
store i8* null, i8** %4
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ err_exit(char *);
scalar_t__ fchmod(int, int /*<<< orphan*/);
void _fchmod(int fd, mode_t m) {
  if (fchmod(fd, m) < 0)
    err_exit("_fchmod");
}


x86 assembly (clang, -O0):
<_fchmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <fchmod@plt>
cmp    $0x0,%rax
jge    114f <_fchmod+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <err_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fchmod>:
push   %rax
call   1040 <fchmod@plt>
test   %rax,%rax
js     112d <_fchmod+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_exit@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"_fchmod\00"
define void @_fchmod(i32 %0, i32 %1) {
%3 = tail call i64 @fchmod(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_exit(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
struct i2c_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ i2c_detach_client(struct i2c_client *);
int /*<<< orphan*/ kfree(struct i2c_client *);
int alc5628_detach(struct i2c_client *c) {
  i2c_detach_client(c);
  kfree(c);
  return 0;
}


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

x86 assembly (clang, -O2):
<alc5628_detach>:
push   %rbx
mov    %rdi,%rbx
call   1040 <i2c_detach_client@plt>
mov    %rbx,%rdi
call   1030 <kfree@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.i2c_client = type { i32 }
define i32 @alc5628_detach(%struct.i2c_client* %0) {
%2 = alloca %struct.i2c_client*
store %struct.i2c_client* %0, %struct.i2c_client** %2
%3 = load %struct.i2c_client*, %struct.i2c_client** %2
%4 = call i32 @i2c_detach_client(%struct.i2c_client* %3)
%5 = load %struct.i2c_client*, %struct.i2c_client** %2
%6 = call i32 @kfree(%struct.i2c_client* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.i2c_client = type { i32 }
define i32 @alc5628_detach(%struct.i2c_client* %0) {
%2 = tail call i32 @i2c_detach_client(%struct.i2c_client* %0)
%3 = tail call i32 @kfree(%struct.i2c_client* %0)
ret i32 0
}
__attribute__((hotpatch(a, 0))) int main(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: htbench [options]\nOptions are:\n\t-o hostname Hostname of "
         "the web server\n\t-p portno portno of the web server\n\t-r request "
         "Number of requests to perform\n\t-d duration duration of the test in "
         "seconds\n\t-t threads total number of threads to use\n\t-h help Show "
         "the usage of the app\n\t-v verbose Provides verbose display of "
         "statistics\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@.str = [331 x i8] c"Usage: htbench [options]\0AOptions are:\0A\09-o hostname Hostname of the web server\0A\09-p portno portno of the web server\0A\09-r request Number of requests to perform\0A\09-d duration duration of the test in seconds\0A\09-t threads total number of threads to use\0A\09-h help Show the usage of the app\0A\09-v verbose Provides verbose display of statistics\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@str = [330 x i8] c"Usage: htbench [options]\0AOptions are:\0A\09-o hostname Hostname of the web server\0A\09-p portno portno of the web server\0A\09-r request Number of requests to perform\0A\09-d duration duration of the test in seconds\0A\09-t threads total number of threads to use\0A\09-h help Show the usage of the app\0A\09-v verbose Provides verbose display of statistics\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([330 x i8], [330 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 2)
unreachable
}