xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ handle_request(int);
void dispatch_connection_serialized(int fd) {
  handle_request(fd);
  close(fd);
}


x86 assembly (clang, -O0):
<dispatch_connection_serialized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <handle_request@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispatch_connection_serialized>:
push   %rbx
mov    %edi,%ebx
call   1040 <handle_request@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @dispatch_connection_serialized(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @handle_request(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
define void @dispatch_connection_serialized(i32 %0) {
%2 = tail call i32 @handle_request(i32 %0)
%3 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *d = malloc(strlen(s) + 1);
  strcpy(d, s);
  return d;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int chartoint(char inteiro) {
  int temp;
  temp = inteiro - '0';
  return temp;
}


x86 assembly (clang, -O0):
<chartoint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chartoint>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @chartoint(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 48
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @chartoint(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xc9() {
  Assert_real((isspace(201) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1010, ("isspace should be 0 for 0xc9"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xc9\00"
define void @t_isspace_0xc9() {
%1 = tail call i64 @isspace(i32 201)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1010, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __infer_nondet_int();
int isleadbyte(int wc) { return __infer_nondet_int(); }


x86 assembly (clang, -O0):
<isleadbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isleadbyte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @isleadbyte(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
int isPositive(int x) { return (((~x + 1) >> 31) & (~(x >> 31))) & 1; }


x86 assembly (clang, -O0):
<isPositive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
sar    $0x1f,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPositive>:
mov    %edi,%ecx
not    %ecx
shr    $0x1f,%ecx
xor    %eax,%eax
add    $0xffffffff,%edi
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isPositive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = add nsw i32 %4, 1
%6 = ashr i32 %5, 31
%7 = load i32, i32* %2
%8 = ashr i32 %7, 31
%9 = xor i32 %8, -1
%10 = and i32 %6, %9
%11 = and i32 %10, 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @isPositive(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp slt i32 %2, 0
%4 = xor i32 %0, -1
%5 = lshr i32 %4, 31
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
void exynos5_default_sdhci3(void) {}


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

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

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

LLVM IR (-O2):
define void @exynos5_default_sdhci3() {
ret void
}
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
scalar_t__ __pututline(struct utmp const *);
struct utmpx *pututxline(const struct utmpx *utmpx) {
  return (struct utmpx *)__pututline((const struct utmp *)utmpx);
}


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

x86 assembly (clang, -O2):
<pututxline>:
jmp    1030 <__pututline@plt>

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @pututxline(%struct.utmpx* %0) {
%2 = alloca %struct.utmpx*
store %struct.utmpx* %0, %struct.utmpx** %2
%3 = load %struct.utmpx*, %struct.utmpx** %2
%4 = bitcast %struct.utmpx* %3 to %struct.utmp*
%5 = call i64 @__pututline(%struct.utmp* %4)
%6 = inttoptr i64 %5 to %struct.utmpx*
ret %struct.utmpx* %6
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @pututxline(%struct.utmpx* %0) {
%2 = bitcast %struct.utmpx* %0 to %struct.utmp*
%3 = tail call i64 @__pututline(%struct.utmp* %2)
%4 = inttoptr i64 %3 to %struct.utmpx*
ret %struct.utmpx* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int segv_handler(void) {
  printf("**************************************************\n");
  printf("SIGSEGV caught\n");
  printf("Self-modifying code test FAILED!\n");
  printf("**************************************************\n");
  exit(-1);
  return 0;
}


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

x86 assembly (clang, -O2):
<segv_handler>:
push   %rbx
lea    0xf08(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"**************************************************\0A\00"
@.str.1 = [16 x i8] c"SIGSEGV caught\0A\00"
@.str.2 = [34 x i8] c"Self-modifying code test FAILED!\0A\00"
define i32 @segv_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str.3 = [15 x i8] c"SIGSEGV caught\00"
@str.4 = [33 x i8] c"Self-modifying code test FAILED!\00"
@str.5 = [51 x i8] c"**************************************************\00"
define i32 @segv_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.5, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
  int rem;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
div_t div(int numer, int denom) {
  div_t result;
  result.quot = numer / denom;
  result.rem = numer - (result.quot * denom);
  return result;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i64 @div(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = sdiv i32 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load i32, i32* %5
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %10, %14
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i32 %15, i32* %16
%17 = bitcast %struct.TYPE_3__* %3 to i64*
%18 = load i64, i64* %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = mul nsw i32 %3, %1
%5 = srem i32 %0, %1
%6 = zext i32 %5 to i64
%7 = shl nuw i64 %6, 32
%8 = zext i32 %3 to i64
%9 = or i64 %7, %8
ret i64 %9
}
int test_imm_7Eint8_reg(signed char val) {
  return ((val) & (-0x7E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Eint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -126
%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_7Eint8_reg(i8 signext %0) {
%2 = and i8 %0, -126
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char readbiosb(int);
char getnumcols(void) { return readbiosb(0x44a); }


x86 assembly (clang, -O0):
<getnumcols>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44a,%edi
call   1030 <readbiosb@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnumcols>:
mov    $0x44a,%edi
jmp    1030 <readbiosb@plt>

LLVM IR (-O0):
define signext i8 @getnumcols() {
%1 = call signext i8 @readbiosb(i32 1098)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @getnumcols() {
%1 = tail call signext i8 @readbiosb(i32 1098)
ret i8 %1
}
unsigned int hash(int i) { return i * 433; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x1b1,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
imul   $0x1b1,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = mul nsw i32 %0, 433
ret i32 %2
}
void streamDefHistory(int streamID, int length, const char *history) {
  (void)streamID;
  (void)length;
  (void)history;
}


x86 assembly (clang, -O0):
<streamDefHistory>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @streamDefHistory(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ CloseFileIfNeeded(void *, int /*<<< orphan*/ *, int *, int *,
                                     int, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
void CloseNetworkFiles(void *theEnv, FILE *networkFile, int maxIndices) {
  int count = maxIndices;
  int arrayVersion = 0;
  if (networkFile != NULL) {
    CloseFileIfNeeded(theEnv, networkFile, &count, &arrayVersion, maxIndices,
                      NULL, NULL);
  }
}


x86 assembly (clang, -O0):
<CloseNetworkFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1161 <CloseNetworkFiles+0x51>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%r8d
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
movq   $0x0,(%rsp)
call   1030 <CloseFileIfNeeded@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CloseNetworkFiles>:
sub    $0x18,%rsp
mov    %edx,0x14(%rsp)
movl   $0x0,0x10(%rsp)
test   %rsi,%rsi
je     1142 <CloseNetworkFiles+0x32>
mov    %edx,%r8d
movq   $0x0,(%rsp)
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %r9d,%r9d
call   1030 <CloseFileIfNeeded@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @CloseNetworkFiles(i8* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
store i32 %2, i32* %4
%7 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%8 = icmp eq i32* %1, null
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = call i32 @CloseFileIfNeeded(i8* %0, i32* %1, i32* %4, i32* %5, i32 %2, i32* null, i32* null)
br label %11
11: ; preds = %9, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_digits(char, char, char, char *, char *);
int /*<<< orphan*/ printf(char *);
void test_add_digits() {
  char total, carry;
  add_digits('7', '4', '1', &total, &carry);
  if (total == '2' && carry == '1') {
    printf("add_digits passed\n");
  } else {
    printf("add_digits failed\n");
  }
}


x86 assembly (clang, -O0):
<test_add_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x37,%edi
mov    $0x34,%esi
mov    $0x31,%edx
lea    -0x1(%rbp),%rcx
lea    -0x2(%rbp),%r8
call   1040 <add_digits@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x32,%eax
jne    116f <test_add_digits+0x4f>
movsbl -0x2(%rbp),%eax
cmp    $0x31,%eax
jne    116f <test_add_digits+0x4f>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <test_add_digits+0x5b>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_add_digits>:
push   %rax
lea    0x7(%rsp),%rcx
lea    0x6(%rsp),%r8
mov    $0x37,%edi
mov    $0x34,%esi
mov    $0x31,%edx
call   1040 <add_digits@plt>
mov    0x7(%rsp),%al
xor    $0x32,%al
mov    0x6(%rsp),%cl
xor    $0x31,%cl
lea    0xebf(%rip),%rdx
lea    0xea6(%rip),%rdi
or     %al,%cl
cmove  %rdx,%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"add_digits passed\0A\00"
@.str.1 = [19 x i8] c"add_digits failed\0A\00"
define void @test_add_digits() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @add_digits(i8 signext 55, i8 signext 52, i8 signext 49, i8* %1, i8* %2)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 50
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 49
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %7, %0
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"add_digits failed\00"
@str.2 = [18 x i8] c"add_digits passed\00"
define void @test_add_digits() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @add_digits(i8 signext 55, i8 signext 52, i8 signext 49, i8* %1, i8* %2)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 50
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 49
%8 = select i1 %5, i1 %7, i1 false
%9 = select i1 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int gui_window_get_height();
int /*<<< orphan*/ snprintf(char *, int, char *, int);
const char *plugin_api_info_term_height_cb(const void *pointer, void *data,
                                           const char *info_name,
                                           const char *arguments) {
  static char value[32];
  (void)pointer;
  (void)data;
  (void)info_name;
  (void)arguments;
  snprintf(value, sizeof(value), "%d", gui_window_get_height());
  return value;
}


x86 assembly (clang, -O0):
<plugin_api_info_term_height_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <gui_window_get_height@plt>
mov    %eax,%ecx
lea    0x2ef8(%rip),%rdi
mov    $0x20,%esi
lea    0xeac(%rip),%rdx
call   1040 <snprintf@plt>
lea    0x2ee0(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_info_term_height_cb>:
push   %rbx
xor    %eax,%eax
call   1030 <gui_window_get_height@plt>
lea    0x2f11(%rip),%rbx
lea    0xeca(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %eax,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@plugin_api_info_term_height_cb.value = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @plugin_api_info_term_height_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 (...) @gui_window_get_height()
%14 = call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_term_height_cb.value, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_term_height_cb.value, i64 0, i64 0)
}

LLVM IR (-O2):
@plugin_api_info_term_height_cb.value = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @plugin_api_info_term_height_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (...) @gui_window_get_height()
%6 = tail call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_term_height_cb.value, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_term_height_cb.value, i64 0, i64 0)
}
void __ipipe_init(void) {}


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

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

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

LLVM IR (-O2):
define void @__ipipe_init() {
ret void
}
double Kmh2ms(const double valueKmh) { return valueKmh / 3.6; }


x86 assembly (clang, -O0):
<Kmh2ms>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @Kmh2ms(double %0) {
%2 = fdiv double %0, 3.600000e+00
ret double %2
}
/* Variables and functions */
int random_below(int);
int random_draw(int x, int y) { return random_below(y) < x; }


x86 assembly (clang, -O0):
<random_draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <random_below@plt>
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_draw>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <random_below@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_draw(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 = call i32 @random_below(i32 %5)
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @random_draw(i32 %0, i32 %1) {
%3 = tail call i32 @random_below(i32 %1)
%4 = icmp slt i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_D4int8_reg(signed char val) {
  return ((val) & (0xD4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D4int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 212
%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_D4int8_reg(i8 signext %0) {
%2 = and i8 %0, -44
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
long set_nest_flg(long, int);
long end_nest_flg(long flg_n) { return set_nest_flg(flg_n, -1); }


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

x86 assembly (clang, -O2):
<end_nest_flg>:
mov    $0xffffffff,%esi
jmp    1030 <set_nest_flg@plt>

LLVM IR (-O0):
define i64 @end_nest_flg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @set_nest_flg(i64 %3, i32 -1)
ret i64 %4
}

LLVM IR (-O2):
define i64 @end_nest_flg(i64 %0) {
%2 = tail call i64 @set_nest_flg(i64 %0, i32 -1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ genSwaraValue(int, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("in Main");
  genSwaraValue(1, 1);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <genSwaraValue@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <genSwaraValue@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"in Main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @genSwaraValue(i32 1, i32 1)
ret i32 1
}
/* Variables and functions */
int calculator();
int /*<<< orphan*/ make_empty();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  make_empty();
  int result = calculator();
  printf("value of expression: %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <make_empty@plt>
mov    $0x0,%al
call   1040 <calculator@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <make_empty@plt>
xor    %eax,%eax
call   1040 <calculator@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"value of expression: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @make_empty()
%2 = tail call i32 (...) @calculator()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
bool cc3_pixbuf_frame_set_roi(int16_t x0, int16_t y0, int16_t x1, int16_t y1) {
  return false;
}


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

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

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

LLVM IR (-O2):
define i32 @cc3_pixbuf_frame_set_roi(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
TIFFSwabLong(lp) unsigned long *lp;
{
  register unsigned char *cp = (unsigned char *)lp;
  int t;
  t = cp[3];
  cp[3] = cp[0];
  cp[0] = t;
  t = cp[2];
  cp[2] = cp[1];
  cp[1] = t;
}


x86 assembly (clang, -O0):
<TIFFSwabLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TIFFSwabLong>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %al,0x3(%rdi)
mov    %cl,(%rdi)
rolw   $0x8,0x1(%rdi)
ret

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

LLVM IR (-O2):
define i32 @TIFFSwabLong(i64* nocapture %0) {
%2 = bitcast i64* %0 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 3
%4 = load i8, i8* %3
%5 = load i8, i8* %2
store i8 %5, i8* %3
store i8 %4, i8* %2
%6 = getelementptr inbounds i8, i8* %2, i64 2
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %2, i64 1
%9 = load i8, i8* %8
store i8 %9, i8* %6
store i8 %7, i8* %8
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int mocksuspend_prepare(void) {
  printf("mocksuspend prepare\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"mocksuspend prepare\00"
define i32 @mocksuspend_prepare() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CloseGPin(int);
int /*<<< orphan*/ SetPinValue(int, int /*<<< orphan*/);
int LEDOff(int GPIO_num) {
  SetPinValue(GPIO_num, 0);
  CloseGPin(GPIO_num);
  return 1;
}


x86 assembly (clang, -O0):
<LEDOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <SetPinValue@plt>
mov    -0x4(%rbp),%edi
call   1040 <CloseGPin@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEDOff>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <SetPinValue@plt>
mov    %ebx,%edi
call   1040 <CloseGPin@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @LEDOff(i32 %0) {
%2 = tail call i32 @SetPinValue(i32 %0, i32 0)
%3 = tail call i32 @CloseGPin(i32 %0)
ret i32 1
}
unsigned int get_index(const unsigned int i, const unsigned int j,
                       const unsigned int N) {
  unsigned int index = 0;
  return i * N + j;
}


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
imul   %edx,%edi
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @get_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = mul i32 %8, %9
%11 = load i32, i32* %5
%12 = add i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_index(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %0
%5 = add i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int avx2_fallback() {
  printf("v3: -1 -1 -1 -1\n");
  printf("v4: -5 2 8 -1\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"v3: -1 -1 -1 -1\00"
@str.2 = [14 x i8] c"v4: -5 2 8 -1\00"
define i32 @avx2_fallback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
double CMtoMI(double CM) { return CM / 160934.4; }


x86 assembly (clang, -O0):
<CMtoMI>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @CMtoMI(double %0) {
%2 = fdiv double %0, 0x4103A53333333333
ret double %2
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
void copyV1() {
  int c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<copyV1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
je     115b <copyV1+0x3b>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    1132 <copyV1+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyV1>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <copyV1+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <copyV1+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @copyV1() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fpga_writel(int, int);
void rst_lm32(int rst) { fpga_writel(1 << 2, 0x10300 + (rst ? 0x4 : 0x0)); }


x86 assembly (clang, -O0):
<rst_lm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %esi,%esi
mov    $0x4,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
add    $0x10300,%esi
mov    $0x4,%edi
call   1030 <fpga_writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rst_lm32>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    0x10300(,%rax,4),%esi
mov    $0x4,%edi
jmp    1030 <fpga_writel@plt>

LLVM IR (-O0):
define void @rst_lm32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 4, i32 0
%7 = add nsw i32 66304, %6
%8 = call i32 @fpga_writel(i32 4, i32 %7)
ret void
}

LLVM IR (-O2):
define void @rst_lm32(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 66304, i32 66308
%4 = tail call i32 @fpga_writel(i32 4, i32 %3)
ret void
}
void cond_dummy_cover(const struct XCSF *xcsf, const struct Cl *c,
                      const double *x) {
  (void)xcsf;
  (void)c;
  (void)x;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_cover(%struct.XCSF* %0, %struct.Cl* %1, double* %2) {
%4 = alloca %struct.XCSF*
%5 = alloca %struct.Cl*
%6 = alloca double*
store %struct.XCSF* %0, %struct.XCSF** %4
store %struct.Cl* %1, %struct.Cl** %5
store double* %2, double** %6
%7 = load %struct.XCSF*, %struct.XCSF** %4
%8 = load %struct.Cl*, %struct.Cl** %5
%9 = load double*, double** %6
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dummy_cover(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, double* nocapture %2) {
ret void
}
/* Variables and functions */
unsigned int atomic_exchange_and_add(unsigned int volatile *, int);
unsigned int atomic_add_int_nv(volatile unsigned int *target, int delta) {
  return atomic_exchange_and_add(target, delta) + 1;
}


x86 assembly (clang, -O0):
<atomic_add_int_nv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <atomic_exchange_and_add@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add_int_nv>:
push   %rax
call   1030 <atomic_exchange_and_add@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @atomic_add_int_nv(i32* %0, i32 %1) {
%3 = tail call i32 @atomic_exchange_and_add(i32* %0, i32 %1)
%4 = add i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SA1AbsoluteLong(int);
int /*<<< orphan*/ STA16(int /*<<< orphan*/, int);
void Op8FM0(void) { STA16(SA1AbsoluteLong(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op8FM0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1AbsoluteLong@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STA16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op8FM0>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1AbsoluteLong@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STA16@plt>

LLVM IR (-O0):
define void @Op8FM0() {
%1 = call i32 @SA1AbsoluteLong(i32 2)
%2 = call i32 @STA16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op8FM0() {
%1 = tail call i32 @SA1AbsoluteLong(i32 2)
%2 = tail call i32 @STA16(i32 %1, i32 16777215)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void __set_FPEXC(uint32_t fpexc) {}


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

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

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

LLVM IR (-O2):
define void @__set_FPEXC(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xmapping_display(void *_p) {
  return (void *)((XEvent *)_p)->xmapping.display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XEvent_xmapping_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int /*<<< orphan*/);
void TOSH_SET_RADIO_CSN_PIN() { set_io_bit(-1, 0); }


x86 assembly (clang, -O0):
<TOSH_SET_RADIO_CSN_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_RADIO_CSN_PIN>:
mov    $0xffffffff,%edi
xor    %esi,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_RADIO_CSN_PIN() {
%1 = call i32 @set_io_bit(i32 -1, i32 0)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_RADIO_CSN_PIN() {
%1 = tail call i32 @set_io_bit(i32 -1, i32 0)
ret void
}
int iscntrl(int character) {
  return (character >= 0x00 && character <= 0x1F) || (character == 0x7F);
}


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <iscntrl+0x2a>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
time_t op_get_mtime(char const *file) {
  struct stat st;
  if (stat(file, &st))
    return 0;
  return st.st_mtime;
}


x86 assembly (clang, -O0):
<op_get_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <op_get_mtime+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1145 <op_get_mtime+0x35>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_get_mtime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <op_get_mtime+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @op_get_mtime(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @op_get_mtime(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}