xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t strlen(const char *str) {
  const char *s;
  for (s = str; *s; ++s) {
  }
  return (s - str);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int initDMX() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @initDMX() {
ret i32 0
}
void U210ToABGR() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _free_device_list(struct ibv_device **);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
void ibv_free_device_list(struct ibv_device **list) {
  dmtcp_plugin_disable_ckpt();
  _free_device_list(list);
  dmtcp_plugin_enable_ckpt();
}


x86 assembly (clang, -O0):
<ibv_free_device_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_free_device_list@plt>
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_free_device_list>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
call   1030 <_free_device_list@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <dmtcp_plugin_enable_ckpt@plt>

LLVM IR (-O0):
%struct.ibv_device = type { i32 }
define void @ibv_free_device_list(%struct.ibv_device** %0) {
%2 = alloca %struct.ibv_device**
store %struct.ibv_device** %0, %struct.ibv_device*** %2
%3 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%4 = load %struct.ibv_device**, %struct.ibv_device*** %2
%5 = call i32 @_free_device_list(%struct.ibv_device** %4)
%6 = call i32 (...) @dmtcp_plugin_enable_ckpt()
ret void
}

LLVM IR (-O2):
%struct.ibv_device = type { i32 }
define void @ibv_free_device_list(%struct.ibv_device** %0) {
%2 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%3 = tail call i32 @_free_device_list(%struct.ibv_device** %0)
%4 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret void
}
/* Variables and functions */
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int GTGetCharFromStdin(void) { return getc(stdin); }


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

x86 assembly (clang, -O2):
<GTGetCharFromStdin>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @GTGetCharFromStdin() {
%1 = load i32, i32* @stdin
%2 = call i32 @getc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @GTGetCharFromStdin() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
ret i32 %2
}
void histsave(lno, cmd, dowrite) int lno;
const char *cmd;
int dowrite;
{ errorf("history not enabled"); }


x86 assembly (clang, -O0):
<histsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <errorf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<histsave>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <errorf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"history not enabled\00"
define void @histsave(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @errorf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"history not enabled\00"
define void @histsave(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @errorf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
val_cptGEN(bb_gen1, bb_gen2, bb_dmu, cc) int *bb_gen1, *bb_gen2, *bb_dmu, cc;
{
  int st;
  val_cptGENState(&st, cc);
  val_gen1(bb_gen1, st);
  val_gen2(bb_gen2, st);
  val_gen_dmu(bb_dmu, st);
}


x86 assembly (clang, -O0):
<val_cptGEN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1050 <val_cptGENState@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    $0x0,%al
call   1040 <val_gen1@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    $0x0,%al
call   1060 <val_gen2@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    $0x0,%al
call   1030 <val_gen_dmu@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_cptGEN>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
mov    %ecx,%esi
xor    %eax,%eax
call   1050 <val_cptGENState@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <val_gen1@plt>
mov    0xc(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <val_gen2@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <val_gen_dmu@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @val_cptGEN(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
%11 = load i32, i32* %9
%12 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_cptGENState to i32 (i32*, i32, ...)*)(i32* %10, i32 %11)
%13 = load i32*, i32** %6
%14 = load i32, i32* %10
%15 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen1 to i32 (i32*, i32, ...)*)(i32* %13, i32 %14)
%16 = load i32*, i32** %7
%17 = load i32, i32* %10
%18 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen2 to i32 (i32*, i32, ...)*)(i32* %16, i32 %17)
%19 = load i32*, i32** %8
%20 = load i32, i32* %10
%21 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen_dmu to i32 (i32*, i32, ...)*)(i32* %19, i32 %20)
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @val_cptGEN(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_cptGENState to i32 (i32*, i32, ...)*)(i32* %5, i32 %3)
%8 = load i32, i32* %5
%9 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen1 to i32 (i32*, i32, ...)*)(i32* %0, i32 %8)
%10 = load i32, i32* %5
%11 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen2 to i32 (i32*, i32, ...)*)(i32* %1, i32 %10)
%12 = load i32, i32* %5
%13 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen_dmu to i32 (i32*, i32, ...)*)(i32* %2, i32 %12)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ initTime(int, int /*<<< orphan*/);
int main() {
  initTime(1, 0);
  for (;;) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <initTime@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <initTime@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @initTime(i32 1, i32 0)
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ floor(double);
double luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_floor(void) {
  double d = luaL_check_number(1);
  lua_pushnumber(floor(d));
}


x86 assembly (clang, -O0):
<math_floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <floor@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_floor>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
call   1050 <floor@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_floor() {
%1 = alloca double
%2 = call double @luaL_check_number(i32 1)
store double %2, double* %1
%3 = load double, double* %1
%4 = call i32 @floor(double %3)
%5 = call i32 @lua_pushnumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @math_floor() {
%1 = tail call double @luaL_check_number(i32 1)
%2 = tail call i32 @floor(double %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
bool pathValid(char *path) {
  if (access(path, F_OK)) {
    fprintf(stderr, "File %s does not exist\n", path);
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<pathValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%rax
je     116d <pathValid+0x4d>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1174 <pathValid+0x54>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathValid>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
test   %rax,%rax
je     1153 <pathValid+0x33>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_OK = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"File %s does not exist\0A\00"
define i32 @pathValid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @F_OK
%6 = call i64 @access(i8* %4, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@F_OK = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"File %s does not exist\0A\00"
define i32 @pathValid(i8* %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ 0, %5 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *arg) {
  printf("Usage: %s <option(s)> \n"
         "\t-x\t set size of x dimension\n"
         "\t-y\t set size of y dimension\n"
         "\t-X\t set x coordinate for pulse\n"
         "\t-Y\t set y coordinate for pulse\n"
         "\t-t\t set number of time steps\n",
         arg);
}


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

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

LLVM IR (-O0):
@.str = [176 x i8] c"Usage: %s <option(s)> \0A\09-x\09 set size of x dimension\0A\09-y\09 set size of y dimension\0A\09-X\09 set x coordinate for pulse\0A\09-Y\09 set y coordinate for pulse\0A\09-t\09 set number of time steps\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [176 x i8] c"Usage: %s <option(s)> \0A\09-x\09 set size of x dimension\0A\09-y\09 set size of y dimension\0A\09-X\09 set x coordinate for pulse\0A\09-Y\09 set y coordinate for pulse\0A\09-t\09 set number of time steps\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_method();
int main(int argc, char **argv) {
  test_method();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_method()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ query;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int write(int, unsigned char *, int);
void writeVersionQuery(int fd) {
  unsigned char query[] = "$PMTK605*6D\r\n";
  if (write(fd, query, sizeof(query)) == -1) {
    printf("error writing\n");
    perror("perror writing");
  }
}


x86 assembly (clang, -O0):
<writeVersionQuery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xebc(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeb6(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x12(%rbp),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    118c <writeVersionQuery+0x5c>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
call   1050 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeVersionQuery>:
sub    $0x18,%rsp
movabs $0xa0d44362a3530,%rax
mov    %rax,0xe(%rsp)
movabs $0x3530364b544d5024,%rax
36 30 35
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0xe,%edx
call   1040 <write@plt>
cmp    $0xffffffff,%eax
je     116b <writeVersionQuery+0x3b>
add    $0x18,%rsp
ret
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
add    $0x18,%rsp
jmp    1050 <perror@plt>

LLVM IR (-O0):
@__const.writeVersionQuery.query = [14 x i8] c"$PMTK605*6D\0D\0A\00"
@.str = [15 x i8] c"error writing\0A\00"
@.str.1 = [15 x i8] c"perror writing\00"
define void @writeVersionQuery(i32 %0) {
%2 = alloca i32
%3 = alloca [14 x i8]
store i32 %0, i32* %2
%4 = bitcast [14 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%7 = call i32 @write(i32 %5, i8* %6, i32 14)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@__const.writeVersionQuery.query = [14 x i8] c"$PMTK605*6D\0D\0A\00"
@.str.1 = [15 x i8] c"perror writing\00"
@str = [14 x i8] c"error writing\00"
define void @writeVersionQuery(i32 %0) {
%2 = alloca [14 x i8]
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%4 = call i32 @write(i32 %0, i8* %3, i32 14)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6, %1
ret void
}
void test_invalid_clause() {
  int i, a;
#pragma omp parallel master taskloop foo bar
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel master taskloop nogroup nogroup
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel master taskloop in_reduction(+ : a)
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_invalid_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_invalid_clause+0x28>
jmp    111a <test_invalid_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_invalid_clause+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_invalid_clause+0x4c>
jmp    113e <test_invalid_clause+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_invalid_clause+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_invalid_clause+0x70>
jmp    1162 <test_invalid_clause+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_invalid_clause+0x53>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_invalid_clause() {
ret void
}
/* Type definitions */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void get_walltime(double *wcTime) {
  struct timeval tp = {0};
  gettimeofday(&tp, NULL);
  *wcTime = (double)(tp.tv_sec + tp.tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<get_walltime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xea4(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_walltime>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  0xeb7(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64, i32 }
define void @get_walltime(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
store double* %0, double** %2
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %8, %11
%13 = load double*, double** %2
store double %12, double* %13
ret void
}

LLVM IR (-O2):
%struct.timeval = type { double, i64, i32 }
define void @get_walltime(double* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %7
store double %11, double* %0
ret void
}
char to_upper(char c) { return c >= 'a' && c <= 'z' ? c + 'A' - 'a' : c; }


x86 assembly (clang, -O0):
<to_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <to_upper+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <to_upper+0x36>
movsbl -0x1(%rbp),%eax
add    $0x41,%eax
sub    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <to_upper+0x3d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upper>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @to_upper(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, 97
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 65
%14 = sub nsw i32 %13, 97
br label %18
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @to_upper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ror8(uint8_t x, int r) { return (x >> r) | (x << (8 - r)); }


x86 assembly (clang, -O0):
<ror8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror8>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
mov    $0x8,%dl
sub    %cl,%dl
mov    %edx,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ror8(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 8, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror8(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 8, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
unsigned int fn_calc_memory_chunk_crc32(void *, unsigned int, unsigned int);
unsigned int fn_calc_memory_crc32(void *p, unsigned int n_bytes) {
  ;
  return (fn_calc_memory_chunk_crc32(p, n_bytes, ((unsigned int)0)));
}


x86 assembly (clang, -O0):
<fn_calc_memory_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <fn_calc_memory_chunk_crc32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_calc_memory_crc32>:
xor    %edx,%edx
jmp    1030 <fn_calc_memory_chunk_crc32@plt>

LLVM IR (-O0):
define i32 @fn_calc_memory_crc32(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 @fn_calc_memory_chunk_crc32(i8* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fn_calc_memory_crc32(i8* %0, i32 %1) {
%3 = tail call i32 @fn_calc_memory_chunk_crc32(i8* %0, i32 %1, i32 0)
ret i32 %3
}
void AVCDecodeContextAdaptiveVariableLengthCoding() {}


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

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

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

LLVM IR (-O2):
define void @AVCDecodeContextAdaptiveVariableLengthCoding() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
void sprint_inc_atRi(char *str, unsigned char i) {
  sprintf(str, "INC   @R%X                       ", i);
}


x86 assembly (clang, -O0):
<sprint_inc_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_inc_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"INC @R%X \00"
define void @sprint_inc_atRi(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"INC @R%X \00"
define void @sprint_inc_atRi(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
double sinh(double x) { return 4; }


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

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

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @sinh(double %0) {
ret double 4.000000e+00
}
char *viewResult(int r) { return (r == 1) ? "SUCCESS" : "FAILURE"; }


x86 assembly (clang, -O0):
<viewResult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef7(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x1,%edx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<viewResult>:
cmp    $0x1,%edi
lea    0xef6(%rip),%rcx
lea    0xef7(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"SUCCESS\00"
@.str.1 = [8 x i8] c"FAILURE\00"
define i8* @viewResult(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"SUCCESS\00"
@.str.1 = [8 x i8] c"FAILURE\00"
define i8* @viewResult(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct mg_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mg_context *);
void free_context(struct mg_context *ctx) { free(ctx); }


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

x86 assembly (clang, -O2):
<free_context>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.mg_context = type { i32 }
define void @free_context(%struct.mg_context* %0) {
%2 = alloca %struct.mg_context*
store %struct.mg_context* %0, %struct.mg_context** %2
%3 = load %struct.mg_context*, %struct.mg_context** %2
%4 = call i32 @free(%struct.mg_context* %3)
ret void
}

LLVM IR (-O2):
%struct.mg_context = type { i32 }
define void @free_context(%struct.mg_context* nocapture %0) {
%2 = tail call i32 @free(%struct.mg_context* %0)
ret void
}
void PGMPhysSimpleDirtyWriteGCPtr(void) {}


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

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

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

LLVM IR (-O2):
define void @PGMPhysSimpleDirtyWriteGCPtr() {
ret void
}
int SDL_imageFilterSubUintMMX(unsigned char *Src1, unsigned char *Dest,
                              unsigned int SrcLength, unsigned int C,
                              unsigned int D) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterSubUintMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SDL_imageFilterSubUintMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
ret i32 -1
}
void UnpackSumDff() {}


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

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

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

LLVM IR (-O2):
define void @UnpackSumDff() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_c_block_comment();
int /*<<< orphan*/ test_c_comment_entities();
int /*<<< orphan*/ test_c_comments();
int /*<<< orphan*/ test_c_empty_comments();
void all_c_tests() {
  test_c_comments();
  test_c_empty_comments();
  test_c_block_comment();
  test_c_comment_entities();
}


x86 assembly (clang, -O0):
<all_c_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_c_comments@plt>
mov    $0x0,%al
call   1050 <test_c_empty_comments@plt>
mov    $0x0,%al
call   1060 <test_c_block_comment@plt>
mov    $0x0,%al
call   1030 <test_c_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_c_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_c_comments@plt>
xor    %eax,%eax
call   1050 <test_c_empty_comments@plt>
xor    %eax,%eax
call   1060 <test_c_block_comment@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_c_comment_entities@plt>

LLVM IR (-O0):
define void @all_c_tests() {
%1 = call i32 (...) @test_c_comments()
%2 = call i32 (...) @test_c_empty_comments()
%3 = call i32 (...) @test_c_block_comment()
%4 = call i32 (...) @test_c_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_c_tests() {
%1 = tail call i32 (...) @test_c_comments()
%2 = tail call i32 (...) @test_c_empty_comments()
%3 = tail call i32 (...) @test_c_block_comment()
%4 = tail call i32 (...) @test_c_comment_entities()
ret void
}
void TerminateMisc(void) {}


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

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

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

LLVM IR (-O2):
define void @TerminateMisc() {
ret void
}
/* Variables and functions */
int close(int);
int srcUdpSocket_close(int socketFD) { return close(socketFD); }


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

x86 assembly (clang, -O2):
<srcUdpSocket_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @srcUdpSocket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ japi_pack(int);
void j_pack(int arg0) { japi_pack(arg0); }


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

x86 assembly (clang, -O2):
<j_pack>:
jmp    1030 <japi_pack@plt>

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

LLVM IR (-O2):
define void @j_pack(i32 %0) {
%2 = tail call i32 @japi_pack(i32 %0)
ret void
}
int gb_max_int(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<gb_max_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <gb_max_int+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <gb_max_int+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gb_max_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int fun816() { return 816; }


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

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

LLVM IR (-O0):
define i32 @fun816() {
ret i32 816
}

LLVM IR (-O2):
define i32 @fun816() {
ret i32 816
}
void ZeroOut(float *f, int siz) {
  float *fptr;
  int i;
  for (fptr = f, i = 0; i < siz; i++, fptr++)
    *fptr = 0.0;
}


x86 assembly (clang, -O0):
<ZeroOut>:
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    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114b <ZeroOut+0x4b>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <ZeroOut+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZeroOut>:
test   %esi,%esi
jle    1126 <ZeroOut+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @ZeroOut(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%7 = load float*, float** %3
store float* %7, float** %5
store i32 0, i32* %6
br label %8
8: ; preds = %14, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load float*, float** %5
store float 0.000000e+00, float* %13
br label %14
14: ; preds = %12
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
%17 = load float*, float** %5
%18 = getelementptr inbounds float, float* %17, i32 1
store float* %18, float** %5
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @ZeroOut(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Ramp(int);
void IF_dramp(void) { Ramp(1); }


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

x86 assembly (clang, -O2):
<IF_dramp>:
mov    $0x1,%edi
jmp    1030 <Ramp@plt>

LLVM IR (-O0):
define void @IF_dramp() {
%1 = call i32 @Ramp(i32 1)
ret void
}

LLVM IR (-O2):
define void @IF_dramp() {
%1 = tail call i32 @Ramp(i32 1)
ret void
}
__attribute__((always_)) void change_bit(int nr, volatile unsigned long *addr) {
  __asm__ __volatile__("lock ; "
                       "btcl %1,%0"
                       : "=m"((*(volatile long *)addr))
                       : "Ir"(nr));
}


x86 assembly (clang, -O0):
<change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock btc %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_bit>:
lock btc %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @change_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "lock ; btcl $1,$0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int32(int32_t n) { printf("%d", n); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_int32(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int dbus_init() { return 0; }


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

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

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

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

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xcolormap_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xcolormap.window;
}


x86 assembly (clang, -O0):
<get_XEvent_xcolormap_window>:
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_xcolormap_window>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xcolormap_window(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
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xcolormap_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int errors(char *, int);
int open(char const *, int /*<<< orphan*/);
int open_that(const char *pathname) {
  int fd;
  if ((fd = open(pathname, O_RDONLY)) == -1)
    return (errors(": No such file or directory\n", 84));
  return (fd);
}


x86 assembly (clang, -O0):
<open_that>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1163 <open_that+0x43>
lea    0xeaf(%rip),%rdi
mov    $0x54,%esi
call   1030 <errors@plt>
mov    %eax,-0x4(%rbp)
jmp    1169 <open_that+0x49>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_that>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     1136 <open_that+0x16>
pop    %rcx
ret
lea    0xec3(%rip),%rdi
mov    $0x54,%esi
pop    %rax
jmp    1030 <errors@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@.str = [29 x i8] c": No such file or directory\0A\00"
define i32 @open_that(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @errors(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 84)
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@.str = [29 x i8] c": No such file or directory\0A\00"
define i32 @open_that(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @errors(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 84)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ %3, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void cli_classic_abort_usage(const char *msg) {
  if (msg)
    fprintf(stderr, "%s", msg);
  printf("Please run \"flashrom --help\" for usage info.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<cli_classic_abort_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <cli_classic_abort_usage+0x30>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<cli_classic_abort_usage>:
push   %rax
test   %rdi,%rdi
je     114e <cli_classic_abort_usage+0x1e>
mov    %rdi,%rdx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [46 x i8] c"Please run \22flashrom --help\22 for usage info.\0A\00"
define void @cli_classic_abort_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@str = [45 x i8] c"Please run \22flashrom --help\22 for usage info.\00"
define void @cli_classic_abort_usage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ r;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint64_t util_getUINT64(const uint8_t *buf) {
  uint64_t r;
  memcpy(&r, buf, sizeof(r));
  return r;
}


x86 assembly (clang, -O0):
<util_getUINT64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @util_getUINT64(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
bool ch_is_slash(const char ch) { return (ch == '/'); }


x86 assembly (clang, -O0):
<ch_is_slash>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_is_slash>:
xor    %eax,%eax
cmp    $0x2f,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @ch_is_slash(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 47
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ch_is_slash(i8 signext %0) {
%2 = icmp eq i8 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
void __attribute__((weak)) __cxa_pure_virtual(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<__cxa_pure_virtual>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__cxa_pure_virtual+0x9>
jmp    1109 <__cxa_pure_virtual+0x9>

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

LLVM IR (-O0):
define weak void @__cxa_pure_virtual() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @__cxa_pure_virtual() {
br label %1
1: ; preds = %0, %1
br label %1
}