xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int count_between_down(int userin1, int userin2) {
  int loop;
  for (loop = userin1; loop >= userin2; loop--) {
    printf("%d ", loop);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<count_between_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     114f <count_between_down+0x3f>
mov    -0x10(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <count_between_down+0x14>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_between_down>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jl     1155 <count_between_down+0x35>
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xecd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    %ebp,%ebx
mov    %eax,%ebx
jg     1140 <count_between_down+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @count_between_down(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %5, -1
%8 = icmp sgt i32 %5, %1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = tail call i32 @putchar(i32 10)
ret i32 undef
}
main2() {}


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

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

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

LLVM IR (-O2):
define i32 @main2() {
ret i32 undef
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_process(void *bus,
                                                          void **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_process>:
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_bus_process>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_process(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %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_bus_process(i8* nocapture readnone %0, i8** 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 /*<<< orphan*/ scanf(char *, double *);
int main() {
  double deg, rad;
  printf("Podaj kat w stopniach : ");
  scanf("%lf", &deg);
  rad = rad = 2 * 3.14159265358979323846 * deg / 360;
  printf("%.4f deg = %.4f rad\n", deg, rad);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeba(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xeb3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xeb5(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xeb1(%rip),%xmm1
lea    0xecf(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Podaj kat w stopniach : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c"%.4f deg = %.4f rad\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double 0x401921FB54442D18, %5
%7 = fdiv double %6, 3.600000e+02
store double %7, double* %2
store double %7, double* %2
%8 = load double, double* %1
%9 = load double, double* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %8, double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Podaj kat w stopniach : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c"%.4f deg = %.4f rad\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 0x401921FB54442D18
%7 = fdiv double %6, 3.600000e+02
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %5, double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x05() {
  Assert_real((isbdigit(5) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              30, ("isbdigit should be 0 for 0x05"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x05\00"
define void @t_isbdigit_0x05() {
%1 = tail call i64 @isbdigit(i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send(char);
void usart_init() {
  send('\r');
  send('\r');
}


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

x86 assembly (clang, -O2):
<usart_init>:
push   %rax
mov    $0xd,%edi
call   1030 <send@plt>
mov    $0xd,%edi
pop    %rax
jmp    1030 <send@plt>

LLVM IR (-O0):
define void @usart_init() {
%1 = call i32 @send(i8 signext 13)
%2 = call i32 @send(i8 signext 13)
ret void
}

LLVM IR (-O2):
define void @usart_init() {
%1 = tail call i32 @send(i8 signext 13)
%2 = tail call i32 @send(i8 signext 13)
ret void
}
/* Variables and functions */
float f(int, float, double, int);
main() {
  float t = f(1, (float)2, 3.2, 4);
  if (t == 10.2f)
    return 0;
  return 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
movss  0xed8(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
mov    $0x4,%esi
call   1030 <f@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeb0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    116b <main+0x5b>
jp     116b <main+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1172 <main+0x62>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <f@plt>
cmpneqss 0xecb(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
lea    (%rax,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float @f(i32 1, float 2.000000e+00, double 3.200000e+00, i32 4)
store float %3, float* %2
%4 = load float, float* %2
%5 = fcmp oeq float %4, 0x4024666660000000
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 5, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float @f(i32 1, float 2.000000e+00, double 3.200000e+00, i32 4)
%2 = fcmp oeq float %1, 0x4024666660000000
%3 = select i1 %2, i32 0, i32 5
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ internal_fiat_secp256k1_nonzero(uintptr_t);
void fiat_secp256k1_nonzero(uint32_t *out1, const uint32_t arg1[8]) {
  *out1 = (uint32_t)internal_fiat_secp256k1_nonzero((uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_nonzero>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <internal_fiat_secp256k1_nonzero@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @fiat_secp256k1_nonzero(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = ptrtoint i64* %5 to i64
%7 = call i64 @internal_fiat_secp256k1_nonzero(i64 %6)
%8 = load i64*, i64** %3
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_nonzero(i64* nocapture writeonly %0, i64* %1) {
%3 = ptrtoint i64* %1 to i64
%4 = tail call i64 @internal_fiat_secp256k1_nonzero(i64 %3)
store i64 %4, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ color_fenable(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void color_enable(const char *clr_scheme) { color_fenable(clr_scheme, stdout); }


x86 assembly (clang, -O0):
<color_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <color_fenable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_enable>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <color_fenable@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @color_enable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @color_fenable(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @color_enable(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @color_fenable(i8* %0, i32 %2)
ret void
}
unsigned int ccuEvent1(unsigned int is, unsigned int em, unsigned int lm,
                       unsigned int lpf) {
  return ((is << 4) | (em << 18) | (lm << 23) | (lpf << 27));
}


x86 assembly (clang, -O0):
<ccuEvent1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%ecx
shl    $0x12,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x17,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x1b,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccuEvent1>:
mov    %ecx,%eax
shl    $0x4,%edi
shl    $0x12,%esi
or     %edi,%esi
shl    $0x17,%edx
shl    $0x1b,%eax
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @ccuEvent1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = shl i32 %9, 4
%11 = load i32, i32* %6
%12 = shl i32 %11, 18
%13 = or i32 %10, %12
%14 = load i32, i32* %7
%15 = shl i32 %14, 23
%16 = or i32 %13, %15
%17 = load i32, i32* %8
%18 = shl i32 %17, 27
%19 = or i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @ccuEvent1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 4
%6 = shl i32 %1, 18
%7 = or i32 %6, %5
%8 = shl i32 %2, 23
%9 = or i32 %7, %8
%10 = shl i32 %3, 27
%11 = or i32 %9, %10
ret i32 %11
}
void delay(int delay) {}


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

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_membarrier;
int syscall(int /*<<< orphan*/, int, int);
int sys_membarrier(int cmd, int flags) {
  return syscall(__NR_membarrier, cmd, flags);
}


x86 assembly (clang, -O0):
<sys_membarrier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_membarrier>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_membarrier = global i32 0
define i32 @sys_membarrier(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @__NR_membarrier
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @syscall(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@__NR_membarrier = global i32 0
define i32 @sys_membarrier(i32 %0, i32 %1) {
%3 = load i32, i32* @__NR_membarrier
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
int cmp(const void *a1, const void *a2) { return *(int *)a1 - *(int *)a2; }


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __wbeu32(int *, scalar_t__);
int i2c_transact(int, int, int *, int, int /*<<< orphan*/);
int i2c_write_beuint32(int fd, int chip_addr, int reg, uint32_t value) {
  uint8_t data[1 + sizeof(uint32_t)];
  data[0] = reg;
  __wbeu32(&data[1], (uint32_t)value);
  return i2c_transact(fd, chip_addr, data, 1 + sizeof(uint32_t), 0);
}


x86 assembly (clang, -O0):
<i2c_write_beuint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
lea    -0x40(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <__wbeu32@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x40(%rbp),%rdx
mov    $0x9,%ecx
xor    %r8d,%r8d
call   1030 <i2c_transact@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_beuint32>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rcx,%rsi
call   1040 <__wbeu32@plt>
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x9,%ecx
xor    %r8d,%r8d
call   1030 <i2c_transact@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @i2c_write_beuint32(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca [9 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i32, i32* %7
%11 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 1
%13 = load i64, i64* %8
%14 = call i32 @__wbeu32(i32* %12, i64 %13)
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = getelementptr inbounds [9 x i32], [9 x i32]* %9, i64 0, i64 0
%18 = call i32 @i2c_transact(i32 %15, i32 %16, i32* %17, i32 9, i32 0)
ret i32 %18
}

LLVM IR (-O2):
define i32 @i2c_write_beuint32(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca [9 x i32]
%6 = bitcast [9 x i32]* %5 to i8*
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 0
store i32 %2, i32* %7
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 1
%9 = call i32 @__wbeu32(i32* %8, i64 %3)
%10 = call i32 @i2c_transact(i32 %0, i32 %1, i32* %7, i32 9, i32 0)
ret i32 %10
}
void run_test() {}


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

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

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

LLVM IR (-O2):
define void @run_test() {
ret void
}
/* Variables and functions */
int cdops_check_cmd(int);
int cdops_wait_cmd(int f) {
  int n;
  while (!(n = cdops_check_cmd(f)))
    ;
  return (n > 0 ? 0 : n);
}


x86 assembly (clang, -O0):
<cdops_wait_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <cdops_check_cmd@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113b <cdops_wait_cmd+0x2b>
jmp    1140 <cdops_wait_cmd+0x30>
jmp    111b <cdops_wait_cmd+0xb>
cmpl   $0x0,-0x8(%rbp)
jle    1154 <cdops_wait_cmd+0x44>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <cdops_wait_cmd+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdops_wait_cmd>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <cdops_check_cmd@plt>
test   %eax,%eax
je     1120 <cdops_wait_cmd+0x10>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %eax,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cdops_wait_cmd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %2
%6 = call i32 @cdops_check_cmd(i32 %5)
store i32 %6, i32* %3
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %16
14: ; preds = %10
%15 = load i32, i32* %3
br label %16
16: ; preds = %14, %13
%17 = phi i32 [ 0, %13 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @cdops_wait_cmd(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @cdops_check_cmd(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = icmp slt i32 %3, 0
%7 = select i1 %6, i32 %3, i32 0
ret i32 %7
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int pci_cleanup_aer_error_status_regs(struct pci_dev *dev) { return -EINVAL; }


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

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

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
@EINVAL = global i32 0
define i32 @pci_cleanup_aer_error_status_regs(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
@EINVAL = global i32 0
define i32 @pci_cleanup_aer_error_status_regs(%struct.pci_dev* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
void foo784() {}


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

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

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

LLVM IR (-O2):
define void @foo784() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_array(char *, int /*<<< orphan*/ *);
void *failed_format(void *args) {
  read_array("test_data/failed_format.txt", NULL);
  return (NULL);
}


x86 assembly (clang, -O0):
<failed_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <read_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"test_data/failed_format.txt\00"
define i8* @failed_format(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @read_array(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32* null)
ret i8* null
}

LLVM IR (-O2):
@.str = [28 x i8] c"test_data/failed_format.txt\00"
define noalias i8* @failed_format(i8* nocapture readnone %0) {
%2 = tail call i32 @read_array(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32* null)
ret i8* null
}
void rop3_254_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk1 = *D | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_254_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_254_0_1>:
mov    %edx,%eax
or     %sil,%al
mov    (%rdi),%r8b
or     %r8b,%al
mov    %edx,%ecx
not    %cl
or     %sil,%cl
and    %al,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_254_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %6
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = or i32 %26, %32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = and i32 %39, %42
%44 = or i32 %33, %43
%45 = trunc i32 %44 to i8
%46 = load i8*, i8** %4
store i8 %45, i8* %46
ret void
}

LLVM IR (-O2):
define void @rop3_254_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %4, %5
%7 = xor i8 %2, -1
%8 = or i8 %7, %1
%9 = and i8 %6, %8
%10 = xor i8 %1, -1
%11 = and i8 %10, %2
%12 = and i8 %11, %5
%13 = or i8 %9, %12
store i8 %13, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cdoWarning(char *);
int gridFromH5file(const char *gridfile) {
  int gridID = -1;
  cdoWarning("HDF5 support not compiled in!");
  return (gridID);
}


x86 assembly (clang, -O0):
<gridFromH5file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <cdoWarning@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"HDF5 support not compiled in!\00"
define i32 @gridFromH5file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 -1, i32* %3
%4 = call i32 @cdoWarning(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
@.str = [30 x i8] c"HDF5 support not compiled in!\00"
define i32 @gridFromH5file(i8* nocapture readnone %0) {
%2 = tail call i32 @cdoWarning(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ts_run();
int main(int argc, char *argv[]) {
  ts_run();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ts_run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char const *);
void error(const char *message, ...) { syslog(LOG_ERR, message); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rsi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
define void @error(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_ERR
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
define void @error(i8* %0, ...) {
%2 = load i32, i32* @LOG_ERR
%3 = tail call i32 @syslog(i32 %2, i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long time;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xbutton_time(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xbutton.time = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xbutton_time>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xbutton_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xbutton_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
scalar_t__ sigdelset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ unix_error(char *);
void Sigdelset(sigset_t *set, int signum) {
  if (sigdelset(set, signum) < 0)
    unix_error("Sigdelset error");
  return;
}


x86 assembly (clang, -O0):
<Sigdelset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sigdelset@plt>
cmp    $0x0,%rax
jge    1151 <Sigdelset+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Sigdelset error\00"
define void @Sigdelset(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 @sigdelset(i32* %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @unix_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Sigdelset error\00"
define void @Sigdelset(i32* %0, i32 %1) {
%3 = tail call i64 @sigdelset(i32* %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LoggingSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void LoggingSettingsRequestUpdate() {
  UAVObjRequestUpdate(LoggingSettingsHandle());
}


x86 assembly (clang, -O0):
<LoggingSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LoggingSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoggingSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <LoggingSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @LoggingSettingsRequestUpdate() {
%1 = call i32 (...) @LoggingSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @LoggingSettingsRequestUpdate() {
%1 = tail call i32 (...) @LoggingSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int test_imm_3Aint32_reg(int val) { return ((val) & (0x3A << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_3Aint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 58
%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_3Aint32_reg(i32 %0) {
%2 = and i32 %0, 58
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *ft_memset(void *, int, unsigned long);
scalar_t__ malloc(unsigned long);
void *ft_memalloc(unsigned long size) {
  void *mem;
  if (!(mem = (void *)malloc(size)))
    return (0x00);
  mem = ft_memset(mem, 0x00, size);
  return (mem);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1150 <ft_memalloc+0x30>
movq   $0x0,-0x8(%rbp)
jmp    116b <ft_memalloc+0x4b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <ft_memset@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     113c <ft_memalloc+0x1c>
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <ft_memset@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i8*
%6 = tail call i8* @ft_memset(i8* %5, i32 0, i64 %0)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
float __ocl_distance_float(float src1, float src2) {
  float t = src1 - src2;
  return t < 0 ? -t : t;
}


x86 assembly (clang, -O0):
<__ocl_distance_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1146 <__ocl_distance_float+0x46>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1150 <__ocl_distance_float+0x50>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_distance_float>:
subss  %xmm1,%xmm0
movaps 0xef5(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_distance_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fsub float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load float, float* %5
%13 = fneg float %12
br label %16
14: ; preds = %2
%15 = load float, float* %5
br label %16
16: ; preds = %14, %11
%17 = phi float [ %13, %11 ], [ %15, %14 ]
ret float %17
}

LLVM IR (-O2):
define float @__ocl_distance_float(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp olt float %3, 0.000000e+00
%5 = fneg float %3
%6 = select i1 %4, float %5, float %3
ret float %6
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_enable_back_to_sleep(void) {
  char ctlreg_1 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1B, &ctlreg_1, 1) == 0) {
    ctlreg_1 |= 0x04;
    KIONIX_ACCEL_write_byte(0x1B, ctlreg_1);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_enable_back_to_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1b,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_enable_back_to_sleep+0x4d>
movsbl -0x1(%rbp),%eax
or     $0x4,%eax
mov    %al,-0x1(%rbp)
mov    $0x1b,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_enable_back_to_sleep+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_enable_back_to_sleep>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1b,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_enable_back_to_sleep+0x41>
movsbl 0xf(%rsp),%esi
or     $0x4,%esi
mov    %sil,0xf(%rsp)
mov    $0x1b,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_enable_back_to_sleep() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = or i32 %7, 4
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_enable_back_to_sleep() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = or i8 %5, 4
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ launch(void (*)(void *));
int /*<<< orphan*/ qprintf(char *, void (*)(void *));
void q_create_init_task(int unused, void (*init_task)(void *)) {
  qprintf("create_init_task(%x)\n", init_task);
  launch(init_task);
}


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

x86 assembly (clang, -O2):
<q_create_init_task>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <qprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <launch@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"create_init_task(%x)\0A\00"
define void @q_create_init_task(i32 %0, void (i8*)* %1) {
%3 = alloca i32
%4 = alloca void (i8*)*
store i32 %0, i32* %3
store void (i8*)* %1, void (i8*)** %4
%5 = load void (i8*)*, void (i8*)** %4
%6 = call i32 @qprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), void (i8*)* %5)
%7 = load void (i8*)*, void (i8*)** %4
%8 = call i32 @launch(void (i8*)* %7)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"create_init_task(%x)\0A\00"
define void @q_create_init_task(i32 %0, void (i8*)* %1) {
%3 = tail call i32 @qprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), void (i8*)* %1)
%4 = tail call i32 @launch(void (i8*)* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_pointer(void *);
void *realloc(void *, size_t);
void *safe_realloc(void *ptr, size_t size) {
  void *res = realloc(ptr, size);
  if (size != 0)
    check_pointer(res);
  return res;
}


x86 assembly (clang, -O0):
<safe_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <safe_realloc+0x35>
mov    -0x18(%rbp),%rdi
call   1030 <check_pointer@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     113c <safe_realloc+0x1c>
mov    %r14,%rdi
call   1030 <check_pointer@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i64 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @check_pointer(i8* %3)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ strcat(char *, char *);
void task4() {
  sleep(1);
  printf("\nTASK 4: Null strcat\n");
  char *s1;
  strcat(s1, "!");
  printf("\n%s\n", s1);
}


x86 assembly (clang, -O0):
<task4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task4>:
push   %rax
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%rsi
call   1050 <strcat@plt>
lea    0xe98(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0ATASK 4: Null strcat\0A\00"
@.str.1 = [2 x i8] c"!\00"
@.str.2 = [5 x i8] c"\0A%s\0A\00"
define void @task4() {
%1 = alloca i8*
%2 = call i32 @sleep(i32 1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c"!\00"
@.str.2 = [5 x i8] c"\0A%s\0A\00"
@str = [21 x i8] c"\0ATASK 4: Null strcat\00"
define void @task4() {
%1 = tail call i32 @sleep(i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @strcat(i8* undef, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* undef)
ret void
}
void *deconst(const void *in) {
  union {
    const void *in;
    void *out;
  } tmp;
  tmp.in = in;
  return tmp.out;
}


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

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

LLVM IR (-O0):
%union.anon = type { i8* }
define i8* @deconst(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast %union.anon* %3 to i8**
store i8* %4, i8** %5
%6 = bitcast %union.anon* %3 to i8**
%7 = load i8*, i8** %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @deconst(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
int MySearchCallback(int id, void *arg) {
  fprintf(stdout, "Hit data mbr %d ", id - 1);
  return 1;
}


x86 assembly (clang, -O0):
<MySearchCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MySearchCallback>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
lea    -0x1(%rdi),%edx
lea    0xedc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [17 x i8] c"Hit data mbr %d \00"
define i32 @MySearchCallback(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 1
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 1
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [17 x i8] c"Hit data mbr %d \00"
define i32 @MySearchCallback(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = add nsw i32 %0, -1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}