xunge/DecIR huggingface dataset:
int execute_setsid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_setsid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x6b() {
  Assert_real((isascii(107)),
              "/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_isascii.c",
              540, ("isascii should be 1 for k"));
}


x86 assembly (clang, -O0):
<t_isascii_0x6b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6b,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x21c,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x6b>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x21c,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for k\00"
define void @t_isascii_0x6b() {
%1 = call i32 @isascii(i32 107)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for k\00"
define void @t_isascii_0x6b() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseek(int /*<<< orphan*/ *, long, int);
int fseek_internal(void *fp, long int offset, int whence) {
  return fseek((FILE *)fp, offset, whence);
}


x86 assembly (clang, -O0):
<fseek_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fseek_internal>:
jmp    1030 <fseek@plt>

LLVM IR (-O0):
define i32 @fseek_internal(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = call i32 @fseek(i32* %8, i64 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @fseek_internal(i8* nocapture %0, i64 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fseek(i32* %4, i64 %1, i32 %2)
ret i32 %5
}
RCU_DEF_DESTROY_FUNC(user_f1_destroy, param) {}


x86 assembly (clang, -O0):
<RCU_DEF_DESTROY_FUNC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @RCU_DEF_DESTROY_FUNC(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @RCU_DEF_DESTROY_FUNC(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void list_null(void *p) {
  if (p == NULL) {
    printf("LIST_ERROR: Pointer is NULL\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<list_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114d <list_null+0x2d>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_null>:
test   %rdi,%rdi
je     1126 <list_null+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"LIST_ERROR: Pointer is NULL\0A\00"
define void @list_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"LIST_ERROR: Pointer is NULL\00"
define void @list_null(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
ret void
}
void f1(g) { printf("g1=%d\n", g); }


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

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"g1=%d\0A\00"
define void @f1(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int prcmu_debug_init(void) {}


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

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

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

LLVM IR (-O2):
define i32 @prcmu_debug_init() {
ret i32 undef
}
/* Type definitions */
struct netdev_queue {
  int dummy;
};
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ netif_wake_queue(struct net_device *);
void netif_tx_wake_queue(struct netdev_queue *txq) {
  netif_wake_queue((struct net_device *)txq);
}


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

x86 assembly (clang, -O2):
<netif_tx_wake_queue>:
jmp    1030 <netif_wake_queue@plt>

LLVM IR (-O0):
%struct.netdev_queue = type { i32 }
%struct.net_device = type { i32 }
define void @netif_tx_wake_queue(%struct.netdev_queue* %0) {
%2 = alloca %struct.netdev_queue*
store %struct.netdev_queue* %0, %struct.netdev_queue** %2
%3 = load %struct.netdev_queue*, %struct.netdev_queue** %2
%4 = bitcast %struct.netdev_queue* %3 to %struct.net_device*
%5 = call i32 @netif_wake_queue(%struct.net_device* %4)
ret void
}

LLVM IR (-O2):
%struct.netdev_queue = type { i32 }
%struct.net_device = type { i32 }
define void @netif_tx_wake_queue(%struct.netdev_queue* %0) {
%2 = bitcast %struct.netdev_queue* %0 to %struct.net_device*
%3 = tail call i32 @netif_wake_queue(%struct.net_device* %2)
ret void
}
/* Variables and functions */
scalar_t__ chdir(char *);
int /*<<< orphan*/ errmes(char *);
int /*<<< orphan*/ go();
void far(char path[]) {
  if (chdir(path) < 0) {
    errmes(path);
    return;
  }
  go();
}


x86 assembly (clang, -O0):
<far>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <chdir@plt>
cmp    $0x0,%rax
jge    115d <far+0x2d>
mov    -0x8(%rbp),%rdi
call   1050 <errmes@plt>
jmp    1164 <far+0x34>
mov    $0x0,%al
call   1030 <go@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<far>:
push   %rbx
mov    %rdi,%rbx
call   1040 <chdir@plt>
test   %rax,%rax
js     1146 <far+0x16>
xor    %eax,%eax
pop    %rbx
jmp    1030 <go@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <errmes@plt>

LLVM IR (-O0):
define void @far(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @chdir(i8* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @errmes(i8* %7)
br label %11
9: ; preds = %1
%10 = call i32 (...) @go()
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
define void @far(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errmes(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @go()
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void _getentropy_fail(void) { raise(SIGKILL); }


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

x86 assembly (clang, -O2):
<_getentropy_fail>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIGKILL = global i32 0
define void @_getentropy_fail() {
%1 = load i32, i32* @SIGKILL
%2 = call i32 @raise(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define void @_getentropy_fail() {
%1 = load i32, i32* @SIGKILL
%2 = tail call i32 @raise(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: prep [file]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Usage: prep [file]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [19 x i8] c"Usage: prep [file]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
const char *ajTextinTypeGetFields(void) { return "id"; }


x86 assembly (clang, -O0):
<ajTextinTypeGetFields>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ajTextinTypeGetFields>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"id\00"
define i8* @ajTextinTypeGetFields() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"id\00"
define i8* @ajTextinTypeGetFields() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, double);
void localCvtDoubleToString(double flt_value, char *pstr_value,
                            unsigned short precision) {
  if (precision > 17)
    precision = 17;
  sprintf(pstr_value, "%.*f", (int)precision, flt_value);
}


x86 assembly (clang, -O0):
<localCvtDoubleToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
cmp    $0x11,%eax
jle    113b <localCvtDoubleToString+0x2b>
movw   $0x11,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
movzwl -0x12(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
lea    0xeb1(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localCvtDoubleToString>:
cmp    $0x11,%si
mov    $0x11,%edx
cmovb  %esi,%edx
lea    0xedd(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%.*f\00"
define void @localCvtDoubleToString(double %0, i8* %1, i16 zeroext %2) {
%4 = alloca double
%5 = alloca i8*
%6 = alloca i16
store double %0, double* %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = icmp sgt i32 %8, 17
br i1 %9, label %10, label %11
10: ; preds = %3
store i16 17, i16* %6
br label %11
11: ; preds = %10, %3
%12 = load i8*, i8** %5
%13 = load i16, i16* %6
%14 = zext i16 %13 to i32
%15 = load double, double* %4
%16 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14, double %15)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.*f\00"
define void @localCvtDoubleToString(double %0, i8* nocapture writeonly %1, i16 zeroext %2) {
%4 = icmp ult i16 %2, 17
%5 = select i1 %4, i16 %2, i16 17
%6 = zext i16 %5 to i32
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6, double %0)
ret void
}
int calc(void) {
  int i = 20;
  return (i + 1) * 2;
}


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

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

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

LLVM IR (-O2):
define i32 @calc() {
ret i32 42
}
int test_imm_88int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x88 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_88int64_midword_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, 16
%6 = and i64 %5, 136
%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_88int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8912896
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int QSS_intCmp(const void *x, const void *y) {
  int xx = *(int *)x, yy = *(int *)y;
  if (xx < yy)
    return -1;
  if (xx > yy)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<QSS_intCmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <QSS_intCmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <QSS_intCmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <QSS_intCmp+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <QSS_intCmp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QSS_intCmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @QSS_intCmp(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 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncmp(char *, char *, int);
void strncmp_diff_length_3() {
  char *x = "123";
  char *y = "12345";
  clang_analyzer_eval(strncmp(x, y, 5) < 0);
}


x86 assembly (clang, -O0):
<strncmp_diff_length_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_diff_length_3>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
shr    $0x3f,%rax
mov    %eax,%edi
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
@.str.1 = [6 x i8] c"12345\00"
define void @strncmp_diff_length_3() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strncmp(i8* %3, i8* %4, i32 5)
%6 = icmp slt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [6 x i8] c"12345\00"
define void @strncmp_diff_length_3() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = lshr i64 %1, 63
%3 = trunc i64 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
void print_vec(const double *d, int n) {
  int i;
  ;
  for (i = 0; i < n; i++) {
    ;
  };
}


x86 assembly (clang, -O0):
<print_vec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1131 <print_vec+0x31>
jmp    1123 <print_vec+0x23>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <print_vec+0x12>
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @BRAKE_ADC_ISR3() {
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ pthread_exit(void *);
void xio_thread_exit(int res) {
  void *pres = malloc(sizeof(int));
  if (pres != NULL)
    *(int *)pres = res;
  pthread_exit(pres);
}


x86 assembly (clang, -O0):
<xio_thread_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <xio_thread_exit+0x2d>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xio_thread_exit>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1134 <xio_thread_exit+0x14>
mov    %ebx,(%rax)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @xio_thread_exit(i32 %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = bitcast i8* %2 to i32*
store i32 %0, i32* %5
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @pthread_exit(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void shutDownDevice(const char *mess) { printf("\nSHUT DOWN: %s\n\n", mess); }


x86 assembly (clang, -O0):
<shutDownDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutDownDevice>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"\0ASHUT DOWN: %s\0A\0A\00"
define void @shutDownDevice(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void ff_hevc_put_hevc_epel_hv32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv32_12_sse4() {
ret void
}
unsigned char unsignedchar_ignoring_unsignedlonglong(unsigned char x,
                                                     unsigned long long y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_unsignedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedchar_ignoring_unsignedlonglong>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_unsignedlonglong(i8 returned zeroext %0, i64 %1) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int const);
void msleep(const int milliseconds) { usleep(milliseconds * 1000); }


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
void gdk_gc_set_clip_region() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_set_clip_region() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dealloc(void *);
void swbuf_free(void *b) { dealloc(b); }


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

x86 assembly (clang, -O2):
<swbuf_free>:
jmp    1030 <dealloc@plt>

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

LLVM IR (-O2):
define void @swbuf_free(i8* %0) {
%2 = tail call i32 @dealloc(i8* %0)
ret void
}
/* Type definitions */
typedef double uint32_t;

/* Variables and functions */
double to_real1(uint32_t v) { return v * (1.0 / 4294967295.0); }


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

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

LLVM IR (-O0):
define double @to_real1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3DF0000000100000
ret double %4
}

LLVM IR (-O2):
define double @to_real1(double %0) {
%2 = fmul double %0, 0x3DF0000000100000
ret double %2
}
void _exit(int satus) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
void _swapp(void **a, void **b) {
  void *aux = *a;
  *a = *b;
  *b = aux;
}


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

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

LLVM IR (-O0):
define void @_swapp(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @_swapp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
int __statfs64(const char *file, struct statfs64 *buf) {}


x86 assembly (clang, -O0):
<__statfs64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.statfs64 = type opaque
define i32 @__statfs64(i8* %0, %struct.statfs64* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.statfs64*
store i8* %0, i8** %4
store %struct.statfs64* %1, %struct.statfs64** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.statfs64 = type opaque
define i32 @__statfs64(i8* nocapture readnone %0, %struct.statfs64* nocapture readnone %1) {
ret i32 undef
}
void ice_flush_fdir_ctx(struct ice_pf *pf) {}


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

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

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

LLVM IR (-O2):
%struct.ice_pf = type opaque
define void @ice_flush_fdir_ctx(%struct.ice_pf* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port15__clear();
void Msp430InterruptC__2__HplInterrupt__clear(void) {
  HplMsp430InterruptP__Port15__clear();
}


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

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

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

LLVM IR (-O2):
define void @Msp430InterruptC__2__HplInterrupt__clear() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port15__clear()
ret void
}
char *tosMemory_peekString(int base, int offs) { return (char *)(base + offs); }


x86 assembly (clang, -O0):
<tosMemory_peekString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @tosMemory_peekString(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 = add nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @tosMemory_peekString(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int close_fs(int fd) {
  ;
  if (close(fd) == -1) {
    perror("close_fs error");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<close_fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1154 <close_fs+0x34>
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <close_fs+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_fs>:
push   %rax
call   1030 <close@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <close_fs+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"close_fs error\00"
define i32 @close_fs(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef unsigned long volatile uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void GPIOADCTriggerEnable(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  (*((volatile unsigned long *)(ui32Port + 0x00000530))) |= ui8Pins;
}


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

x86 assembly (clang, -O2):
<GPIOADCTriggerEnable>:
mov    %rsi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
or     %rax,0x530(%rdi)
ret

LLVM IR (-O0):
define void @GPIOADCTriggerEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 1328
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @GPIOADCTriggerEnable(i64 %0, i64 %1) {
%3 = alloca i64
store volatile i64 %1, i64* %3
%4 = load volatile i64, i64* %3
%5 = add nsw i64 %0, 1328
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, %4
store volatile i64 %8, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ invert(int, int, int);
int /*<<< orphan*/ printbits(int /*<<< orphan*/);
int main(void) {
  printbits(invert(1, 4, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
mov    $0x5,%edx
call   1030 <invert@plt>
mov    %eax,%edi
call   1040 <printbits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x4,%esi
mov    $0x5,%edx
call   1030 <invert@plt>
mov    %eax,%edi
call   1040 <printbits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @invert(i32 1, i32 4, i32 5)
%3 = call i32 @printbits(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @invert(i32 1, i32 4, i32 5)
%2 = tail call i32 @printbits(i32 %1)
ret i32 0
}
int dbsrc2pos(row, col)
int row, col;
{ return (((row - 2) / 2) * 64 + (col - 1)); }


x86 assembly (clang, -O0):
<dbsrc2pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
shl    $0x6,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbsrc2pos>:
mov    %edi,%eax
add    $0xfffffffe,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xfffffffe,%eax
shl    $0x5,%eax
and    $0xffffffc0,%eax
add    %esi,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @dbsrc2pos(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 = sub nsw i32 %5, 2
%7 = sdiv i32 %6, 2
%8 = mul nsw i32 %7, 64
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = add nsw i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @dbsrc2pos(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -2
%4 = sdiv i32 %3, 2
%5 = shl nsw i32 %4, 6
%6 = add nsw i32 %1, -1
%7 = add nsw i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 1, b = 1, c = -1;
  c = a ^ b;
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec0(%rip),%rdi
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    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
double wholedec(char *);
double fracdec(char *s) {
  int i;
  double divisor = 1.0;
  for (i = 0; *(s + i) != '\0'; ++i)
    divisor *= 12.0;
  return wholedec(s) / divisor;
}


x86 assembly (clang, -O0):
<fracdec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1165 <fracdec+0x55>
movsd  0xebb(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <fracdec+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <wholedec@plt>
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fracdec>:
push   %rax
cmpb   $0x0,(%rdi)
je     113f <fracdec+0x2f>
lea    0x1(%rdi),%rax
movsd  0xede(%rip),%xmm1
movsd  0xede(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
mulsd  %xmm0,%xmm1
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1130 <fracdec+0x20>
jmp    1147 <fracdec+0x37>
movsd  0xeb9(%rip),%xmm1
movsd  %xmm1,(%rsp)
call   1030 <wholedec@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fracdec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca double
store i8* %0, i8** %2
store double 1.000000e+00, double* %4
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %5
%14 = load double, double* %4
%15 = fmul double %14, 1.200000e+01
store double %15, double* %4
br label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = load i8*, i8** %2
%21 = call double @wholedec(i8* %20)
%22 = load double, double* %4
%23 = fdiv double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @fracdec(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi double [ %7, %4 ], [ 1.000000e+00, %1 ]
%7 = fmul double %6, 1.200000e+01
%8 = add nuw nsw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi double [ 1.000000e+00, %1 ], [ %7, %4 ]
%14 = tail call double @wholedec(i8* %0)
%15 = fdiv double %14, %13
ret double %15
}
int findLineNumber(const char *exp, int byteoffs) {
  int lc = 0;
  while (byteoffs-- > 0 && *exp)
    if (*exp++ == '\n')
      lc++;
  return lc;
}


x86 assembly (clang, -O0):
<findLineNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jle    113b <findLineNumber+0x3b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114b <findLineNumber+0x4b>
jmp    1174 <findLineNumber+0x74>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    116f <findLineNumber+0x6f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <findLineNumber+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findLineNumber>:
test   %esi,%esi
jle    112e <findLineNumber+0x2e>
add    $0x1,%esi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rdi),%ecx
test   %cl,%cl
je     112d <findLineNumber+0x2d>
add    $0x1,%rdi
xor    %edx,%edx
cmp    $0xa,%cl
sete   %dl
add    %edx,%eax
add    $0xffffffff,%esi
cmp    $0x1,%esi
jg     1110 <findLineNumber+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @findLineNumber(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 = %26, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ false, %6 ], [ %14, %10 ]
br i1 %16, label %17, label %27
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8, i8* %18
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 10
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %26
26: ; preds = %23, %17
br label %6
27: ; preds = %15
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @findLineNumber(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %17
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ %1, %2 ]
%6 = phi i32 [ %15, %10 ], [ 0, %2 ]
%7 = phi i8* [ %12, %10 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %4
%11 = add nsw i32 %5, -1
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = icmp eq i8 %8, 10
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %6, %14
%16 = icmp sgt i32 %5, 1
br i1 %16, label %4, label %17
17: ; preds = %4, %10, %2
%18 = phi i32 [ 0, %2 ], [ %15, %10 ], [ %6, %4 ]
ret i32 %18
}
/* Type definitions */
struct timeval {
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ display();
int /*<<< orphan*/ leddrive_event();
int /*<<< orphan*/ usleep(int);
void loop(void) {
  struct timeval sltime;
  sltime.tv_usec = 10000;
  leddrive_event();
  display();
  usleep(10000);
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2710,-0x8(%rbp)
mov    $0x0,%al
call   1040 <leddrive_event@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0x2710,%edi
call   1050 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rax
xor    %eax,%eax
call   1040 <leddrive_event@plt>
xor    %eax,%eax
call   1030 <display@plt>
mov    $0x2710,%edi
pop    %rax
jmp    1050 <usleep@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @loop() {
%1 = alloca %struct.timeval
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
store i32 10000, i32* %2
%3 = call i32 (...) @leddrive_event()
%4 = call i32 (...) @display()
%5 = call i32 @usleep(i32 10000)
ret void
}

LLVM IR (-O2):
define void @loop() {
%1 = tail call i32 (...) @leddrive_event()
%2 = tail call i32 (...) @display()
%3 = tail call i32 @usleep(i32 10000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zleak_free(void *, int, char *);
void zleak_str_free(void *ptr, int line, char *fn) {
  zleak_free(ptr, line, fn);
}


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

x86 assembly (clang, -O2):
<zleak_str_free>:
jmp    1030 <zleak_free@plt>

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

LLVM IR (-O2):
define void @zleak_str_free(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @zleak_free(i8* %0, i32 %1, i8* %2)
ret void
}
void ModelicaStreams_closeFile(const char *fileName) {}


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

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

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

LLVM IR (-O2):
define void @ModelicaStreams_closeFile(i8* nocapture %0) {
ret void
}
int conv_temp_fahr(int celsius) { return 9 * celsius / 5 + 32; }


x86 assembly (clang, -O0):
<conv_temp_fahr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x9,-0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_temp_fahr>:
lea    (%rdi,%rdi,8),%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x21,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x20,%eax
ret

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

LLVM IR (-O2):
define i32 @conv_temp_fahr(i32 %0) {
%2 = mul nsw i32 %0, 9
%3 = sdiv i32 %2, 5
%4 = add nsw i32 %3, 32
ret i32 %4
}
unsigned long svc_hash(void *key) { return (*(int *)key) % 100; }


x86 assembly (clang, -O0):
<svc_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<svc_hash>:
movslq (%rdi),%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
cltq
ret

LLVM IR (-O0):
define i64 @svc_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = srem i32 %5, 100
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @svc_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = srem i32 %3, 100
%5 = sext i32 %4 to i64
ret i64 %5
}