xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cyclic(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  printf("Enter N:");
  int n;
  scanf("%d", &n);
  cyclic(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <cyclic@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <cyclic@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Enter N:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @cyclic(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Enter N:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @cyclic(i32 %5)
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *kbasename(const char *path) {
  const char *tail = strrchr(path, '/');
  return tail ? tail + 1 : path;
}


x86 assembly (clang, -O0):
<kbasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <kbasename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <kbasename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbasename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @kbasename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @kbasename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int test_imm_2Cuint8_mem(unsigned char *val) {
  return ((*val) & (-0x2C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -44
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
struct TYPE_2__ {
  int /*<<< orphan*/ time;
};
typedef TYPE_1__ XButtonReleasedEvent;
typedef int /*<<< orphan*/ Widget;
typedef int /*<<< orphan*/ String;
typedef int /*<<< orphan*/ Cardinal;

/* Variables and functions */
int /*<<< orphan*/ do_select(int /*<<< orphan*/);
void selection(Widget w, XEvent *e, String *vector, Cardinal *count) {
  do_select(((XButtonReleasedEvent *)e)->time);
}


x86 assembly (clang, -O0):
<selection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <do_select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selection>:
mov    (%rsi),%edi
jmp    1030 <do_select@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @selection(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %6
%10 = bitcast i32* %9 to %struct.TYPE_2__*
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @do_select(i32 %12)
ret void
}

LLVM IR (-O2):
define void @selection(i32 %0, i32* nocapture %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = load i32, i32* %1
%6 = tail call i32 @do_select(i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
void setAlphabet(char *optarg) {
  FILE *alphaFile;
  alphaFile = fopen(optarg, "r");
  if (alphaFile == NULL) {
    perror("File Open Error");
    exit(1);
  }
  fclose(alphaFile);
}


x86 assembly (clang, -O0):
<setAlphabet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1181 <setAlphabet+0x41>
lea    0xe8e(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setAlphabet>:
push   %rax
lea    0xec6(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     115b <setAlphabet+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>
lea    0xe9e(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [16 x i8] c"File Open Error\00"
define void @setAlphabet(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [16 x i8] c"File Open Error\00"
define void @setAlphabet(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int core13_swap(char *, int);
int U_EMRALPHABLEND_swap(char *record, int torev) {
  return (core13_swap(record, torev));
}


x86 assembly (clang, -O0):
<U_EMRALPHABLEND_swap>:
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 <core13_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRALPHABLEND_swap>:
jmp    1030 <core13_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRALPHABLEND_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core13_swap(i8* %0, i32 %1)
ret i32 %3
}
int ep93xx_keypad_acquire_gpio(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @ep93xx_keypad_acquire_gpio(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct section_t {
  int dummy;
};

/* Variables and functions */
int config_parse_tag_hostlist(char *, struct section_t *);
int config_parse_tag_to(char *line, struct section_t *section) {
  return config_parse_tag_hostlist(line, section);
}


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

x86 assembly (clang, -O2):
<config_parse_tag_to>:
jmp    1030 <config_parse_tag_hostlist@plt>

LLVM IR (-O0):
%struct.section_t = type { i32 }
define i32 @config_parse_tag_to(i8* %0, %struct.section_t* %1) {
%3 = alloca i8*
%4 = alloca %struct.section_t*
store i8* %0, i8** %3
store %struct.section_t* %1, %struct.section_t** %4
%5 = load i8*, i8** %3
%6 = load %struct.section_t*, %struct.section_t** %4
%7 = call i32 @config_parse_tag_hostlist(i8* %5, %struct.section_t* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.section_t = type { i32 }
define i32 @config_parse_tag_to(i8* %0, %struct.section_t* %1) {
%3 = tail call i32 @config_parse_tag_hostlist(i8* %0, %struct.section_t* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ menu(int);
int /*<<< orphan*/ startpump(char *);
int main() {
  startpump("Welcome");
  menu(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <startpump@plt>
mov    $0x1,%edi
call   1030 <menu@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"Welcome\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @startpump(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @menu(i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Welcome\00"
define i32 @main() {
%1 = tail call i32 @startpump(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @menu(i32 1)
ret i32 0
}
void gdk_event_copy() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void delay(int msec) { usleep(msec * 1000); }


x86 assembly (clang, -O0):
<delay>:
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):
<delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay(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 @delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int has_SSE2(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @has_SSE2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int SwapLong(int in) {
  char sin[4];
  char sout[4];
  memcpy((char *)sin, (char *)&in, 4);
  sout[0] = sin[3];
  sout[1] = sin[2];
  sout[2] = sin[1];
  sout[3] = sin[0];
  return *((int *)sout);
}


x86 assembly (clang, -O0):
<SwapLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x5(%rbp),%al
mov    %al,-0xc(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapLong>:
push   %rax
mov    %edi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
bswap  %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SwapLong(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %2 to i8*
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 4)
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%9 = load i8, i8* %8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 %9, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%12 = load i8, i8* %11
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%15 = load i8, i8* %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 %15, i8* %16
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%18 = load i8, i8* %17
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
store i8 %18, i8* %19
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @SwapLong(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 4)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%8 = load i8, i8* %7
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%10 = load i8, i8* %9
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%12 = load i8, i8* %11
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = shl nuw i32 %14, 24
%16 = zext i8 %12 to i32
%17 = shl nuw nsw i32 %16, 16
%18 = zext i8 %10 to i32
%19 = shl nuw nsw i32 %18, 8
%20 = zext i8 %8 to i32
%21 = or i32 %19, %20
%22 = or i32 %21, %17
%23 = or i32 %22, %15
ret i32 %23
}
void TimerDMADisable(unsigned long ulBase, unsigned long ulDMASource) {

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) &= ~ulDMASource;
}


x86 assembly (clang, -O0):
<TimerDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerDMADisable>:
not    %rsi
and    %rsi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @TimerDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 12
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @TimerDMADisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ht_hash_string(const void *str, uint32_t max) {
  const char *s = str;
  uint32_t hash = 0;
  while (*s) {
    hash = (hash * 31) + *s;
    s++;
  }
  return hash % max;
}


x86 assembly (clang, -O0):
<ht_hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <ht_hash_string+0x48>
imul   $0x1f,-0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <ht_hash_string+0x1a>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <ht_hash_string+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ht_hash_string+0x10>
jmp    112b <ht_hash_string+0x2b>
xor    %eax,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ht_hash_string(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
store i32 0, i32* %6
br label %8
8: ; preds = %12, %2
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i32, i32* %6
%14 = mul nsw i32 %13, 31
%15 = load i8*, i8** %5
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = add nsw i32 %14, %17
store i32 %18, i32* %6
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
br label %8
21: ; preds = %8
%22 = load i32, i32* %6
%23 = load i32, i32* %4
%24 = srem i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @ht_hash_string(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = mul nsw i32 %7, 31
%10 = sext i8 %6 to i32
%11 = add nsw i32 %9, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = srem i32 %16, %1
ret i32 %17
}
/* Variables and functions */
int getpgrp();
int getpid();
int getsid(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, int);
void print_ids() { printf("%d: %d %d\n", getpid(), getpgrp(), getsid(0)); }


x86 assembly (clang, -O0):
<print_ids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <getpgrp@plt>
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
call   1050 <getsid@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %eax,%ecx
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ids>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <getpgrp@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1050 <getsid@plt>
lea    0xe9d(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%d: %d %d\0A\00"
define void @print_ids() {
%1 = call i32 (...) @getpid()
%2 = call i32 (...) @getpgrp()
%3 = call i32 @getsid(i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d: %d %d\0A\00"
define void @print_ids() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getpgrp()
%3 = tail call i32 @getsid(i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
float random();
float random01() { return random() / (float)RAND_MAX; }


x86 assembly (clang, -O0):
<random01>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
mov    0x2ec6(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random01>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
mov    0x2ec9(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @random01() {
%1 = call float (...) @random()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to float
%4 = fdiv float %1, %3
ret float %4
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @random01() {
%1 = tail call float (...) @random()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to float
%4 = fdiv float %1, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ dma_channel_read(int /*<<< orphan*/);
void pit_refresh_timer_xt(int new_out, int old_out) {
  if (new_out && !old_out)
    dma_channel_read(0);
}


x86 assembly (clang, -O0):
<pit_refresh_timer_xt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1139 <pit_refresh_timer_xt+0x29>
cmpl   $0x0,-0x8(%rbp)
jne    1139 <pit_refresh_timer_xt+0x29>
xor    %edi,%edi
call   1030 <dma_channel_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_refresh_timer_xt>:
test   %edi,%edi
je     111f <pit_refresh_timer_xt+0xf>
test   %esi,%esi
jne    111f <pit_refresh_timer_xt+0xf>
xor    %edi,%edi
jmp    1030 <dma_channel_read@plt>
ret

LLVM IR (-O0):
define void @pit_refresh_timer_xt(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @dma_channel_read(i32 0)
br label %12
12: ; preds = %10, %7, %2
ret void
}

LLVM IR (-O2):
define void @pit_refresh_timer_xt(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @dma_channel_read(i32 0)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b();
int /*<<< orphan*/ g();
void a() {
  g();
  b();
}


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

x86 assembly (clang, -O2):
<a>:
push   %rax
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <b@plt>

LLVM IR (-O0):
define void @a() {
%1 = call i32 (...) @g()
%2 = call i32 (...) @b()
ret void
}

LLVM IR (-O2):
define void @a() {
%1 = tail call i32 (...) @g()
%2 = tail call i32 (...) @b()
ret void
}
/* Variables and functions */
bool checkUpperCase(char charToCheck) {
  return (charToCheck >= 'A' && charToCheck <= 'Z');
}


x86 assembly (clang, -O0):
<checkUpperCase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <checkUpperCase+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkUpperCase>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @checkUpperCase(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @checkUpperCase(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int epnum_to_epindex(int epnum, int dir_in) {
  return epnum ? (epnum * 2 - dir_in) : 0;
}


x86 assembly (clang, -O0):
<epnum_to_epindex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1125 <epnum_to_epindex+0x25>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112f <epnum_to_epindex+0x2f>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <epnum_to_epindex+0x2f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<epnum_to_epindex>:
lea    (%rdi,%rdi,1),%eax
sub    %esi,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @epnum_to_epindex(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 2
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %7
%14 = phi i32 [ %11, %7 ], [ 0, %12 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @epnum_to_epindex(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = shl nsw i32 %0, 1
%5 = sub nsw i32 %4, %1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ db_floating_format(float, int, char *, int /*<<< orphan*/,
                                      int);
char *tochar2(float value, int len) {
  static char s[20];
  db_floating_format(value, len, s, 0, len - 1);
  return s;
}


x86 assembly (clang, -O0):
<tochar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
lea    0x2f0b(%rip),%rsi
xor    %edx,%edx
call   1030 <db_floating_format@plt>
lea    0x2efd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tochar2>:
push   %rbx
lea    -0x1(%rdi),%ecx
lea    0x2f25(%rip),%rbx
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <db_floating_format@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@tochar2.s = internal global [20 x i8] zeroinitializer
define i8* @tochar2(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = call i32 @db_floating_format(float %5, i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @tochar2.s, i64 0, i64 0), i32 0, i32 %8)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @tochar2.s, i64 0, i64 0)
}

LLVM IR (-O2):
@tochar2.s = internal global [20 x i8] zeroinitializer
define i8* @tochar2(float %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @db_floating_format(float %0, i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @tochar2.s, i64 0, i64 0), i32 0, i32 %3)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @tochar2.s, i64 0, i64 0)
}
/* Variables and functions */
unsigned int __blsfill_u32(unsigned int);
unsigned int test__blsfill_u32(unsigned int a) { return __blsfill_u32(a); }


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

x86 assembly (clang, -O2):
<test__blsfill_u32>:
jmp    1030 <__blsfill_u32@plt>

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

LLVM IR (-O2):
define i32 @test__blsfill_u32(i32 %0) {
%2 = tail call i32 @__blsfill_u32(i32 %0)
ret i32 %2
}
unsigned long SysCtlGetNmiConfig() {
  return (*((volatile unsigned long *)(0x400FBA00 + 0x00000000)));
}


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

x86 assembly (clang, -O2):
<SysCtlGetNmiConfig>:
mov    0x400fba00,%rax
40
ret

LLVM IR (-O0):
define i64 @SysCtlGetNmiConfig() {
%1 = load volatile i64, i64* inttoptr (i64 1074772480 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @SysCtlGetNmiConfig() {
%1 = load volatile i64, i64* inttoptr (i64 1074772480 to i64*)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void fail_writer(char *test_name, char *message) {
  fprintf(stderr, "Writer test %s failed: %s\n", test_name, message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fail_writer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail_writer>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Writer test %s failed: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fail_writer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Writer test %s failed: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fail_writer(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void foo(void) {
  char *tmp = NULL;
  *tmp = 0;
  printf("xxx=%s\n", tmp);
  free(tmp);
  free(tmp);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [8 x i8] c"xxx=%s\0A\00"
define void @foo() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
store i8 0, i8* %2
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
int calc_IO_offset(int tp_num) {
  return (0xC + !(tp_num & 1) + ((tp_num & 0xE) << 1));
}


x86 assembly (clang, -O0):
<calc_IO_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0xc,%eax
mov    -0x4(%rbp),%ecx
and    $0xe,%ecx
shl    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_IO_offset>:
mov    %edi,%ecx
and    $0x1,%ecx
and    $0xe,%edi
lea    (%rdi,%rdi,1),%eax
sub    %ecx,%eax
add    $0xd,%eax
ret

LLVM IR (-O0):
define i32 @calc_IO_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = add nsw i32 12, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 14
%11 = shl i32 %10, 1
%12 = add nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @calc_IO_offset(i32 %0) {
%2 = and i32 %0, 1
%3 = sub nuw nsw i32 13, %2
%4 = shl i32 %0, 1
%5 = and i32 %4, 28
%6 = add nuw nsw i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_extended_info(void) {
  printf("ZLIB_ENABLED "
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"ZLIB_ENABLED \00"
define void @print_extended_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x38() {
  Assert_real((isodigit(56) == 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_isodigit.c",
              285, ("isodigit should be 0 for 8"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for 8\00"
define void @t_isodigit_0x38() {
%1 = tail call i64 @isodigit(i32 56)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((no)) int bar(int b) { return b; }


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

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

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

LLVM IR (-O2):
define i32 @bar(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int BIT(int);
int /*<<< orphan*/ cpu_relax();
int davinci_rtcif_read(int);
void davinci_rtcif_wait(void) {
  while (davinci_rtcif_read(0x04) & BIT(31))
    cpu_relax();
}


x86 assembly (clang, -O0):
<davinci_rtcif_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    113d <davinci_rtcif_wait+0xd>
mov    $0x4,%edi
call   1050 <davinci_rtcif_read@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1f,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
je     1170 <davinci_rtcif_wait+0x40>
mov    $0x0,%al
call   1040 <cpu_relax@plt>
jmp    113d <davinci_rtcif_wait+0xd>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<davinci_rtcif_wait>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x4,%edi
call   1050 <davinci_rtcif_read@plt>
mov    %eax,%ebx
mov    $0x1f,%edi
call   1030 <BIT@plt>
test   %ebx,%eax
je     1163 <davinci_rtcif_wait+0x33>
xor    %eax,%eax
call   1040 <cpu_relax@plt>
jmp    1140 <davinci_rtcif_wait+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @davinci_rtcif_wait() {
br label %1
1: ; preds = %6, %0
%2 = call i32 @davinci_rtcif_read(i32 4)
%3 = call i32 @BIT(i32 31)
%4 = and i32 %2, %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @cpu_relax()
br label %1
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @davinci_rtcif_wait() {
%1 = tail call i32 @davinci_rtcif_read(i32 4)
%2 = tail call i32 @BIT(i32 31)
%3 = and i32 %2, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %0, %5
%6 = tail call i32 (...) @cpu_relax()
%7 = tail call i32 @davinci_rtcif_read(i32 4)
%8 = tail call i32 @BIT(i32 31)
%9 = and i32 %8, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %0
ret void
}
void *test_anti_range_120(int n) {
  extern void *alloc_anti_range_120(int) __attribute__((alloc_size(1)));
  if ((-0x7fffffff - 1) + 2 <= n && n <= 0)
    n = (-0x7fffffff - 1) + 2 - 1;
  return alloc_anti_range_120(n);
}


x86 assembly (clang, -O0):
<test_anti_range_120>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80000002,%eax
cmp    -0x4(%rbp),%eax
jg     113a <test_anti_range_120+0x2a>
cmpl   $0x0,-0x4(%rbp)
jg     113a <test_anti_range_120+0x2a>
movl   $0x80000001,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_120@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_120>:
lea    0x7ffffffe(%rdi),%eax
cmp    $0x7fffffff,%eax
mov    $0x80000001,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_120@plt>

LLVM IR (-O0):
define i8* @test_anti_range_120(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 -2147483646, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -2147483647, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_120(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_120(i32 %0) {
%2 = add i32 %0, 2147483646
%3 = icmp ult i32 %2, 2147483647
%4 = select i1 %3, i32 -2147483647, i32 %0
%5 = tail call i8* @alloc_anti_range_120(i32 %4)
ret i8* %5
}
int main(int argc, char **argv) { int intArray[10]; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [10 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void usage_info() {
  printf(" Usage: jacobi [ -s <vector number> ] (default: %d)\n", 3);
  printf("               [ -i <iteration> ] (default: %d)\n", 100);
  printf("               [ -v <init value> ] (default: %d)\n", 10);
  printf("               [ -n <nodes number> ] (default: %d)\n", 1);
}


x86 assembly (clang, -O0):
<usage_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
lea    0xf29(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xf4a(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage_info>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
lea    0xf2c(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xf4d(%rip),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [53 x i8] c" Usage: jacobi [ -s <vector number> ] (default: %d)\0A\00"
@.str.1 = [49 x i8] c" [ -i <iteration> ] (default: %d)\0A\00"
@.str.2 = [50 x i8] c" [ -v <init value> ] (default: %d)\0A\00"
@.str.3 = [52 x i8] c" [ -n <nodes number> ] (default: %d)\0A\00"
define void @usage_info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 100)
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c" Usage: jacobi [ -s <vector number> ] (default: %d)\0A\00"
@.str.1 = [49 x i8] c" [ -i <iteration> ] (default: %d)\0A\00"
@.str.2 = [50 x i8] c" [ -v <init value> ] (default: %d)\0A\00"
@.str.3 = [52 x i8] c" [ -n <nodes number> ] (default: %d)\0A\00"
define void @usage_info() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 100)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  fun(3);
  printf("The answer is %d\n", fun(10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <fun@plt>
mov    $0xa,%edi
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"The answer is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fun(i32 3)
%3 = call i32 @fun(i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The answer is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fun(i32 3)
%2 = tail call i32 @fun(i32 10)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int test_imm_2Fint64_lowword_reg(long long val) {
  return ((val) & (0x2F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Fint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 47
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xb1() {
  Assert_real((isodigit(177) == 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_isodigit.c",
              890, ("isodigit should be 0 for 0xb1"));
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_v64_8_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdin;
int vfscanf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vscanf(const char *format, va_list args) {
  return vfscanf(stdin, format, args);
}


x86 assembly (clang, -O0):
<vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfscanf@plt>

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @vfscanf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}