xunge/DecIR huggingface dataset:
void gg_userlist_get_free(struct gg_http *h) {}


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

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

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

LLVM IR (-O2):
%struct.gg_http = type opaque
define void @gg_userlist_get_free(%struct.gg_http* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, int *);
int kbhit() {
  int n;
  ioctl(0, FIONREAD, &n);
  return n;
}


x86 assembly (clang, -O0):
<kbhit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x4(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbhit>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
xor    %edi,%edi
call   1030 <ioctl@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i32 @kbhit() {
%1 = alloca i32
%2 = load i32, i32* @FIONREAD
%3 = call i32 @ioctl(i32 0, i32 %2, i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @kbhit() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @FIONREAD
%4 = call i32 @ioctl(i32 0, i32 %3, i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Type definitions */
struct crypt_device {
  int dummy;
};

/* Variables and functions */
int crypt_memlock_dec(struct crypt_device *);
int crypt_memlock_inc(struct crypt_device *);
int crypt_memory_lock(struct crypt_device *cd, int lock) {
  return lock ? crypt_memlock_inc(cd) : crypt_memlock_dec(cd);
}


x86 assembly (clang, -O0):
<crypt_memory_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <crypt_memory_lock+0x2a>
mov    -0x8(%rbp),%rdi
call   1040 <crypt_memlock_inc@plt>
mov    %eax,-0x10(%rbp)
jmp    1156 <crypt_memory_lock+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <crypt_memlock_dec@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_memory_lock>:
test   %esi,%esi
je     1129 <crypt_memory_lock+0x9>
jmp    1040 <crypt_memlock_inc@plt>
jmp    1030 <crypt_memlock_dec@plt>

LLVM IR (-O0):
%struct.crypt_device = type { i32 }
define i32 @crypt_memory_lock(%struct.crypt_device* %0, i32 %1) {
%3 = alloca %struct.crypt_device*
%4 = alloca i32
store %struct.crypt_device* %0, %struct.crypt_device** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load %struct.crypt_device*, %struct.crypt_device** %3
%9 = call i32 @crypt_memlock_inc(%struct.crypt_device* %8)
br label %13
10: ; preds = %2
%11 = load %struct.crypt_device*, %struct.crypt_device** %3
%12 = call i32 @crypt_memlock_dec(%struct.crypt_device* %11)
br label %13
13: ; preds = %10, %7
%14 = phi i32 [ %9, %7 ], [ %12, %10 ]
ret i32 %14
}

LLVM IR (-O2):
%struct.crypt_device = type { i32 }
define i32 @crypt_memory_lock(%struct.crypt_device* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @crypt_memlock_inc(%struct.crypt_device* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @crypt_memlock_dec(%struct.crypt_device* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int main(int argc, char **argv) {
  volatile int my_number = 1;
  while (my_number > 0) {
    usleep(1);
  }
}


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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x0,%eax
jle    1148 <main+0x38>
mov    $0x1,%edi
call   1030 <usleep@plt>
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
cmpl   $0x0,0x4(%rsp)
jle    1131 <main+0x21>
mov    $0x1,%edi
call   1030 <usleep@plt>
cmpl   $0x0,0x4(%rsp)
jg     1120 <main+0x10>
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**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 1, i32* %6
br label %7
7: ; preds = %10, %2
%8 = load volatile i32, i32* %6
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @usleep(i32 1)
br label %7
12: ; preds = %7
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 1, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2, %7
%8 = tail call i32 @usleep(i32 1)
%9 = load volatile i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7, %2
ret i32 0
}
int rect_min_dist() { return 0; }


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

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

LLVM IR (-O0):
define i32 @rect_min_dist() {
ret i32 0
}

LLVM IR (-O2):
define i32 @rect_min_dist() {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int equals(const char *str1, const char *str2) {
  return strcmp(str1, str2) == 0;
}


x86 assembly (clang, -O0):
<equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equals>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @equals(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *jsonrpc_process(char *);
int /*<<< orphan*/ mc_set_debug(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char *request1 = "{\"method\": \"system.listMethods\", \"params\": []}";
  mc_set_debug(1);
  char *response1 = jsonrpc_process(request1);
  printf("response=%s\n", response1);
  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)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <mc_set_debug@plt>
mov    -0x18(%rbp),%rdi
call   1050 <jsonrpc_process@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <mc_set_debug@plt>
lea    0xebe(%rip),%rdi
call   1050 <jsonrpc_process@plt>
lea    0xee1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"{\22method\22: \22system.listMethods\22, \22params\22: []}\00"
@.str.1 = [13 x i8] c"response=%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = call i32 @mc_set_debug(i32 1)
%9 = load i8*, i8** %6
%10 = call i8* @jsonrpc_process(i8* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"{\22method\22: \22system.listMethods\22, \22params\22: []}\00"
@.str.1 = [13 x i8] c"response=%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @mc_set_debug(i32 1)
%4 = tail call i8* @jsonrpc_process(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
int test_imm_21uint16_mem(unsigned short *val) {
  return ((*val) & (0x21 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_21uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 33
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ uartTx(char *, int);
void lcdVisualDisplayOn() { uartTx("\xFE\x0C", 2); }


x86 assembly (clang, -O0):
<lcdVisualDisplayOn>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <uartTx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdVisualDisplayOn>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <uartTx@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\FE\0C\00"
define void @lcdVisualDisplayOn() {
%1 = call i32 @uartTx(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\FE\0C\00"
define void @lcdVisualDisplayOn() {
%1 = tail call i32 @uartTx(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dscal_(int *, double *, double *, int *);
void dscal(int n, double alpha, double *x, int incx) {
  dscal_(&n, &alpha, x, &incx);
}


x86 assembly (clang, -O0):
<dscal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
call   1030 <dscal_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dscal>:
sub    $0x18,%rsp
mov    %rsi,%rax
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edx,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
mov    %rax,%rdx
call   1030 <dscal_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @dscal(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %7
%10 = call i32 @dscal_(i32* %5, double* %6, double* %9, i32* %8)
ret void
}

LLVM IR (-O2):
define void @dscal(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store i32 %3, i32* %7
%8 = call i32 @dscal_(i32* %5, double* %6, double* %2, i32* %7)
ret void
}
int smallest_digit(int n) {
  int min_digit = n % 10;
  while (n) {
    min_digit = (min_digit > n % 10) ? n % 10 : min_digit;
    n /= 10;
  }
  return (min_digit);
}


x86 assembly (clang, -O0):
<smallest_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116d <smallest_digit+0x6d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
cmp    %edx,%eax
jle    114e <smallest_digit+0x4e>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
jmp    1154 <smallest_digit+0x54>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1115 <smallest_digit+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallest_digit>:
test   %edi,%edi
je     115f <smallest_digit+0x5f>
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%ecx
mov    %edi,%eax
sub    %ecx,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
cmp    %esi,%eax
cmovg  %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1130 <smallest_digit+0x30>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @smallest_digit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
store i32 %5, i32* %3
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = icmp sgt i32 %10, %12
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i32, i32* %2
%16 = srem i32 %15, 10
br label %19
17: ; preds = %9
%18 = load i32, i32* %3
br label %19
19: ; preds = %17, %14
%20 = phi i32 [ %16, %14 ], [ %18, %17 ]
store i32 %20, i32* %3
%21 = load i32, i32* %2
%22 = sdiv i32 %21, 10
store i32 %22, i32* %2
br label %6
23: ; preds = %6
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @smallest_digit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = srem i32 %0, 10
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %4, %3 ]
%7 = phi i32 [ %11, %5 ], [ %0, %3 ]
%8 = srem i32 %7, 10
%9 = icmp sgt i32 %6, %8
%10 = select i1 %9, i32 %8, i32 %6
%11 = sdiv i32 %7, 10
%12 = add i32 %7, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i32 [ 0, %1 ], [ %10, %5 ]
ret i32 %15
}
void test_6(char *x, unsigned int y, unsigned int z) {
  x[0] ^= 0x10;
  x[1] = y ^ (1 << 1);
  x[2] ^= 0x10;
  x[65000] ^= 0x10;
  x[5] ^= 1 << z;
}


x86 assembly (clang, -O0):
<test_6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    $0x10,%ecx
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
xor    $0x2,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%ecx
xor    $0x10,%ecx
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
movsbl 0xfde8(%rax),%ecx
xor    $0x10,%ecx
mov    %cl,0xfde8(%rax)
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movsbl 0x5(%rax),%ecx
xor    %edx,%ecx
mov    %cl,0x5(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_6>:
xorb   $0x10,(%rdi)
xor    $0x2,%sil
mov    %sil,0x1(%rdi)
xorb   $0x10,0x2(%rdi)
mov    %edx,%ecx
xorb   $0x10,0xfde8(%rdi)
mov    $0x1,%eax
shl    %cl,%eax
xor    %al,0x5(%rdi)
ret

LLVM IR (-O0):
define void @test_6(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = xor i32 %10, 16
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i32, i32* %5
%14 = xor i32 %13, 2
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = xor i32 %21, 16
%23 = trunc i32 %22 to i8
store i8 %23, i8* %19
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 65000
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = xor i32 %27, 16
%29 = trunc i32 %28 to i8
store i8 %29, i8* %25
%30 = load i32, i32* %6
%31 = shl i32 1, %30
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i64 5
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = xor i32 %35, %31
%37 = trunc i32 %36 to i8
store i8 %37, i8* %33
ret void
}

LLVM IR (-O2):
define void @test_6(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, 16
store i8 %5, i8* %0
%6 = trunc i32 %1 to i8
%7 = xor i8 %6, 2
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = xor i8 %10, 16
store i8 %11, i8* %9
%12 = getelementptr inbounds i8, i8* %0, i64 65000
%13 = load i8, i8* %12
%14 = xor i8 %13, 16
store i8 %14, i8* %12
%15 = shl nuw i32 1, %2
%16 = getelementptr inbounds i8, i8* %0, i64 5
%17 = load i8, i8* %16
%18 = trunc i32 %15 to i8
%19 = xor i8 %17, %18
store i8 %19, i8* %16
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *menu_expand_macros(const char *str, int for_shell, int *usr1, int *usr2) {
  return strdup(str);
}


x86 assembly (clang, -O0):
<menu_expand_macros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu_expand_macros>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @menu_expand_macros(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = call i8* @strdup(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @menu_expand_macros(i8* nocapture %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = tail call i8* @strdup(i8* %0)
ret i8* %5
}
int l(int i) { return 2 * i + 1; }


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

x86 assembly (clang, -O2):
<l>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @l(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @l(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void *heap_alloc(unsigned size) {
  void *res;
  __asm__("int $0x40" : "=a"(res) : "a"(68), "b"(12), "c"(size));
  return res;
}


x86 assembly (clang, -O0):
<heap_alloc>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x44,%eax
mov    $0xc,%ebx
int    $0x40
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_alloc>:
push   %rbx
mov    %edi,%ecx
mov    $0x44,%eax
mov    $0xc,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i8* @heap_alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm "int $$0x40", "={ax},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 12, i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @heap_alloc(i32 %0) {
%2 = tail call i8* asm "int $$0x40", "={ax},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 12, i32 %0)
ret i8* %2
}
void handle_35(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_35(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ regmatchInsensitive(char *, char *);
int ismaxmsgsize(char *string) {
  if (regmatchInsensitive(string, "^maxmsgsize=")) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<ismaxmsgsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <regmatchInsensitive@plt>
cmp    $0x0,%rax
je     1142 <ismaxmsgsize+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <ismaxmsgsize+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"^maxmsgsize=\00"
define i32 @ismaxmsgsize(i8* %0) {
%2 = tail call i64 @regmatchInsensitive(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void posix_class2P_ALPHA() {}


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

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

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

LLVM IR (-O2):
define void @posix_class2P_ALPHA() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ demo(char *, int, char *, int, char *, char *);
int main() {
  int which = 1;
  char v1[] = "ni";
  char v3[] = "shi";
  char v4[] = "ge";
  int v2 = 124;
  demo("", which, v1, v2, v3, v4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    0xed3(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xecb(%rip),%al
mov    %al,-0x9(%rbp)
mov    0xec3(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xebd(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    0xeb5(%rip),%al
mov    %al,-0x10(%rbp)
movl   $0x7c,-0x18(%rbp)
mov    -0x8(%rbp),%esi
lea    -0xb(%rbp),%rdx
mov    -0x18(%rbp),%ecx
lea    -0xf(%rbp),%r8
lea    -0x12(%rbp),%r9
lea    0xe92(%rip),%rdi
call   1030 <demo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x0,0x12(%rsp)
movw   $0x696e,0x10(%rsp)
movl   $0x696873,0x14(%rsp)
movb   $0x0,0xe(%rsp)
movw   $0x6567,0xc(%rsp)
lea    0xeca(%rip),%rdi
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%r8
lea    0xc(%rsp),%r9
mov    $0x1,%esi
mov    $0x7c,%ecx
call   1030 <demo@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.v1 = [3 x i8] c"ni\00"
@__const.main.v3 = [4 x i8] c"shi\00"
@__const.main.v4 = [3 x i8] c"ge\00"
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i8]
%4 = alloca [4 x i8]
%5 = alloca [3 x i8]
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%7 = bitcast [3 x i8]* %3 to i8*
%8 = bitcast [4 x i8]* %4 to i8*
%9 = bitcast [3 x i8]* %5 to i8*
store i32 124, i32* %6
%10 = load i32, i32* %2
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%12 = load i32, i32* %6
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%15 = call i32 @demo(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11, i32 %12, i8* %13, i8* %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.v1 = [3 x i8] c"ni\00"
@__const.main.v4 = [3 x i8] c"ge\00"
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca i32
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
store i32 6908019, i32* %2
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = call i32 @demo(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i8* %4, i32 124, i8* %5, i8* %6)
ret i32 0
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Enter the number you wish to calculate\n");
  scanf("%d", &n);
  printf("Factorial %d! is :\n", n);
  printf("%.0lf\n", fact(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
call   1050 <fact@plt>
lea    0xe97(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Enter the number you wish to calculate\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Factorial %d! is :\0A\00"
@.str.3 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @fact(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Factorial %d! is :\0A\00"
@.str.3 = [7 x i8] c"%.0lf\0A\00"
@str = [39 x i8] c"Enter the number you wish to calculate\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @fact(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %8)
ret i32 0
}
int grid_xreq_ispeer(int socktype) { return socktype == (3 * 16 + 1) ? 1 : 0; }


x86 assembly (clang, -O0):
<grid_xreq_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x31,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_xreq_ispeer>:
xor    %eax,%eax
cmp    $0x31,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @grid_xreq_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 49
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @grid_xreq_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 49
%3 = zext i1 %2 to i32
ret i32 %3
}
void reg_set_one_bit(volatile unsigned int *reg, unsigned int bit) {
  unsigned int temp, mask;
  mask = 1 << bit;
  temp = *reg;
  temp |= mask;
  *reg = temp;
  return;
}


x86 assembly (clang, -O0):
<reg_set_one_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_set_one_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @reg_set_one_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 1, %7
store i32 %8, i32* %6
%9 = load i32*, i32** %3
%10 = load volatile i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = or i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32*, i32** %3
store volatile i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @reg_set_one_bit(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load volatile i32, i32* %0
%5 = or i32 %4, %3
store volatile i32 %5, i32* %0
ret void
}
int test_imm_67int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x67 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_67int64_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, 103
%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_67int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 442381631488
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int XCheckTypedWindowEvent() {}


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

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

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

LLVM IR (-O2):
define i32 @XCheckTypedWindowEvent() {
ret i32 undef
}
int test_imm_34uint8_reg(unsigned char val) {
  return ((val) & (0x34 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_34uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x34,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_34uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 52
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int isnan_d(double x) { return x != x; }


x86 assembly (clang, -O0):
<isnan_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnan_d>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @isnan_d(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isnan_d(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
short max(short a, short b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    112e <max+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <max+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %ax,%di
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @max(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @max(i16 signext %0, i16 signext %1) {
%3 = icmp sgt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int _listfile_write_hex(FILE *f, int data) {
  if (data >= 10)
    fprintf(f, "%c", data + 'A' - 10);
  else
    fprintf(f, "%c", data + '0');
  return 1;
}


x86 assembly (clang, -O0):
<_listfile_write_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jl     1147 <_listfile_write_hex+0x37>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x41,%edx
sub    $0xa,%edx
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    115d <_listfile_write_hex+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x30,%edx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_listfile_write_hex>:
push   %rax
mov    %rdi,%rax
lea    0x30(%rsi),%ecx
lea    0x37(%rsi),%edi
cmp    $0xa,%esi
cmovl  %ecx,%edi
mov    %rax,%rsi
call   1030 <fputc@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_listfile_write_hex(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 9
%4 = select i1 %3, i32 55, i32 48
%5 = add nsw i32 %4, %1
%6 = tail call i32 @fputc(i32 %5, i32* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sighup(int o) {
  (void)o;
  printf("elo\n");
}


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"elo\00"
define void @sighup(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  double f;
  f = 48656568.256479123456789123456789;
  printf("double    :%lf\n", f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"double :%lf\0A\00"
define i32 @main() {
%1 = alloca double
store double 0x41873385C20D44ED, double* %1
%2 = load double, double* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"double :%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 0x41873385C20D44ED)
ret i32 0
}
/* Variables and functions */
int is_valid_in_EvntGrp(size_t __tag) {
  switch (__tag) {
  case 865:
  case 866:
  case 867:
  case 868:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_in_EvntGrp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffc9f,%rax
sub    $0x3,%rax
ja     112d <is_valid_in_EvntGrp+0x2d>
jmp    1121 <is_valid_in_EvntGrp+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1134 <is_valid_in_EvntGrp+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_in_EvntGrp>:
add    $0xfffffffffffffc9f,%rdi
xor    %eax,%eax
cmp    $0x4,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_valid_in_EvntGrp(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %6 [
i64 865, label %5
i64 866, label %5
i64 867, label %5
i64 868, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_valid_in_EvntGrp(i64 %0) {
%2 = add i64 %0, -865
%3 = icmp ult i64 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
void RTStrToUInt32Full(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToUInt32Full() {
ret void
}
/* Variables and functions */
char *sigar_skip_token(char *);
char *sigar_skip_multiple_token(char *p, int count) {
  int i;
  for (i = 0; i < count; i++) {
    p = sigar_skip_token(p);
  }
  return p;
}


x86 assembly (clang, -O0):
<sigar_skip_multiple_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114d <sigar_skip_multiple_token+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <sigar_skip_token@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <sigar_skip_multiple_token+0x16>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigar_skip_multiple_token>:
push   %rbx
mov    %rdi,%rax
test   %esi,%esi
jle    112d <sigar_skip_multiple_token+0x1d>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <sigar_skip_token@plt>
add    $0xffffffff,%ebx
jne    1120 <sigar_skip_multiple_token+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sigar_skip_multiple_token(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = call i8* @sigar_skip_token(i8* %11)
store i8* %12, i8** %3
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @sigar_skip_multiple_token(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i8* [ %7, %4 ], [ %0, %2 ]
%7 = tail call i8* @sigar_skip_token(i8* %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i8* [ %0, %2 ], [ %7, %4 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_and_nullify(FILE **f) {
  if (*f) {
    fclose(*f);
    *f = NULL;
  }
}


x86 assembly (clang, -O0):
<close_and_nullify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <close_and_nullify+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_and_nullify>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <close_and_nullify+0x18>
call   1030 <fclose@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @close_and_nullify(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
store i32* null, i32** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char znak;
  do {
    znak = getchar();
    printf("%c", znak);
  } while (znak != EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
lea    0xec0(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    0x2e94(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xed5(%rip),%r14
mov    0x2eb6(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
cmp    (%rbx),%bpl
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
br label %7
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = load i8, i8* @EOF
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %9, %11
br i1 %12, label %3, label %13
13: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i8 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %2, %4
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
float smallestFloat(float a, float b, float c) {
  float smallest = a;
  if (b < smallest)
    smallest = b;
  if (c < smallest)
    smallest = c;
  return smallest;
}


x86 assembly (clang, -O0):
<smallestFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    113a <smallestFloat+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1157 <smallestFloat+0x57>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallestFloat>:
minss  %xmm0,%xmm1
minss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @smallestFloat(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
store float %8, float* %7
%9 = load float, float* %5
%10 = load float, float* %7
%11 = fcmp olt float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load float, float* %5
store float %13, float* %7
br label %14
14: ; preds = %12, %3
%15 = load float, float* %6
%16 = load float, float* %7
%17 = fcmp olt float %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load float, float* %6
store float %19, float* %7
br label %20
20: ; preds = %18, %14
%21 = load float, float* %7
ret float %21
}

LLVM IR (-O2):
define float @smallestFloat(float %0, float %1, float %2) {
%4 = fcmp olt float %1, %0
%5 = select i1 %4, float %1, float %0
%6 = fcmp ogt float %5, %2
%7 = select i1 %6, float %2, float %5
ret float %7
}